I am super pumped with this presentation about modern abilities of CSS.
Here are few upgrades that are coming in:
@import will finally be relevant when HTTP2 comes into playAren't these the things we use preprocessors for?
Do you think the modern CSS would eliminate the need of having CSS preprocessors?
You don't need preprocessors now, you can ship raw CSS. People like using preprocessors for a range of reasons, including nicer syntax. Many people will just keep going with the syntax and tools they know, since they won't get a substantially different end result by refactoring them out.
No.
It's kind of the same as it is with JS and its compilers. You will always want that new / shiny or even unofficial feature as soon as possible. Also: PostCSS can do far more than regular preprocessors: Stylelint, Stylefmt, CSS Statistics, basically anything you can think of using Node is possible with PostCSS.
I think CSS will go the same route of JavaScript. More developers are now writing code in ES2015/ES6 but compelling features will continue to come in which we will keep having to compile back down for browsers with Babel or similar tools. While I still use Sass/Less in some projects for legacy reasons, I tend to use cssnext (compiled with PostCSS) on new projects because it supports the upcoming standard features of CSS. For the ones that don't exist, I just add in as a PostCSS plugin or re-think whether I really should be adding another layer of complexity.
However, while cssnext/PostCSS is gaining popularity, I think that the majority of developers have just gotten comfortable with Sass and will continue to use it for a long time. Keep in mind that Bootstrap 4 is using Sass so a lot of people will use it just for that reason, although Mark Otto has expressed his interest in using PostCSS for v5.
when regular css can do a lot of what preprocessors can do, that's the day they will become irrelevant. But what is actually kind of a good thing and I think a lot of people use is the @import separation of files by sections, pages or modules and that's a pretty big thing. It's a lot easier to try and find a style for your header in a single file named header than to find a style in a 4,000 lines length file that contains everything.
I know it requires additional time to configure preprocessors but that's just once in the computer and then all you have to do is setup a file or open your console and install the package or just run the listener to compile. The errors can be managed with npackages that finds the errors and indicates you where it is and not seeing something like line 5,000 error.
Also a big advantage that preprocessors have are mixins, you can actually forget about them and on compilation adding them automatically, that's pretty cool and I really hate when I can't do that. Also you can configure it to minimize at compilation and that's something really cool.
When regular CSS can do all of that without adding extra loading files on production with @import preprocessors will die but I think perhaps in another 10 years we will be near that point but preprocessors will make updates and be on the lead again.
For the most part I actually skipped sass and went straight to SCSS/sass3. As I really didn't like less/sass2 etc.
It would be nice to see this develop and how it impacts the community. But overall pre-processors aren't going away any time soon and for me I'd need to see it become backwards compatibility (somehow). It's the biggest sticking point for me. Otherwise, as mentioned at the end of the presentation people will end up using both. So it's not so much pre-processors will die, but more that the way we use them will change.
I think when is massive adapt maybe we don't need sass, less or something more. But when don't are so extended and not everybody know about this i don't think preproessors gonna die.
Tommy Hodgins
CSS & Element Queries
I don't know that we need preprocessors even today. There's a case to be made for their use and there still we be in the future - but it's pretty easy to author and ship vanilla CSS without requiring any extra tools! I prefer to write vanilla CSS because it's the most reusable from codebase to codebase if you're building in a modular way ☺️ Not every project uses the same tools or preprocessors, but I have yet to find a project where vanilla CSS doesn't work exactly as intended.