415 private links
Text rotating at the borders of an image
HTML and CSS only 😃
ReliCSS is a "CSS hack" detection tool designed to help developers identify and replace outdated browser-specific CSS hacks with modern, standards-compliant alternatives.
Real-time "CSS hack" detection and analysis with instant feedback
Context-aware modern CSS suggestions
Client-side processing - your code never leaves your device
Differences:
light-dark()requires acolor-schemeprefer-color-schemedoesn't consider thecolor-scheme
Card content alignment with CSS subgrid
We can compute the amount of red, green and blue with the rgb() function. The same applies to color functions.
hsl() has limitations because the percieved color is not consistent accross hue, saturation and lightness values. That's why oklch comes in: it's a 2020 patch of the 1976 version of lch, that itself improves over hsl.
Also color-mix can be used in different color spaces. Transparency is available when two colors have a sum less than 100%, or mix one color with transparent.
In order to avoid repetition, custom functions is coming to CSS.
While some of what we looked at does require some setup — once it’s in place, we can create very robust systems, and, along with the static world of design software, it does beg the question if more design should be done directly in the browser.
#idea #project create the colors of a design system directly from the browser.
A 3D engine relying on HTML and CSS.
Useful CSS utilities, elements, complete UI blocks and templates.
Carousel are inaccessible and even more with CSS only solutions.
It completely fails with regard to separation of concerns by using CSS for structure, rather than HTML.
The rule of thumb:
HTML is for structure, CSS is for styling, JS is for anything that can’t be achieved with HTML/CSS, and accessibility isn’t omittable.
A free open-source chat platform
Colors:
how do we decide where to use custom properties? There are really two cases:
1) whenever we need to use the same value in more than one place (DRY)
2) when we know a value is going to be changed.
Custom Properties:
I already use the css variables methods. They are great. Note we can inline them and avoid a verbose default: var(--btn-color, var(--color-text))
You can think of :has() as a way to query an element about what’s inside it.
This makes our button class very flexible. You can throw about any combination of things inside it, and it will adjust accordingly. Text only, image and text, image only, inputs (like radio buttons), or multiple images with text.
The post of 37signals takes also the sidebar into account. The trigger button can be pure CSS even if the icon in it changes. :has() allow to verify if a button inside an element is disabled too.
Responsive design:
They use one @media breakpoint (max-width: 100ch) for a two column layout.
Using characters as the unit of measure ensures that we get the right behavior no matter which device you’re using and in a number of other scenarios such as multitasking on iPad or even if you simply enlarge the font size past a certain point. Type is the heart of web pages so it makes sense for the layout to respond to it.
Feature enhancements such as hover or touch effects with media queries: @media (any-hover: hover) in combination with (pointer: fine) or (pointer: coarse)
Great stuff and kudos to them 👏
with currently 90% support, this feature can render or hide the content (without taking space in the layout). Note the auto value can optimize the rendering
In comparison with the display: none trick, developers don't need to specify the layout display: flex | grid | block anymore.
Are they useful? I think not. It might be useful, but overall, it's better to read the specifications.
Following https://dev.37signals.com/modern-css-patterns-and-techniques-in-campfire/
More thoughts about utility classes (only utilities and not a core use anymore), :has(),
What fascinated me most was watching the architecture evolve across releases.
Campfire: OKLCH colors, Custom properties for everything, character-based spacing, flat file oranization, View Transitions API
Writebook (2nd): COntainer queries for component-level responsiveness, @starting-style for entrance animations
Fizzy (3rd release): CSS Layers, color-mix() and complex :has() to replace JS.
37Signals share their product codes in Open Source. That's awesome because we can learn from it:
/* Fizzy's layer architecture */
@layer reset, base, components, modules, utilities;
@layer components {
.btn { /* Always lower specificity than utilities */ }
}
@layer utilities {
.hide { /* Always wins over components */ }
}
A CSS only spinner under 30 lines of CSS code. "Pure creativity".
A better <mark> that draws a hand-drawn circle around matched terms.
They also created dialog animations in CSS only.
They are CSS "cascading" variables, and they can also be custom properties with @property.
* {
letter-spacing: clamp(
-0.05em,
calc((1em - 1rem) / -10),
0em
);
}