Both Sass and Stylus (technically NodeAssets) has a package for AspNet. We have a way to generate css from something (that is less in our case) but now what?. If only for the sake of having variables – it’s worth it. On the other hand, I could be using plain old css so… let’s go for less (no pun intended). I think we have a winner, although I must say, that I feel kind of sad to use the least capable preprocessor just because it’s easy to use it. The nice thing about it is that it utilizes the current css syntax so it’s easy to learn but the mixins could use an improvement (it’s not possible to use a node as a mixin – so section Features that are highlighted on the project page are variables, mixins, nested rules and functions & operations. So let’s take a look at the options we have. That may be because it is now easy to use custom parsers/compilers for css and javascript. They’ve been around for a while now, and are getting more attention. Things like mixins (reusable chunks of css), improved imports (so, a declaration that will actually import a while file inline instead of sending another request to fetch the imported file), functions, calculations and who knows what else.Ĭome forth CSS preprocessors. Well, for one, we can wait for things like variables being included in css itself – the working draft for css3 does have variables in them, but (at the time of writing this article) none of the browsers support it (webkit has it in nightly builds… I think).īut variables are just one of the things that could ease the front-end developers life. net and want to use a css preprocessor use less along with dotless lib. This will be lengthy, so if you don’t have time, here’s the punch line: Now that’s not that bad when you have a small site and one css file, but when the number of files grows, that problem grows along. Take colors for example, when you want to style a site you need to repeat the color declaration everywhere you want to set it, so when you change your mind, the only way to implement the changes is search and replace. By eidias on (tags: css, less, sass, stylus, categories: code, web)ĬSS has been around for a while and will stay for a while longer and although I think it’s a good and working ‘language’ it has a few pitfalls – the biggest one being the lack of ability to reuse certain parts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |