Show HN: Pattern.css – CSS-only library to fill empty background with patterns
github.com
github.com
You could reduce the distributed CSS version even more if you used the gradient definition only once, it's always the same.
background-image: repeating-linear-gradient(45deg, currentColor 25%, transparent 25%, transparent 75%, currentColor 75%, currentColor), repeating-linear-gradient(45deg, currentColor 25%, transparent 25%, transparent 75%, currentColor 75%, currentColor);
With class composition it's easy: .pattern-checks.xl {
background-position: 0 0, 100px 100px;
background-size: calc(2 * 100px) calc(2 * 100px);
}
But if you added a copy-paste ready snippet to the landing page, that would be great too.Some of your background boxes overlap with the sidebar.
As a developer: even with several browsers converging on the same renderer and JS runtime, it is _still untrue_ that all things work in all browsers [1] [2]. HTML, CSS, and JS continue to evolve as standards, and mobile browsers complicate the compatibility picture.
This may be hard to hear, but: right now, polyculture delivers largely abstract ideological benefits to a small subset of users who care about these things. Monoculture delivers real, tangible benefits in usability, performance, and accessibility to users, plus massive gains in productivity to developers and tech companies.
On top of that: few of the privacy / security features in modern browsers are at the rendering or JS runtime level - they often have more to do with defeating cross-domain cookie trackers, execution sandboxes around JS, a whole slew of security headers at the HTTP level, and value-added features like password managers and private browsing sandboxes. IMHO, centralization of the HTML / CSS / JS part is a net win for privacy / security, as it makes it possible to focus efforts on these sorts of features instead of on the fine details of basic rendering and execution.
[1] https://kangax.github.io/compat-table/es6/ [2] https://caniuse.com/
The JS problem was solved with jQuery.
(That said, the question of when to lean on existing convention vs. establish a new one is a difficult one.)
[1] https://www.nngroup.com/articles/ten-usability-heuristics/ [2] https://www.interaction-design.org/literature/article/princi...
I know it's still small, but I'd be tempted to extract just the rules I wanted. Very nice regardless.
.overflow-scroll {
overflow: scroll !important;
}
`overflow: scroll` is pretty much never what you want: it draws scrollbars whether needed or not. You want `overflow: auto` instead, which doesn’t draw scrollbars unless necessary. .w-100vw {
width: 100vw !important;
}
Viewport units are fundamentally broken by design. Don’t ever use them for layout. In fact I recommend against using them in any situation at all. In this case, use `width: 100%` or just nothing, and it’ll yield the desired results.That's a pretty bold claim. Can you elaborate on that?
https://news.ycombinator.com/item?id=21244656
https://news.ycombinator.com/item?id=20956850
The currently-implemented viewport units are just fundamentally bad. And I’ve only been talking about the badness of vw; vh has further troubles of its own on mobile.
Edit: Rereading made me sound very salty. Nice project and I'm sure I'll use it in the future.
Thank you for sharing!
I'm guessing it's a bug in Firefox with sub-pixel rounding.
Looks like from the source that this would cut the size by 75%.
Site could use some help though. Consider making a repo for the actual website please! Would love to help clean it up a bit.
>Only CSS. No JavaScript!
It is indeed a feature, and one that I wish the vast majority of websites adopted.