[CSS] More answers to advantages/disadvantages of using CSS preprocessors (#198)

* Add a disadvantage that they are not really writing CSS anymore; and they may be able to get enough functionality by using something like postcss et al.

* Update css-questions.md
This commit is contained in:
Rob Levin 2019-06-01 16:55:13 -07:00 committed by Yangshun Tay
parent 0134608c34
commit 13be2b2de4
1 changed files with 2 additions and 0 deletions

View File

@ -289,11 +289,13 @@ Be aware of which CSS properties [trigger](https://csstriggers.com/) reflow, rep
* Easy to write nested selectors.
* Variables for consistent theming. Can share theme files across different projects.
* Mixins to generate repeated CSS.
* Sass features like loops, lists, and maps can make configuration easier and less verbose.
* Splitting your code into multiple files. CSS files can be split up too but doing so will require an HTTP request to download each CSS file.
**Disadvantages:**
* Requires tools for preprocessing. Re-compilation time can be slow.
* Not writing currently and potentially usable CSS. For example, by using something like [postcss-loader](https://github.com/postcss/postcss-loader) with [webpack](https://webpack.js.org/), you can write potentially future-compatible CSS, allowing you to use things like CSS variables instead of Sass variables. Thus, you're learning new skills that could pay off if/when they become standardized.
[[↑] Back to top](#css-questions)