CSS Preprocessor Issues - Can we handle them Wisely?
CSS Preprocessor Issues- Can we handle them wisely
Despite the popularity of CSS pre-processors, it has been
found that a majority of developers who are writing CSS are actually writing in
a specific kind of language that transpiles into CSS. Hence, this has posed as
a visible disadvantage of using a CSS pre-processor. Reading this post will
make you familiar with some of the well-known pros of CSS pre-processor and
we'll also find whether there are techniques of handling the same in a perfect
way.
Sass- A utility with a darker side
Sass serves as an authoring tool, a configuration
manager, framework and a transform and build tool. Although Sass has been quite
successful in offering good support for minification, output formatting,
concatenation and source maps, it comes with a major drawback. An unintelligent
use of Sass can easily result in unwanted CSS. It is important to note that
Sass has a malevolence which tends to manifest each time its yielded without a
deep understanding or proper attention. Hence it is essential to avoid the
overzealous use of Sass' @extend feature. Moreover, immoderate nesting can also
lead to overlong, abstruse and over specific selectors.
A potential increase in the number of steps involved in the development life cycle
Since the use of CSS pre-processors won't expect you to
deploy the .less or .styl files, you'll need to have an additional step in the
development life-cycle wherein the .css stylesheet is being generated. This
extra step can considerably slow down the development pace. Fortunately, we
have an easy access to some stunning tools like CodeKit or Grunt which will
auto-compile the Stylus files to CSS. While such tools come with logical
defaults, it is essential to pay special attention to their effective
configuration. For example, on choosing Grunt, don't forget to check its
'Getting Started' guide so as to gather helpful insights on installation and
use of Grunt plugins.
Too many syntaxes create compatibility issues
It is essential to know that each CSS Preprocessor comes
with a different syntax. Even though some of the preprocessor features might
overlap, they are being implemented differently. Moreover, with different
syntaxes associated with different pre-processors, it becomes quite tedious to
switch from one project to another wherein you're supposed to have a different
styling syntax. For instance, on finding that a Stylus syntax is compatible
with a LESS file, you'll be required to write the styles twice-leading to
increased project time.
File Size of resultant CSS is way too different from what you are expecting
Unlike the case of writing CSS in a low-level styling
language, writing it using a pre-processor will generate a CSS which will not
be as small as you think it to be while you're busy editing the CSS. Well,
there are multiple reasons for this. Some of the most prominent ones are
explained below:
- You may opt for lopping in a CSS pre-processor and generate n items wherein only one is visible. All the remaining items are hence listed in the resultant, static CSS file.
- The final CSS has a flattened hierarchy with a tree of selectors duplicated for each individual selector.
- While using some specific CSS pre-processors, you can do away with writing the vendor prefixes. While this can save you some valuable project time, you might forget that a single attribute would be expanding into 5 or 6 within the final CSS.
Finding a sigh of relief via Post-Processors
Unlike the case of pre-processors which come with
distinct syntaxes, the post-processors feed on the original CSS stylesheet.
These post-processors act like polyfills, allowing you to write the to-spec CSS
which would work for your web development project. There are chances that you
might be using a post-processor adjacent to your pre-processor without actually
being aware about it. The very renowned autoprefixer tool is indeed a
post-processor which allows you to fetch the CSS and add all the vendor
prefixes so as to make the website work in multiple browsers. In contrast to
the functioning of the pre-processors, a majority of post-processors(especially
the ones written using a plugin approach) play a vital role in auto-generating
the inline image data. That means, you are free to choose any of the modular
plugins that are required for transforming your CSS.
That's it for now!
Conclusion
A thoughtful understanding of pros associated with CSS
pre-processors is something that will aid you in creating excellent things for
the internet. Here's hoping my post would have helped you in learning quite a
lot on this topic.
32 comments
Whenever I take a look at your web site in Safari, it lkoks fine
however, if opening in Internwt Explorer, it's got some overlapping issues.
I just wantedd to provide you with a quick heads up!
Apart from that, excellent site!
acquainted with then you can write if not it is difficult to write.
Your humoristic style is witty, keep up the good
work!
discovered any interesting article like yours. It's pretty
value enough for me. In my view, if all wweb owners and bloggyers made just right content material
as you probably did, the net shall be much more heslpful than ever before.
against hackers? I'm kinda paranoid about losing everything I've worked
hard on. Any recommendations?
most up-to-date updates.
like wht you've acquired here, really like what you're stating and
the way in whiich you say it. You make it entertaining
aand you still take care of to keep it sensible.I cant wait to
read far more frrom you. This is actually a tremendous website.
He was entirely right. This post actually made my day.
You cann't imagine simply how much time I haad spen for this information!
Thanks!
me as much as this one. After all, I know it was my choice
to read, nonetheless I really believed you would have
something useful to talk about. All I hear iis a bunch
of complaining about something you could possibly fix if you weren't too busy seeking attention.
this site is really informative! Keep putting up.
prooviding this info.
and I waas wanting to know your situation; wee have created some nice practices and we are looking to trade solutions with other
folks, why not shoot me an e-mail if interested.
any other web site which presents these kinds of stuff in quality?
feed additionally? I am satisfied to search out numerous useful information here
in the publish, we need wotk out more techniques in this regard, thank you for sharing.
. . . . .
It was inspiring. Keep on posting!
I don't know who you are but certainly you are going to a famous blogger if you are not already ;) Cheers!
I realized it's new tto me. Anyhow, I'm definitely delighted
I stumbled upon it and I'll be bookmarking it and checking back
frequently!
Stick with it!
I am satisfied to search out numerous useful info here in the submit, we need develop more techniques in this regard,
thank you for sharing. . . . . .
I'll bookmark your blog and check agaiin here frequently.
I'm rather certain I will be told many neww stuff right right here!
Good luck for the next!
Reading through this post reminds me off my previous ropm mate!
He always kept chatting about this. I will forward this write-up to him.
Preyty ure he will have a good read. Thank you for sharing!
Shame on the search enggines for now not positioning this
submit upper! Come on over and visit my site . Thanks =)
genuinely a pleasant post, keep it up.
I'm not sure why but I think its a linking issue. I've tried
it in two diffeent internet browsers and both show the same outcome.
Thanks for your information. I just switched my blog from HTTP to HTTPS, perhaps this is the reason. Everything is working fine in my browsers.