Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sgregson/69a337eb1a4d4582331db89ee915b1dc to your computer and use it in GitHub Desktop.
Save sgregson/69a337eb1a4d4582331db89ee915b1dc to your computer and use it in GitHub Desktop.
Shared Variable File in Sass
$Feature-color: blue;
$Feature-radius: 5px;
$Feature-height: 5rem;
@import 'feature_variables';
@mixin FeatureComponentA() {
.FeatureComponentA {
color: $Feature-color;
border-radius: $Feature-radius;
}
}
@import 'feature_variables';
@mixin FeatureComponentB() {
.FeatureComponentB {
color: $Feature-color;
height: $Feature-height; // this is specific so might not be in the shared variables
}
}
@import 'partialA';
@include FeatureComponentA();
@import 'partialB';
@include FeatureComponentB();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment