Abstraction away from CSS

前端 未结 18 1747
别跟我提以往
别跟我提以往 2021-02-13 10:34

Many frameworks seek to abstract away from HTML (custom tags, JSFs component system) in an effort to make dealing with that particular kettle of fish easier.

Is there an

18条回答
  •  爱一瞬间的悲伤
    2021-02-13 11:28

    You don’t need an abstraction away from CSS—you need to realize that CSS itself in an abstraction. CSS isn’t about putting pixels just so on the screen. Instead, it’s about writing a system of rules that help the browser make those decisions for you. This is necessary, because at the time you write CSS, you don’t know the content the browser will be applying it to; neither do you know the environment where the browser will be doing it.

    Mastering this takes time. You can’t pick up up CSS in a weekend and be good to go. It’s a bit deceiving, because the language has such a low barrier of entry, but the waters run deep. Here is just a few of the topics you should seek to master to be proficient in CSS:

    • The Cascade and Inheritance
    • The Box Model
    • Layout methods including floats and the new flexbox
    • Positioning
    • Current best practices such as SMACSS or BEM to keep your styles modular and easy to maintain

    You don't need to know this all up front, but you should continue pushing forward. Just as with other languages and programming in general, you need to continually seek to learn more and master the craft. CSS is a fundamental part of web development, and more developers need to treat it with the same respect they afford other languages.

提交回复
热议问题