Home > Article > Web Front-end > How can I use variables declared in a central SCSS file across multiple SASS files?
Using Variables Across Multiple SASS Files
Problem:
You aim to maintain a centralized .scss file for managing all variable definitions within a project. The project involves numerous CSS files where the goal is to declare project-wide style variables in a single location. Is there a method to achieve this in SCSS?
Solution:
To accomplish this, follow these steps:
$black: #000; $white: #fff;
// Utilities @import "utilities/variables"; // Base Rules @import "base/normalize"; @import "base/global";
This approach allows you to manage project-wide variables centrally while still maintaining the modularity of your SCSS codebase.
The above is the detailed content of How can I use variables declared in a central SCSS file across multiple SASS files?. For more information, please follow other related articles on the PHP Chinese website!