-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
255 additions
and
233 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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
@use '../../styles/colors.scss'; | ||
@use '../../styles/lengths.scss'; | ||
|
||
.rcx-divider { | ||
margin-block: lengths.margin(8); | ||
|
||
border: lengths.border-width(1) solid #{ $colors-n300 }; | ||
border: lengths.border-width(1) solid colors.neutral(300); | ||
} |
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
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,80 @@ | ||
@use 'sass:color'; | ||
@use '~@rocket.chat/fuselage-tokens/colors.scss' as token-colors; | ||
|
||
@function _check-grade($grade) { | ||
@if $grade % 100 != 0 or $grade / 100 <= 0 or $grade / 100 > 9 { | ||
@error 'invalid color grade'; | ||
} | ||
|
||
@return $grade; | ||
} | ||
|
||
@function _get-color($prefix, $grade, $alpha) { | ||
@if $grade % 100 != 0 or $grade / 100 <= 0 or $grade / 100 > 9 { | ||
@error 'invalid color grade'; | ||
} | ||
|
||
$base-color: map-get(token-colors.$colors, #{ $prefix }#{ $grade }); | ||
|
||
@if $alpha != null { | ||
@return color.change($base-color, $alpha: $alpha); | ||
} | ||
|
||
@return $base-color; | ||
} | ||
|
||
@function _get-varname($prefix, $grade, $alpha) { | ||
@if $grade % 100 != 0 or $grade / 100 <= 0 or $grade / 100 > 9 { | ||
@error 'invalid color grade'; | ||
} | ||
|
||
@if $alpha != null { | ||
@return --rcx-color-#{ $prefix }-#{ $grade }-#{ $alpha * 100 }; | ||
} | ||
|
||
@return --rcx-color-#{ $prefix }-#{ $grade }; | ||
} | ||
|
||
@function neutral($grade, $alpha: null) { | ||
@return var(_get-varname(neutral, $grade, $alpha), _get-color(n, $grade, $alpha)); | ||
} | ||
|
||
@function primary($grade, $alpha: null) { | ||
@return var(_get-varname(primary, $grade, $alpha), _get-color(b, $grade, $alpha)); | ||
} | ||
|
||
@function link($grade, $alpha: null) { | ||
@return var(_get-varname(link, $grade, $alpha), _get-color(b, $grade, $alpha)); | ||
} | ||
|
||
@function visited-link($grade, $alpha: null) { | ||
@return var(_get-varname(visited-link, $grade, $alpha), _get-color(p, $grade, $alpha)); | ||
} | ||
|
||
@function active-link($grade, $alpha: null) { | ||
@return var(_get-varname(active-link, $grade, $alpha), _get-color(r, $grade, $alpha)); | ||
} | ||
|
||
@function info($grade, $alpha: null) { | ||
@return var(_get-varname(info, $grade, $alpha), _get-color(b, $grade, $alpha)); | ||
} | ||
|
||
@function success($grade, $alpha: null) { | ||
@return var(_get-varname(success, $grade, $alpha), _get-color(g, $grade, $alpha)); | ||
} | ||
|
||
@function warning($grade, $alpha: null) { | ||
@return var(_get-varname(warning, $grade, $alpha), _get-color(y, $grade, $alpha)); | ||
} | ||
|
||
@function danger($grade, $alpha: null) { | ||
@return var(_get-varname(danger, $grade, $alpha), _get-color(r, $grade, $alpha)); | ||
} | ||
|
||
@function paper($alpha: null) { | ||
@if $alpha != null { | ||
@return var(--rcx-color-paper-#{ $alpha * 100 }, rgba(255, 255, 255, $alpha)); | ||
} | ||
|
||
@return var(--rcx-color-paper, 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
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
Oops, something went wrong.