refactor(treewide): cleanup and use rgbify mixin (#1511)
This commit is contained in:
1 parent
a53832420b
commit
7acf913ebc
27 files changed
+76
-72
No files matched your search
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
- [Images and SVGs](./guide/images-and-svgs.md)
|
||||
- [Syntax highlighting](./guide/syntax-highlighting.md)
|
||||
- [Extracting RGB values](./guide/rgb-values.md)
|
||||
- [Obtaining raw color values](./guide/raw-color-values.md)
|
||||
|
||||
- [Tutorials](./tutorials/README.md)
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
- [Images and SVGs](./images-and-svgs.md)
|
||||
- [Syntax highlighting](./syntax-highlighting.md)
|
||||
- [Extracting RGB values](./rgb-values.md)
|
||||
- [Obtaining raw color values](./raw-color-values.md)
|
||||
@@ -0,0 +1,29 @@
|
||||
## Obtaining RGB values
|
||||
|
||||
You can use the following snippet to get the raw RGB values from a color.
|
||||
|
||||
```less
|
||||
#rgbify(@color) {
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
```
|
||||
|
||||
```less
|
||||
--ctp-base: #rgbify(@base) []; // -> 30, 30, 46
|
||||
```
|
||||
|
||||
## Obtaining HSL values
|
||||
|
||||
You can use the following snippet to get the raw HSL values from a color.
|
||||
|
||||
```less
|
||||
#hslify(@color) {
|
||||
@raw: e(
|
||||
%("%s, %s%, %s%", hue(@color), saturation(@color), lightness(@color))
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
```less
|
||||
--ctp-base: #hslify(@base) []; // -> 240, 21.052631578947366%, 14.901960784313726%
|
||||
```
|
||||
@@ -1,9 +0,0 @@
|
||||
You can use the following snippet to get the raw RGB values from a color.
|
||||
|
||||
```less
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
--ctp-base: #rgbify(@base) []; // -> 30, 30, 46
|
||||
```
|
||||
@@ -235,7 +235,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -746,7 +746,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -1228,7 +1228,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
--c-border: @surface0 !important;
|
||||
--c-border-dark: @surface1 !important;
|
||||
--c-bg-base: @base !important;
|
||||
--rgb-bg-base: red(@mantle), green(@mantle), blue(@mantle) !important;
|
||||
--rgb-bg-base: #rgbify(@mantle) [] !important;
|
||||
--c-bg-active: @surface0 !important;
|
||||
--c-bg-code: @surface0 !important;
|
||||
--c-bg-selection: @accent-color !important;
|
||||
@@ -96,61 +96,41 @@
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: alpha(@surface1, 0.7);
|
||||
background: fade(@surface1, 70%);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: alpha(@surface1, 0.8);
|
||||
background: fade(@surface1, 80%);
|
||||
}
|
||||
|
||||
[text-red],
|
||||
[text-red-600],
|
||||
[hover^="text-red"]:hover {
|
||||
color: rgbA(red(@red), green(@red), blue(@red), var(--un-text-opacity));
|
||||
color: rgba(#rgbify(@red) [], var(--un-text-opacity));
|
||||
}
|
||||
|
||||
[text-blue],
|
||||
[hover^="text-blue"]:hover {
|
||||
color: rgbA(
|
||||
red(@blue),
|
||||
green(@blue),
|
||||
blue(@blue),
|
||||
var(--un-text-opacity)
|
||||
);
|
||||
color: rgba(#rgbify(@blue) [], var(--un-text-opacity));
|
||||
}
|
||||
|
||||
[text-green],
|
||||
[hover^="text-green"]:hover {
|
||||
color: rgbA(
|
||||
red(@green),
|
||||
green(@green),
|
||||
blue(@green),
|
||||
var(--un-text-opacity)
|
||||
);
|
||||
color: rgba(#rgbify(@green) [], var(--un-text-opacity));
|
||||
}
|
||||
|
||||
[text-yellow],
|
||||
[hover^="text-yellow"]:hover {
|
||||
color: rgbA(
|
||||
red(@yellow),
|
||||
green(@yellow),
|
||||
blue(@yellow),
|
||||
var(--un-text-opacity)
|
||||
);
|
||||
color: rgba(#rgbify(@yellow) [], var(--un-text-opacity));
|
||||
}
|
||||
|
||||
[text-purple],
|
||||
[hover^="text-purple"]:hover {
|
||||
color: rgbA(
|
||||
red(@lavender),
|
||||
green(@lavender),
|
||||
blue(@lavender),
|
||||
var(--un-text-opacity)
|
||||
);
|
||||
color: rgba(#rgbify(@lavender) [], var(--un-text-opacity));
|
||||
}
|
||||
|
||||
[group-hover^="bg-purple/10"]:hover {
|
||||
background-color: alpha(@lavender, 0.1);
|
||||
background-color: fade(@lavender, 10%);
|
||||
}
|
||||
|
||||
.filter-saturate-0,
|
||||
@@ -160,6 +140,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
@catppuccin: {
|
||||
@latte: { @rosewater: #dc8a78; @flamingo: #dd7878; @pink: #ea76cb; @mauve: #8839ef; @red: #d20f39; @maroon: #e64553; @peach: #fe640b; @yellow: #df8e1d; @green: #40a02b; @teal: #179299; @sky: #04a5e5; @sapphire: #209fb5; @blue: #1e66f5; @lavender: #7287fd; @text: #4c4f69; @subtext1: #5c5f77; @subtext0: #6c6f85; @overlay2: #7c7f93; @overlay1: #8c8fa1; @overlay0: #9ca0b0; @surface2: #acb0be; @surface1: #bcc0cc; @surface0: #ccd0da; @base: #eff1f5; @mantle: #e6e9ef; @crust: #dce0e8; };
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
#catppuccin(@lookup, @accent) {
|
||||
@rosewater: @catppuccin[@@lookup][@rosewater];
|
||||
@flamingo: @catppuccin[@@lookup][@flamingo];
|
||||
@@ -678,6 +674,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
@catppuccin: {
|
||||
@latte: { @rosewater: #dc8a78; @flamingo: #dd7878; @pink: #ea76cb; @mauve: #8839ef; @red: #d20f39; @maroon: #e64553; @peach: #fe640b; @yellow: #df8e1d; @green: #40a02b; @teal: #179299; @sky: #04a5e5; @sapphire: #209fb5; @blue: #1e66f5; @lavender: #7287fd; @text: #4c4f69; @subtext1: #5c5f77; @subtext0: #6c6f85; @overlay2: #7c7f93; @overlay1: #8c8fa1; @overlay0: #9ca0b0; @surface2: #acb0be; @surface1: #bcc0cc; @surface0: #ccd0da; @base: #eff1f5; @mantle: #e6e9ef; @crust: #dce0e8; };
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -956,11 +956,7 @@
|
||||
background-color: @surface0;
|
||||
}
|
||||
.language_list_languages.tw-ll-top::after {
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(red(@base), green(@base), blue(@base), 0),
|
||||
rgba(red(@base), green(@base), blue(@base), 1)
|
||||
);
|
||||
background: linear-gradient(to bottom, transparent, @base);
|
||||
}
|
||||
.HsZQAe {
|
||||
border-bottom-color: @surface2;
|
||||
@@ -2423,6 +2419,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
@catppuccin: {
|
||||
@latte: { @rosewater: #dc8a78; @flamingo: #dd7878; @pink: #ea76cb; @mauve: #8839ef; @red: #d20f39; @maroon: #e64553; @peach: #fe640b; @yellow: #df8e1d; @green: #40a02b; @teal: #179299; @sky: #04a5e5; @sapphire: #209fb5; @blue: #1e66f5; @lavender: #7287fd; @text: #4c4f69; @subtext1: #5c5f77; @subtext0: #6c6f85; @overlay2: #7c7f93; @overlay1: #8c8fa1; @overlay0: #9ca0b0; @surface2: #acb0be; @surface1: #bcc0cc; @surface0: #ccd0da; @base: #eff1f5; @mantle: #e6e9ef; @crust: #dce0e8; };
|
||||
|
||||
@@ -852,7 +852,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -1730,7 +1730,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color) green(@color) blue(@color);
|
||||
@rgb: red(@color) green(@color) blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -95,10 +95,6 @@
|
||||
--bs-btn-active-color: @hover;
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
--bs-body-color: @text;
|
||||
--bs-body-color-rgb: #rgbify(@text) [];
|
||||
--bs-body-bg: @base;
|
||||
@@ -567,6 +563,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
@catppuccin: {
|
||||
@latte: { @rosewater: #dc8a78; @flamingo: #dd7878; @pink: #ea76cb; @mauve: #8839ef; @red: #d20f39; @maroon: #e64553; @peach: #fe640b; @yellow: #df8e1d; @green: #40a02b; @teal: #179299; @sky: #04a5e5; @sapphire: #209fb5; @blue: #1e66f5; @lavender: #7287fd; @text: #4c4f69; @subtext1: #5c5f77; @subtext0: #6c6f85; @overlay2: #7c7f93; @overlay1: #8c8fa1; @overlay0: #9ca0b0; @surface2: #acb0be; @surface1: #bcc0cc; @surface0: #ccd0da; @base: #eff1f5; @mantle: #e6e9ef; @crust: #dce0e8; };
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color) green(@color) blue(@color);
|
||||
@rgb: red(@color) green(@color) blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -435,7 +435,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color) green(@color) blue(@color);
|
||||
@rgb: red(@color) green(@color) blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -485,7 +485,7 @@ domain('superuser.com'), domain('mathoverflow.net'), domain('askubuntu.com'), do
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -1321,7 +1321,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color), green(@color), blue(@color);
|
||||
@rgb: red(@color), green(@color), blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
@@ -673,7 +673,7 @@
|
||||
}
|
||||
|
||||
#rgbify(@color) {
|
||||
@rgb-raw: red(@color) green(@color) blue(@color);
|
||||
@rgb: red(@color) green(@color) blue(@color);
|
||||
}
|
||||
|
||||
/* prettier-ignore */
|
||||
|
||||
Reference in new issue
Block a user