forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use themes to configure values eg. colors * use variables for css properties to allow easilly update them or change themes
- Loading branch information
1 parent
68cf0a9
commit b03217a
Showing
10 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@use '_variables/colors' as c-var; | ||
@use '_values/colors' as c-val; | ||
|
||
$values: ( | ||
c-var.$background: linear-gradient(180deg, #041429 0%, #041630 19.83%), | ||
c-var.$background-color: #041429, | ||
c-var.$text-on-background: c-val.$white, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@use 'sass:map'; | ||
@use './light'; | ||
@use './dark'; | ||
|
||
@mixin apply-theme($name, $values, $default-values) { | ||
@each $variable, $default-value in $default-values { | ||
$final-value: $default-value; | ||
@if map.has-key($values, $variable) { | ||
$final-value: map.get($values, $variable); | ||
} | ||
|
||
#{$variable}: $final-value; | ||
} | ||
} | ||
|
||
:root,/* default theme */ | ||
:root.light { | ||
@include apply-theme('light', light.$values, light.$values); | ||
} | ||
|
||
:root.dark { | ||
@include apply-theme('dark', dark.$values, light.$values); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@use '_variables/colors' as c-var; | ||
@use '_values/colors' as c-val; | ||
|
||
$values: ( | ||
c-var.$background: c-val.$gray-40, | ||
c-var.$background-color: c-val.$gray-40, | ||
c-var.$text-on-background: c-val.$gray-95, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$white: #fff; | ||
$gray-40: #f7f8f8; | ||
$gray-60: #c3c5c8; | ||
$gray-65: #9c9fa4; | ||
$gray-70: #898d93; | ||
$gray-75: #767a81; | ||
$gray-95: #2a3645; | ||
$gray-100: #182435; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@forward './colors' as colors-*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$background: '--colors-background'; | ||
$background-color: '--colors-background-color'; | ||
$text-on-background: '--colors-text-on-background'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@forward './colors' as colors-*; | ||
|
||
@function use($variable) { | ||
@return var(#{$variable}); | ||
} |