The Future of CSS (joshwcomeau.com)
paczki 4 days ago
yahoosakie 4 days ago
I've done the same for years, and it feels a little bit like the IQ bell curve meme, where on the left and right it is like "vanilla HTML/CSS/JS are all you need."
appplication 4 days ago
80fj0348i 4 days ago
nkmnz 4 days ago
soperj 4 days ago
zelphirkalt 4 days ago
I nowadays use flex, calc, clamp, min, max, scoped variables, and even display table sometimes these days and it just works so well. Eliminates almost all hacks.
soperj 4 days ago
jimbob45 4 days ago
This attitude is why we’re all still stuck writing C++ in 2026. Nobody wants to admit that they’re not hardcore enough to write in poorly designed languages so we never make the effort to improve the situation. We all seem to agree that Zig is an upgrade over C. There’s nothing inherently modern about Zig that we couldn’t have written back in 1995 - we just didn’t because nobody wanted to admit that C is frustrating and clunky, albeit fast.
KPGv2 4 days ago
satvikpendem 4 days ago
I honestly didn't know people like this still existed, with such strong viewpoints on C.
80fj0348i 4 days ago
Point out to these people that compilers rewrite your code quite significantly so the choice of language matters a lot less than the choice of debugger, profiler, etc.
onion2k 4 days ago
zelphirkalt 4 days ago
lucumo 4 days ago
GP asked about reactivity. And that still requires some frameworking, either prebuilt or a lightweight self-written one.
oblio 4 days ago
bleuarff 4 days ago
0xpgm 4 days ago
Whenever state is updated, the listeners are all called with the updated state and can update the UI and what not based on the new state.
I haven't profiled this and compared it to frameworks, but feels adequate for the relatively simple UIs I've done.
troupo 4 days ago
skydhash 4 days ago
Most web apps and websites do not have that much state variables (even though it may be a lot of data). So while React may offer a small dev speed boost, it’s consumed by the need to build stuff and a whole deploy pipeline to nurse.
Libraries like HTMX and Alpine can take care of most the boilerplate for old style imperative patterns. And backend frameworks like Rails, Phoenix, Laravel donhave their own implementation for data updates.
hnlmorg 4 days ago
What the frameworks do is take this concept one step further to create a SPA (single page application) but I honestly think they’re an antipattern that needs to die.
spoiler 4 days ago
Anyone can write code that tweaks nodes or uses templating, but doing it in a consistent way on a project with hundreds of thousands linea of code is challenging, especially if you also need performance and everyone's least favourite child: accessibility.
Sure you don't get some of this with frameworks, but they help a lot.
hnlmorg 4 days ago
abanana 4 days ago
"Reactivity" means "when those variables change, some generic code already exists to update the DOM instantly". As opposed to writing specific pieces of code to make those changes directly.
Unfortunately, with React, "updating the DOM automatically" generally means: you update the data; React recreates the entire DOM as a new copy in memory; React runs a diff checker to find out what changed from the real DOM; React makes each individual change in the real DOM. With React (or other virtual-DOM-centered alternatives) being used for the smallest of web projects, so many small sites do all that work when the procedure ought to be as simple as: you update the data; you update the DOM directly.
It comes down to inexperienced devs not being able to consider which tool is best for the job at hand, and just hammering nails into every web project in the same way.
tancop 4 days ago
Signals are basically as fast as writing event handlers yourself but way less fragile and verbose. React is just shaping everyone's impression of all JS frameworks because it's very popular and very slow.
seanw444 4 days ago
bluecheese452 4 days ago
Your javascript can target those 2 divs, ala doc.getElementById(counter).innerHtml and document.createElement.
Like that kind of works for simple stuff. But it gets more complicated fast. Reactivity is when your counter listens for change in the count and updates itself whenever that count changes.
zahlman 4 days ago
troupo 4 days ago
Works well for a small bumber of things to update, quickly becomes unmanageable.
6510 4 days ago
I consider it a huge advantage to have the code for both the counter and the banner in the same place. thisCounter++; thisBanner.className = "shown";
zelphirkalt 4 days ago
Well, that's simplifying the situation, but as those situations become more and more in ones site, at some point one might switch to a mediator pattern, which kind of is very close to signal emit and listening for signals.
V__ 4 days ago
hirvi74 4 days ago
yieldcrv 4 days ago
But it has no utility
Compute is fine and nearly free
These are just art projects
azangru 4 days ago
Really knowing what you're doing is the implicit part of the right-hand side of the bell-curve meme :-)
coldtea 4 days ago
Yes. We could do those before React and other crap too.
satvikpendem 4 days ago
abanana 4 days ago
That's always the trotted-out response, most often recited by people who've read someone else saying it but not had the experience to form an opinion for themselves.
You absolutely don't end up recreating a massive, bloated, slow framework that tries to be as generic as possible to try to be everything to everyone. What you end up creating is a relatively tiny, fast, piece of code that is specific to that site's needs. The difference in size, speed and simplicity tends to be absolutely enormous.
satvikpendem 4 days ago
6510 2 days ago
reef_sh 4 days ago
Once you start adding dynamic forms for managing multiple items of different kinds, dashboards, error states, i18n, etc, you either end up with a homegrown framework, or with a lot of spaghetti.
abirch 4 days ago
publlus_enigma 3 days ago
Almost every web application being built today, framework or no framework, is a variation of a theme. We have no issue recreating those ad nauseum, but we draw the line at recreating a framework?
satvikpendem 3 days ago
mb2100 4 days ago
satvikpendem 4 days ago
codingdave 4 days ago
That is an odd caveat to throw on the end. Sure, to avoid frameworks you have to know what you are doing. Is that really such an outrageous expectation?
bossyTeacher 4 days ago
skydhash 4 days ago
Not really. Frameworks are usually created to avoid boilerplate and provide some nice scaffolding to support you while you’re coding the business layer. And a lot of them do smooth over accidental complexity, even though the architecture is generic and may hinder you in the future.
But the learning curve still exist, as most of what you interact with is custome codes, modules and components.
chrisweekly 4 days ago
JimDabell 4 days ago
No. Use a framework if you want those things. Everything around reactivity, state management, and components have been badly fumbled by the web platform and the various front-end frameworks are far more ergonomic.
DimmieMan 4 days ago
Smaller bundles, often easier to use, less bug potential. Code's a liability and being able to occasionally rip a bunch out as a feature becomes baseline is always a joy.
Tadpole9181 4 days ago
Y'all know React and Vue frameworks still use HTML, CSS, and JS, right? We're using the same thing, with a thin layer of helpers around mounting components and managing their lifetimes...
culi 4 days ago
yard2010 4 days ago
Quothling 4 days ago
On the flip-side I always found javascript frameworks to have a purpose. Though to be fair I don't think I've worked with user facing javascript without a framework since jquery came about. I guess you could call that a library, but still.
rimliu 4 days ago
SlackingOff123 4 days ago
alerighi 4 days ago
Of course you can still write plain CSS.
chamomeal 4 days ago
But it is SO nice to not have any build step. All of my new projects start as a single babashka script now. You got html templating, throw in a stylesheet. Slap a datastar script tag in there for everything else. It’s just easy peasy.
shevy-java 4 days ago
I find it is way too complicated with regards to flexbox, grid etc...
Just do a google search for flexible divs side by side. Start with two. Then switch to five. Tell me the solutions that work well.
nilslindemann 4 days ago
6510 4 days ago
xboxnolifes 4 days ago
zelphirkalt 4 days ago
azangru 4 days ago
I did like you asked. The first search result on google is a question on stack overflow. And the first comment provides an example that looks very much like flexible divs, side by side, between two and four based on the width of the container.
https://stackoverflow.com/questions/60615826/two-divs-side-b...
What didn't you like about the solution in that comment?
flohofwoe 4 days ago
IMHO even HTML+CSS should be completely implemented outside the browser in the 'framework layer', but I guess that's not a very popular opinion among the more 'conservative' web devs ;)
Rygian 4 days ago
Meanwhile, there's Typst bundles [1], still experimental, that implement the same idea backwards: convergint a Typst project into a set of output files (which can be HTML).
afavour 4 days ago
But there is probably a world where what you’re describing is possible with WASM and Canvas. Would need to solve for accessibility though.
sourcecodeplz 4 days ago
dont need to import libraries anymore, can just build my own.
lachlanj 4 days ago
alwillis 4 days ago
troupo 4 days ago
What exactly has gotten good?
CSS is the only area that is seeing improvement, and frameworks ... use the same CSS, so no idea what you're talking about.
Most everything outside of CSS has been and continues to be shit.
Edit: Moreover, literally all frameworks as one say: give us good browser APIs so that we don't have to do any of the things we do.
khalic 4 days ago
salah7252 4 days ago
ARandomerDude 4 days ago
letrix 4 days ago
Theoleff 4 days ago
(Full disclosure, I wrote a book on this, so I'm not exactly neutral: https://theosoti.com/you-dont-need-js/)
abanana 4 days ago
While a lot of devs love to use brand-new stuff that's only just been added to some browsers, some of us are not willing when we know it won't work for (almost) all users. The scroll() function is too new for use in production, IMO (but good to know it exists, to revisit after a while). If I have to code something else anyway, or copy-and-paste a polyfill, then why not just use a more robust option in the first place.
6510 2 days ago
fodkodrasz 4 days ago
But who needs these, when we can have bezel and whatnot...
Who needs ways to reliably trigger the display of the touch platform-native keyboard, to be notified if it is displayed and to move the input field in view so it is not obscured by the keyboard?
This is why the web is a terrible platform compared to Windows Forms for getting stuff done. Because those making the standards only work on creating gimmicks.
4b11b4 4 days ago
fodkodrasz 4 days ago
jorisw 4 days ago
Rage bait, don't engage
hollowturtle 4 days ago
Totally agree, but afaik we are a very small minority. My tinfoil hat theory is that all of this is intentional to keep monopolies and making it impossible to compete in the browser space
jorisw 4 days ago
What does one (CSS tech) even have to do with the other (competition in the 'browser space')?
tomaskafka 4 days ago
And I believe the OP is right. Keep people busy working with changes that don’t move the needle, each of the three large platforms wants to lock in the serious use cases into their native apps.
nkrisc 4 days ago
jorisw 4 days ago
KPGv2 4 days ago
The assertion is that the major browser owners (Apple, Microsoft, Google, Mozilla) don't want competition, so they keep CSS complicated.
All four of these companies are members of the CSS Working Group. So the ability to do this is within their power.
jorisw 4 days ago
ragall 4 days ago
mfru 3 days ago
nozzlegear 4 days ago
KPGv2 3 days ago
You control the browser, you control the ad experience, the use data, etc.
It's unclear to me what an App Store has to do with anything. (Microsoft does have an app store, by the way. https://apps.microsoft.com/home?hl=en-US&gl=US )
oblio 4 days ago
This is a phenomenon that dates back to IBM doing this in the 60s-70s-80s.
garbagecreator 4 days ago
Web of applications is a novel idea if executed well, but imo just download the executable and use the package manager to update it, and we still have the internet for communication, there's no need for a pseudo OS on top of the OS, if you want sandboxing and a VM do what they did with Java. The modern Web is unnecessary, everything that needs JS or frameworks is because of the retardation in the initial primitive design of the WWW and html, everything could have been implemented in a new xml markup akin to htmx, they were steering to that with their ideas in XHTML2 but never finished because of oppositions from Google et al. Other things like implementing an office suit or playing games in the browser is incompatible with the WWW, and like I said you better go and make a better platform for that.
Today it's simple to write your own OS than make a web browser, which contradicts everything about the web being decentralized and a protocol, what's the difference then if we would send propriety bytecode to this VM called the modern web instead of html et al? Sure you can still use and support a subset, and because of that I mentioned this idea as the first sentence, but this is the trick of EEE; the majority would bite the propriety extended conveniences and make it the new standard, then they would constantly extended until it becomes a game of resources which they have the higher hand in.
Some would say it's opensource and anyone can implement it, that's half the truth when it's so complex and grand that only *big* corporations can handle it, and that the WHATWG confessed that the real standard became the source code of the big 3: chromium, webkit, and gecko.
Those that believe this is some kind of "tinfoil hat bs" and there's no conspiracy are worse than those that believe everything is a conspiracy; because at least the latter would be right once, while the former are never right. I didn't mention also how the new web makes it easier for their spyware, but that's obvious. The web was about decentralization and standardization, but they skillfully made it the literal opposite.
Parodper 4 days ago
It would have been the application platform people ask for, with a separate namespace for application-related tags so you can just switch them up with the OS's native UI controls.
Instead of that, we got Yet Another VM, WebAssembly.
pseudosavant 4 days ago
Never mind that when Microsoft licensed Java from Sun for IE3 and IE4, Sun sued Microsoft. Sun wanted to be the only distributor of Java, just like Adobe was with Flash. So, browsers wouldn't have actually included a Java runtime out of the box without licensing/paying Sun for it. I'm sure that dependency would have only gotten even better under Oracle.
Those of us old enough to remember the web with plugins, don't miss plugins.
Parodper 4 days ago
I don't necessarily like the JVM, it's just the most popular system-independent bytecode virtual machine (and historically plausible). It's a lot easier to built a bytecode interpreter than a full language. As mentioned elsethread, Scheme would have been even better, with an even smaller base.
XHTML, however, full in. Namespaces and syntax checking alone would have been worth it.
> Never mind that when Microsoft licensed Java from Sun for IE3 and IE4, Sun sued Microsoft.
Microsoft was in their peak EEE era, no wonder Sun didn't want to do anything with that.
> Those of us old enough to remember the web with plugins, don't miss plugins.
That's why I didn't mention plugins, browsers would have a JVM engine, instead of a JS one.
pseudosavant 4 days ago
Think of how truly horrendous it would be if every browser had the JVM built in and Oracle was calling the shots on the language the whole web is written on? How much would they be charging for a license?
Parodper 3 days ago
pseudosavant 3 days ago
btown 4 days ago
I'd love to see this level of customization come to date and datetime-local popups, finding a meaningful path that preserves compatibility with the design languages of various platforms. If and when that happens, it will be because of the work of standardization working groups like Open UI and Interop.
silvestrov 4 days ago
They are only simple when you have no restrictions on which dates that can be selected.
But a date picker for a hotel, airplane travel, restaurant, ... might have to show some days as disabled or some days that are "cheap offer" dates.
To this add anything that needs to select an interval, like an airplane return ticket.
xnorswap 4 days ago
troupo 4 days ago
I'd settle for a browser specific picker that works in 80-90% of use cases. Instead it took browser several years after introudcing type=date to make a datepicker that is actually usable, and not a throwaway tiny design cooked up by an underpaid intern
Narretz 4 days ago
pseudosavant 4 days ago
Those business rules, daylights savings (datetimes that can never happen, or happen twice), different M/D/Y ordering, different starting day of week, different timezones (including 15 or 30 minute offset ones like India, Iran, parts of Australia, etc), etc quickly complicate it. Oh, and don't forget about making it accessible.
That's before you even get into designers who want the date picker to look the same across platforms instead of using platform specific UI widgets...
I'm pretty sure my version of hell would be implementing a date picker until all stakeholders are happy with it (eternity).
user43928 4 days ago
What would the API even look like?
One could want to select a single date, multiple dates, a date range, multiple date ranges.
Perhaps some dates should be disabled, but should they just be greyed out or should there be a message when the user tries to select them, and if so, how can it be provided?
Then there are questions about different calendars and locales.
Perhaps third-party date picker libraries are more appropriate here than trying to address this in standards.
afavour 4 days ago
> Who needs ways to reliably trigger the display of the touch platform-native keyboard, to be notified if it is displayed and to move the input field in view so it is not obscured by the keyboard?
Sounds like you need window.visualViewport: https://developer.mozilla.org/en-US/docs/Web/API/VisualViewp...
> The mobile web contains two viewports, the layout viewport and the visual viewport. The layout viewport covers all the elements on a page and the visual viewport is what is actually visible on the screen. When the user pinch-zooms into the page, the visual viewport shrinks but the layout viewport is unchanged. User-interface features like the on-screen keyboard (OSK) can shrink the visual viewport without affecting the layout viewport.
lopis 4 days ago
runarberg 4 days ago
World hunger is now fully a political problem and needs to be solved politically. It may sound hard, but in this case it is only a matter of money. The right organizations just need more funding, again that might sound hard, how do you pick the right one, but in this case the right organization is almost always the UN World Food Programme. They need exactly $13B to solve world hunger. And that is not a lot of money.
lopis 4 days ago
runarberg 4 days ago
Jokes aside, I never has had any major problem with `<input type="date">`. Yes there are some annoyances when translating between local time and an absolute timezone aware timestamp. Yes it is annoying that `.valueAsDate()` doesn’t work out of the box. But those are very easy to overcome with a three line utility function.
harpersealtako 4 days ago
runarberg 4 days ago
fodkodrasz 4 days ago
Did I claim CSS being useless eyecandy? Nope. Bezels and squircles? Yes.
stasomatic 4 days ago
<div class="container"></div> .container { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; gap: 0px 0px; grid-auto-flow: row; grid-template-areas: ". . ." ". . ." ". . ."; }
I've been away from CSS for a few years and this looks alien to me. I don't know any of this syntax except for the div declaration, and I used to think I was good at CSS with less and sass. I don't want to deal with molecules, or atoms, this is just too much.
_bent 3 days ago
stasomatic 3 days ago
micromacrofoot 4 days ago
CharlesW 4 days ago
culi 4 days ago
cubefox 4 days ago
tosti 4 days ago
cubefox 4 days ago
boltzmann64 4 days ago
afavour 4 days ago
techpression 4 days ago
paczki 4 days ago
Nesting and @layers make maintaining CSS drastically easier than it once was as well.
zelphirkalt 4 days ago
ximm 4 days ago
nine_k 4 days ago
I sometimes wish that CSS were reduced to the "good parts" and made simpler through it, but I realize that it's infeasible.
jamesfinlayson 4 days ago
tvbusy 4 days ago
spragl 4 days ago
It has this maddening amount of features though, and as it needs to be backwards compatible, this amount can only grow going forward. But if you look at a well chosen subset of the whole thing, it actually is a quite nice language.
thisislife2 4 days ago
bradley13 4 days ago
crocone 4 days ago
thisislife2 4 days ago
afavour 4 days ago
Izkata 4 days ago
Also the blog really doesn't help by describing it like this:
> If you’re familiar with JavaScript, this should feel pretty familiar. We define new functions with @function and specify the returned value with result.
kdkwmdowmxks 4 days ago
longor1996 4 days ago
afavour 4 days ago
roblh 4 days ago
- “I made doom run with only css functions!”
- “CSS function vulnerability exposes api keys in NextJs server side rendering”
- “css function used for fingerprinting violates EU laws”
- “Facebook/Meta caught tracking users using CSS function exploit”
I’m being facetious, mostly.
kdkwmdowmxks 4 days ago
Style and keep an eye out for the cascade.
Simplicity itself.
hexasquid 3 days ago
These arrive
"no! NO!"
alberth 4 days ago
Especially functions.
Makes me think of a previous post from the author, who wrote 100k lines-of-code to power their blog.
gred 4 days ago
OuterVale 4 days ago
beej71 4 days ago
paczki 4 days ago
beej71 4 days ago
mattkenefick 4 days ago
slow_typist 4 days ago
And you cannot emulate functions by using a preprocessor in all use cases.
But what bothers me is the governance model of CSS, the increasing complexity that leads ultimately to more framework usage, not to thoughtful engineering of accessible front ends.
Very soon CSS will be Turing complete and we can have a JavaScript-free C64 emulator. Yay.
We need basically control structures and full access to user input to achieve that.
And we can only hope the vendors get the sandboxing right this time, otherwise we will get a entire new class of CSS based browser exploits.
troupo 4 days ago
bgarbiak 4 days ago
The example with linear-gradient is probably the best use case for them.
nilsherzig 4 days ago
Also, even before reading the comments, I was pleasantly surprised that everything on that page worked and nothing bothered me. There is a good amount of attention to detail (switching of the rounding on codeblocks when switching to light mode for example, avoiding a weird corner on mobile). Nothing moves around on load etc. I know this is a low bar, but it's gotten pretty rare, even for pages linked on here.
I'm trying to say that his 100k lines might actually be spent on attention to detail and aren't just slop.
watersb 4 days ago
https://youtu.be/0j-Wakm5B84?is=7dU_EvFyk_nQNwjO
It's like a peek into a CSS future from a different timeline. Something we could have had.
4b11b4 4 days ago
On that note I may know just enough to be dangerous thanks to Josh (casting spells: e.g. shouldn't we group those in their own container and then within that container shouldn't that be a flex box?). I guess I'm here to say humans are full of contradictions.
unsupp0rted 4 days ago
It used to be that HTML was for content, CSS was for layout, and JS was for "code"
Now JS is for content and layout and code, HTML is for content and layout, and CSS if for layout and code
kaelwd 4 days ago
unsupp0rted 4 days ago
matsemann 4 days ago
unsupp0rted 4 days ago
NekkoDroid 4 days ago
vazark 4 days ago
bazoom42 4 days ago
“Code” is not a concern like semantic vs style.
seanwilson 4 days ago
The new CSS anchor positioning and popover attribute help but something simple and built-in that doesn't require lots of wiring would be great. It's puzzling why we don't have this basic UI feature yet?
troupo 4 days ago
nozzlegear 4 days ago
What's the problem with popovers and anchor positioning? They're practically made for tooltips, I use them in production for this purpose right now.
hexasquid 3 days ago
Probably the place to start
herpdyderp 4 days ago
paulhebert 4 days ago
troupo 4 days ago
It feels like Interop was created to curb Chrome's bulldozing various processes with their own internal APIs and development, and to show that there's more to the web than yet another shitty Javascript API. So a lot of Interop is decidedly everything else. See e.g. Interop 2022: https://hacks.mozilla.org/2022/03/interop-2022/
Of course Chrome bulldozed this effort as well
[1] https://open-ui.org/ Started by Microsoft, of all people. Now almost completely taken over by Chrome of course.
koolala 4 days ago
christophilus 4 days ago
markasoftware 4 days ago
Many of my coworkers and friends are rejoicing that they don't have to write frontends anymore. I actually think that frontends are the last thing that should be vibecoded. It's the part that faces the user. It's what helps the user form their first impression of your product. If your landing page looks like it was made in 30 seconds by Claude, they'll assume the rest of your product was too. Use AI assistance on the parts of your codebase where only raw functionality matters (eg, the backend), and put real human effort and care into the frontend that reflects the effort put into the rest of the system.
mmo93 4 days ago
6510 4 days ago
mobelkh 4 days ago
a backend developer would tell you the backend is much more important to focus on, performance, security, data integrity etc. not losing or exposing customer data is a lot more important than what it looks like.
truth is, it's all still important, preferably no one is vibe coding any part of a serious product.
markasoftware 4 days ago
davedx 4 days ago
Definitely use coding agents to write code, but carefully and thoughtfully review any important backend or heavily user-facing components of the software you're developing.
sourcecodeplz 4 days ago
doesnt mean you tell it: make it look nice.
i find it is great if you want to apply your creativity and ideas.
how to add borders, gradients, animations, positioning, etc.
its a great time for everyone to build things, just how they want/imagine them.
frou_dh 4 days ago
Same for the README on a GitHub project. Alas, plenty of those are now just voluminous AI spew.
melin2024 4 days ago
jpnc 4 days ago
dwayne_dibley 4 days ago
This is very true, I 'walked' away from a material coating website just yesterday because it looked too Claude.
PennRobotics 4 days ago
Look: Three of these 10 "improvements" deal with corner shaping, and two more will inevitably need extending, as I imagine frontend devs get around to, "GPT make reading-flow responsively round only the outside corners," and, "Claude how to squircle the individual grid cell borders when using rule gap decorations."
I understand CSS wants to do all of the things and do them well, but then the eye candy gets overused on every webpage and web framework template to the point that practically no site feels different; it's all "logo, four links, giant-ass 'call to action' rounded button in the bold colored top nav, rounded corner cards in a grid layout 3 to 4 cells wide (or in a slider), gratuitous whitespace, rounded corner everything actually, maybe a gradient text or background or both, hamburger menu on mobile, all styles inlined in the HTML classes".
Going down the list of Fortune companies, three of the top 50 don't "round corner" everything: Berkshire, Exxon, Morgan Stanley. A few more would count if you permit rounded buttons only. Marathon is a weird outlier; they have hexagonally rounded elements buttons. (Also, some of these sites must be hosted on a Zune. It takes 50 full seconds to load Cencora's main page.)
I can't say that I do web dev any better, although I am disappointed by the looks of the modern internet, and I don't think more artistic flair will make it better, just as I don't think houses and cars and suits benefit from strange shapes and colors.
although maybe more choice will free us from the confines of everything looking like Tailwind? (Despite my complaints, I am grateful for progress and also am absolutely not looking forward to people misusing functions and dropping 18 errors and 11 warnings into console.log AHEM LENOVO because they can't be troubled to write good code/markup.)
72deluxe 4 days ago
lioeters 4 days ago
/* Define a function: */
@function --gradient-to-transparent(--color, --direction: bottom) {
result: linear-gradient(
to var(--direction),
var(--color),
transparent;
);
}
Why not provide better integration with JavaScript, to make this kind of acrobatics unnecessary.afavour 4 days ago
lioeters 4 days ago
To me it feels like "programming in YAML", the way a declarative language/format acquires more and more features until you're writing functions in an awkward syntax that was never designed for it.
afavour 4 days ago
At an initial look I agree with you that the functions look very awkward. But I thought the same about CSS variables until I started using them and now I think they’re great so I’ll keep an open mind. I almost wonder if they would have been better off calling them “templates”, or something. “Functions” is going to make people think it’s just like JS.
lioeters 4 days ago
Perhaps I should also be sympathetic to the spec authors, since they're working under tight constraints of language design. Things might look a lot more elegant if HTML/CSS/JS were designed from scratch as a coherent whole.
afavour 4 days ago
https://developer.mozilla.org/en-US/docs/Web/API/CSS_Paintin...
It’s Chrome only though.
lioeters 4 days ago
I've always wished more of the underlying CSS functionality were exposed to the scripting side, like calculating flex/grid layouts, without necessarily tying it to performance-critical painting path. Usually more expressive power means more responsibility, but there are already web APIs that do it in a controlled way, like request animation frame. So I can appreciate the potential of the Painting API and others in a similar direction.
At the same time, I also wish there was effort in the complete opposite way, to start over "from scratch" and make it easier (or possible at all) for people to build alternative browsers with a minimal subset of CSS. Perhaps something like a modularization of web technology, where the current hugely complex system is broken down into reusable libraries for building small and large browser-like applications. I know something like that exists, like Servo etc., but much smaller and simpler building blocks.
agstudio 4 days ago
The worse part of working with CSS is that there is no standard static type checking tool (stylelint comes close though). A lot of programming errors should/could be caught at build time.
Sometimes wondering if a completely alternative syntax+tooling is possible that would leverage all the existing capabilities, while using a different language paradigm.
chuckadams 4 days ago
lioeters 4 days ago
(element doc
(make paragraph
font-size: 20pt
line-spacing: 20pt
font-weight: 'bold
color: color-purple
(process-children)))
In an alternate universe timeline, we could have had a single web language for hypertext, styles, and scripting.lenkite 4 days ago
chuckadams 4 days ago
That's actually something you don't necessarily want: https://www.w3.org/2001/tag/doc/leastPower.html ... then again, once you hit turing-completeness and people start relying on it, you probably also have to admit that you're already soaking in it and you may as well make it pleasant.
lioeters 4 days ago
I love that he used the word "axioms", especially these days when mathematical logic and mainstream software development seem to be reaching toward each other through type systems, static analysis, verification and so on.
That design document about "least power" is fascinating, it's a classic tension in programming language theory about expressivity and the value of constraints.
Reading about how HTML and CSS were intentionally designed to not become a programming language, it's funny to compare with modern web dev practices like React and CSS-in-JS, which re-envision what the separation of concerns means, very different from what the language designers had in mind.
dlcarrier 4 days ago
tosti 4 days ago
afavour 4 days ago
gf000 4 days ago
zelphirkalt 4 days ago
geocar 4 days ago
Google said they weren't smart enough to implement it, or pay anyone to fix the one they forked a decade ago.
afiori 4 days ago
4b11b4 4 days ago
masfuerte 4 days ago
Thank you "sideshowbarker", whoever you are.
boxed 4 days ago
Just call it like it was: Chrome. It was Chrome that didn't move. We can all see the graph :P
thibran 4 days ago
Especially CSS is such a miss fitting technology for what it is used today, that web frameworks actively fight it, by trying to keep its scope to components.
When looked at web tech from a distance, it is cristal clear to me that we need something new.
Instead of all the abysmal complicated rules of CSS, we would probably be much better served by something like ElmUI (a modern advanced version of the idea) + some scripting for dynamic things.
zelphirkalt 4 days ago
CSS has warts, true, but you are not forced to use them. Modern CSS can be brief and clean.
thibran 4 days ago
Modern web is a mess. I wish it wasn't, but it is.
micromacrofoot 4 days ago
kwar13 4 days ago
manlymuppet 4 days ago
If you want them now, you have to do sort of verbose and clunky calculations to get outer corner radius.
[Outer Radius = Inner Radius + Padding](https://www.reddit.com/r/Design/s/oal9fZclJS)
This seems like something standard enough to be a built-in feature.
lopsotronic 4 days ago
Anchor Positioning would be sweet and doesn't feel like it's got so much baggage.
hdjrudni 4 days ago
All browsers at least have partial support. I've been using it.
shevy-java 4 days ago
a) they keep on making CSS more and more complex. You can reason in favour of it, of course, but it is undeniable that CSS becomes more and more complex - and complicated, too. Which leads us to b)
b) "CSS Subgrid is a good example. Subgrid is a super-powerful extension to CSS Grid which enables entirely new layouts."
Well ... I wanted two flexible divs side by side. It is possible, but there are like 5 different main strategies for this, grid is one of them.
Now via a "subgrid", they acknowledge that the existing ways SUCK. So they add yet-another-component here. This reminds us of:
I started to go back to oldschool - HTML tables.
People can hate it, but they work really almost flawlessly. I am not saying I use them for everything, but I totally changed my mind after I saw how flexbox and other things SUCK to no ends. So I now compare all of them to HTML tables. If they suck more than HTML tables, I discard them. This is my quality metric now. And a lot of this has to do with developers making these decisions, failing hard at DESIGN. What happened to simplicity? HTML tables are simple for the most part; they are kind of like a grid already.
OnlineTux 4 days ago
OuterVale 4 days ago
DarkUranium 3 days ago
Plus making a webapp with accessibility in mind, and I'd like to be aware of footguns.
OuterVale 3 days ago
Linear layout issues come to mind first: https://www.w3.org/WAI/WCAG22/Techniques/failures/F49
Then there are issues with screen readers and how they interact with tables. Tables convey that they are tables, so screen readers treat them as such. Sometimes this means reading headings in between cells to help orient the user, and sometimes it means they'll add numbers for orientation. A bit of detail here: https://dequeuniversity.com/rules/axe/4.1/layout-table
If there are any mistakes in the markup, then it can completely throw off the layout in the accessibility tree without having any visual indication that something is wrong. Perhaps most importantly, tables are very rigid and inflexible, so if trying to do anything more dynamic or out of the boxy flow it usually means messy hacks.
If you're really careful you can sometimes get away with it, provided your site is extremely rigid in layout, but it generally ends in an inaccessible mess that is inaccessible in ways that people don't even bother to document nowadays. Just use flex and/or grid if you're targeting modern browsers. Much easier to author and much better for users.
zelphirkalt 4 days ago
dsego 4 days ago
DarkUranium 3 days ago
Think Apple's AutoLayout and similar, but in CSS. I don't recall why it went nowhere (though I do remember the reasons were more political than technical), but imagine CSS without all of the float/flexbox/grid/subgrid/etc crap, but just: `#table-a[width] == #table-b[width];` and so on. And no need for hacks involving deep `<div>` trees just to get the HTML to cooperate with CSS --- it breaks the whole "HTML is for content, CSS is for styling" premise anyway, when HTML needs to adapt structurally to CSS.
The proposal even had `@import` and `@media` (the latter named `@precondition`) all the way in 1999!
There were some attempts at revivals (e.g. [3]), but they kind of went nowhere. Personally, I'm strongly considering using it for my own (non-web-related) UI library. CSS' base syntax is okayish (the way you define classes, reference elements, etc), and the basic rules like colors or text-related things have warts, but are ultimately okay --- but anything to do with layout is an absolute mess.
[1]: https://web.archive.org/web/20140911231410/http://www.cs.was... [2]: https://web.archive.org/web/20140911231410/http://gridstyles... [3]: https://web.archive.org/web/20140907130017/http://gridstyles...
lelanthran 4 days ago
> The Anchor Positioning API allows us to anchor one element to another.
Hello CSS, Welcome to 1996 Delphi :-/
NoDodgeQuestion 4 days ago
2. website work perfectly fine without CSS functions, Bevels and squircles, Infinite possibilities with border-shape, ... only need these for make CSS educational blog
3. future of CSS is DeepSeek
lopis 4 days ago