How to have the browser pick a contrasting color in CSS(webkit.org) Have you ever wished you could write simple CSS to declare a color, and then have the browser figure out whether black or white should be paired with that color? Well, now you can, with contrast-color(). Here’s how it works.
CSS Attr() Gets an Upgrade(chrome.com) With CSS attr() you can use the value of an HTML attribute in your CSS. Until now attr() only worked within the content property of pseudo-elements and could only parse values into a CSS <string>.
The Height Enigma (CSS)(joshwcomeau.com) Back when I was first trying to understand CSS, one of the biggest mysteries to me was why height sometimes wouldn’t work.
Plain Vanilla Web(plainvanillaweb.com) An explainer for doing web development using only vanilla techniques. No tools, no frameworks — just HTML, CSS, and JavaScript.
CSS Zen Garden(csszengarden.com) A demonstration of what can be accomplished through CSS-based design. Select any style sheet from the list to load it into this page.
Default styles for h1 elements are changing(mozilla.org) Browsers are starting to roll out changes in default UA styles for nested section headings. Developers should check that their sites don't rely on UA styles for certain cases to avoid unexpected results and failing Lighthouse checks. In this post, we'll have a look at what the incoming changes are, how to identify if it's an issue on your pages, and some hints for conformant and better-structured websites.
368 points by soheilpro 44 days ago | 264 comments
Better typography with text-wrap pretty(webkit.org) Support for text-wrap: pretty just shipped in Safari Technology Preview, bringing an unprecedented level of polish to typography on the web. Let’s take a look at what the WebKit version of pretty does — it’s probably a lot more than you expect. Then, we’ll compare it to balance and the other text-wrap values to better understand when to use which one.
364 points by todsacerdoti 46 days ago | 153 comments
Dark mode with almost no CSS(feep.dev) Feep! now has a dark mode theme! The stylesheet for the site is a fairly minimal set of overrides on top of the browser default stylesheet, so adding this support was actually pretty straightforward, though there were a few complications.
CSS-Only Glitch Effect(muffinman.io) Let me show you how I created a CSS-only image glitch effect. I was working on the robot poet and wanted my robotic bard to glitch - because it felt fitting given the quality of poetry it generates.
15 points by todsacerdoti 51 days ago | 1 comments
Item Flow, Part 1: A new unified concept for layout(webkit.org) CSS Grid and Flexbox brought incredible layout tools to the web, but they don’t yet do everything a designer might want. One of those things is a popular layout pattern called “masonry” or “waterfall,” which currently still requires a Javascript library to accomplish.
Minding the gaps: A new way to draw separators in CSS(windows.com) Drawing separator lines between various sections of a webpage is a common design technique, which can help to structure the content and make it more readable, as well as more aesthetically pleasing.
Take a New Look at CSS Shapes (2018)(smashingmagazine.com) This week, CSS Shapes ships in a production version of Firefox with the release of Firefox 62 — along with a very nice addition to the Firefox DevTools to help us work with Shapes.
Privacy and the :visited selector(mozilla.org) Before about 2010, the CSS :visited selector allowed websites to uncover a user's browsing history and figure out what sites the user had visited. This was done through window.getComputedStyle and other techniques. This process was quick to execute, and made it possible not only to determine where the user had been on the web, but could also be used to guess a lot of information about the user's identity.
5 points by spaghetti-code 74 days ago | 1 comments
You suck at CSS and that's okay (2022)(rexriepe.com) This book is about writing CSS. It's also about not writing CSS. It's aimed at people who want to learn CSS, people who want to avoid CSS, amateurs, professionals and everyone in-between. The book aims to provide context as to why CSS and the design ecosystem surrounding it are the way they are. It's written to support the California Stylesheets CSS framework.