- Sass and Compass Designer's Cookbook
- Bass Jobsen
- 215字
- 2021-07-16 10:56:47
Introduction
When coding Sass, you should realize that SCSS code compiles into valid CSS code. Sass does not guarantee that the CSS is modular, readable, or well-organized, and so easy to maintain. In this chapter, you will learn how to use nesting in your Sass code to reflect the visual hierarchy of your HTML and extend selectors to reduce the size of the compiled CSS code.
Also, the parent reference will be explained. You can use the & parent reference to use the parent selector in your code without having to explicitly use its name. The recipes in this chapter describe many useful use cases of the parent reference.
Sass does not generate bad code, but coders can. When you apply the Sass features described in this chapter, you should always keep the final result in your mind. For instance, nesting your code to follow the visual hierarchy of your HTML will make your code easier to read and maintain. On the other hand, nesting too deeply will produce overspecified CSS and will be considered to be a bad practice.
In the last recipe, you will learn about the Object-Oriented CSS (OOCSS), Scalable and Modular Architecture for CSS (SMACSS), and Block Element Modifier (BEM) methodologies. These methodologies can help you better organize your CSS code.
- 動手玩轉Scratch3.0編程:人工智能科創教育指南
- 高級C/C++編譯技術(典藏版)
- Hands-On Enterprise Automation with Python.
- Learning Laravel's Eloquent
- Scratch趣味編程:陪孩子像搭積木一樣學編程
- 創意UI:Photoshop玩轉APP設計
- Practical Predictive Analytics
- Python編程快速上手2
- Groovy 2 Cookbook
- H5匠人手冊:霸屏H5實戰解密
- Building Microservices with Go
- 計算機軟件項目實訓指導
- 趣味掌控板編程
- Instant OpenCV for iOS
- IPython Notebook Essentials