- Mastering Sass
- Luke Watts
- 237字
- 2021-07-14 10:28:19
Chapter 2. Sass – The Road to Better CSS
In this chapter, we will cover:
- Setting up a simple project based strongly on typography.
- We'll look at using Sass from the command line and the various options we can pass to take control of our output.
- We'll then set up our project's configuration variables using
!default
to allow easy overriding in future. These variables will control all of our functions and mixins and will allow the end user to have full control of our Sass library, without needing to touch mixins or functions. - We'll look at writing a small but flexible library of functions and mixins that will deal with setting up a base typography style for our default body, text, and headings. This will be based around the optimal reading line length of 60-80 characters while keeping our font sizes and line heights uniform even when we change font families.
- We'll write functions and a mixin to handle the output of our headings and keep the best font sizes and line heights for each heading for sans and serif.
- We'll then look at using lists and nested lists to reduce repetition in our mixins. We'll look at tackling one problem with two different loops and the pros and cons of both approaches.
- Finally, we'll go back over all of our functions and add some much needed error handling by using
@error
and@warn
.
推薦閱讀
- 阿里云數(shù)字新基建系列:云原生操作系統(tǒng)Kubernetes
- Instant Handlebars.js
- Application Development in iOS 7
- 操作系統(tǒng)分析
- Linux系統(tǒng)最佳實踐工具:命令行技術
- Building Telephony Systems With Asterisk
- 鴻蒙操作系統(tǒng)設計原理與架構(gòu)
- Mastering Windows 8 C++ App Development
- Linux 從入門到項目實踐(超值版)
- 應急指揮信息系統(tǒng)設計
- Raspberry Pi入門指南
- Linux操作系統(tǒng)案例教程(第2版)
- 鴻蒙HarmonyOS應用開發(fā)入門
- Java EE 8 High Performance
- OpenSolaris紅寶書