css-media-vars would be a game changer for me, if it will be possible to use one var and not define many varnames and put them together to one var.
Like your Example:
--xs-width: var(--media-xs) 100%;
--sm-width: var(--media-sm) 49%;
--md-width: var(--media-md) 32%;
--lg-width: var(--media-gte-lg) 24%;
width: var(--xs-width, var(--sm-width, var(--md-width, var(--lg-width))));
If it would work something like this, it would be really awesome: --width: var(--media-xs) 100%;
--width: ifundefvar(--media-sm) 49%;
--width: ifundefvar(--media-md) 32%;
--width: ifundefvar(--media-gte-lg) 24%;
width: var(--width);
Or --width: var(--media-xs) 100%
else var(--media-sm) 49%
else var(--media-md) 32%
else var(--media-gte-lg) 24%
else 5%
width: var(--width);Don't take me wrong - I love SASS. Well, I wrote one of the early Less to Sass translator for Bootstrap (I think around 2009) and wrote Sass syntax plugins for the likes of Coda editor.
However, if I want to build something today that needs to stand the test of time, I know I can write in HTML + CSS and it will be still work (likely) a century from now, without me having to re-install NPM Packages and compile my Sass to CSS. Of course, I might garnish it finally with PostCSS to take advantage of the modern tooling and augment the lacking of current CSS.
P.S. Recently, I was trying to update an old project and looks like Sass deprecated node sass in favor of something new. I'm not even able to keep up with which processor is the right one to use!
Again, this won't work for many projects, but the point of it is long-term maintainability. I assume that most of what is built into major, recent browsers will have the longevity of bottled wine, while technologies outside the browser will be more like fresh grapes. If I want the site itself to be more like the wine than the grapes, doing something with it years from now shouldn't require a tool that no one has used for years.
Even if your point is good, that's just not a productive way to start out.
A much better way to say it is “supports almost all browsers except IE” it’s accurate (as this does support almost all browsers in the world) while details what may be a major hangup for a business user.
Anyway, I can add a note to call out that it specifically doesn't include IE for people who might not follow the resource linked at the end of the sentence you're talking about where IE11 is the first browser in the list.
Do you have plans to build a full framework based on this? (Other than augmented-ui?)
css-media-vars only happened because I recently began work on the new site/staticlandingpage for augmented-ui (v2 is my primary project right now) and was actively procrastinating because I didn't want to copy paste @media statements everywhere lol
the AND and OR logic syntax a little clunky to me. i'd love something more first class from the CSSWG in accommodating this.
I've created a couple JS Bins if you want to play around with it a bit, resize the "output" pane to see it update:
Minimal example: https://jsbin.com/giqedowale/edit?css,output
More involved example: https://jsbin.com/yicuqujehe/1/edit?html,css,output
If you're familiar with CSS, it may seem like it's impossible for this to work without scripts, but while working on another project I realized in the CSS Spec for custom properties that combining a few small details they've highlighted, in a specific order, it makes it possible to do all kinds of things that have never been possible before in CSS. This is the first project I've released using the idea.
Anyway, it's totally free and open source too so hack away if you'd like! https://github.com/propjockey/css-media-vars
I'll probably be refreshing this page for a while, so I'm happy to answer any questions or dive into the CSS Spec with you and talk about the tech if you're curious!