Skip to content

Commit

Permalink
feat: allow the use of :host in variable definitions (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiiomiiguel committed Jul 13, 2024
1 parent 3d891c5 commit e76de34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/assets/scss/utils/_root.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
@use "sass:list";

@mixin root() {
$host-selector: if($enable-host, ":host", ":root");

#{$host-selector} {
@content;
}
}

/*******************************
* Root variables extensions
********************************/

:root {
@include root() {
// define color variables
@each $name, $color in $colors {
@if type-of($color) == list {
Expand Down
1 change: 1 addition & 0 deletions src/assets/scss/utils/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// Settings
$prefix: "oruga-" !default;
$enable-host: false !default;

// Animations
$animation-speed: 150ms !default;
Expand Down

0 comments on commit e76de34

Please sign in to comment.