CSS Preprocessor là gì?
CSS Preprocessor là gì?
CSS preprocessor là công cụ cho phép viết CSS bằng cú pháp mở rộng (biến, lồng, mixin, hàm, vòng lặp, import/ module) rồi biên dịch thành CSS thuần.
Sass/ SCSS (phổ biến nhất), Less, Stylus; PostCSS (hệ plugin, "post-processor").
// SCSS
@use "sass:math";
$brand: #0a66c2;
@mixin respond($bp) { @media (min-width: $bp) { @content; } }
.card {
color: $brand;
&:hover { color: darken($brand, 10%); }
.title { font-size: math.div(24px, 16px) * 1rem; }
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.