- 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
.
推薦閱讀
- 嵌入式Linux開發技術
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- Arch Linux Environment Setup How-to
- 白話區塊鏈
- 高性能Linux服務器構建實戰:運維監控、性能調優與集群應用
- SharePoint 2013 WCM Advanced Cookbook
- 嵌入式操作系統(Linux篇)(微課版)
- 嵌入式系統及其應用(第三版)
- Linux內核觀測技術BPF
- 突破平面3ds Max動畫設計與制作
- 精解Windows 10
- Android NDK Beginner's Guide
- Docker容器技術與運維
- STM32庫開發實戰指南
- Windows10開發入門經典