refactor(nixos-search): ensure that the theme is the same/similar to the template (#126)

This commit is contained in:
Isabel 2023-07-23 15:56:15 +01:00 committed by GitHub
parent 220eec1689
commit 79cea907f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,186 +1,49 @@
/* ==UserStyle==
@name NixOS Search Catppuccin
@namespace github.com/catppuccin/userstyles/nixos-search
@homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/nixos-search
@version 0.2.0
@homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/nixos-search
@version 0.2.1
@description Soothing pastel theme for NixOS Search
@author Catppuccin
@updateURL https://github.com/catppuccin/userstyles/raw/main/styles/nixos-search/catppuccin.user.css
@license MIT
@license MIT
@preprocessor less
@preprocessor less
@var select flavor "Flavor" ["latte:Latte*", "frappe:Frappe", "macchiato:Macchiato", "mocha:Mocha"]
@var select accentColor "Accent" ["rosewater:Rosewater", "flamingo:Flamingo", "pink:Pink", "mauve:Mauve", "red:Red", "maroon:Maroon", "peach:Peach", "yellow:Yellow", "green:Green", "teal:Teal", "blue:Blue*", "sapphire:Sapphire", "sky:Sky", "lavender:Lavender", "subtext0:Gray"]
==/UserStyle== */
@-moz-document domain("search.nixos.org") {
#catppuccin(@flavor);
#accent(@accentColor);
#nixos-search();
#catppuccin(@flavor, @accentColor);
#catppuccin(@flavor) when (@flavor = latte) {
@rosewater: hsl(11, 59%, 67%);
@flamingo: hsl(0, 60%, 67%);
@pink: hsl(316, 73%, 69%);
@mauve: hsl(266, 85%, 58%);
@red: hsl(347, 87%, 44%);
@maroon: hsl(355, 76%, 59%);
@peach: hsl(22, 99%, 52%);
@yellow: hsl(35, 77%, 49%);
@green: hsl(109, 58%, 40%);
@teal: hsl(183, 74%, 35%);
@sky: hsl(197, 97%, 46%);
@sapphire: hsl(189, 70%, 42%);
@blue: hsl(220, 91%, 54%);
@lavender: hsl(231, 97%, 72%);
@text: hsl(234, 16%, 35%);
@subtext1: hsl(233, 13%, 41%);
@subtext0: hsl(233, 10%, 47%);
@overlay2: hsl(232, 10%, 53%);
@overlay1: hsl(231, 10%, 59%);
@overlay0: hsl(228, 11%, 65%);
@surface2: hsl(227, 12%, 71%);
@surface1: hsl(225, 14%, 77%);
@surface0: hsl(223, 16%, 83%);
@base: hsl(220, 23%, 95%);
@mantle: hsl(220, 22%, 92%);
@crust: hsl(220, 21%, 89%);
}
#catppuccin(@lookup, @accent) {
@rosewater: @catppuccin[@@lookup][@rosewater];
@flamingo: @catppuccin[@@lookup][@flamingo];
@pink: @catppuccin[@@lookup][@pink];
@mauve: @catppuccin[@@lookup][@mauve];
@red: @catppuccin[@@lookup][@red];
@maroon: @catppuccin[@@lookup][@maroon];
@peach: @catppuccin[@@lookup][@peach];
@yellow: @catppuccin[@@lookup][@yellow];
@green: @catppuccin[@@lookup][@green];
@teal: @catppuccin[@@lookup][@teal];
@sky: @catppuccin[@@lookup][@sky];
@sapphire: @catppuccin[@@lookup][@sapphire];
@blue: @catppuccin[@@lookup][@blue];
@lavender: @catppuccin[@@lookup][@lavender];
@text: @catppuccin[@@lookup][@text];
@subtext1: @catppuccin[@@lookup][@subtext1];
@subtext0: @catppuccin[@@lookup][@subtext0];
@overlay2: @catppuccin[@@lookup][@overlay2];
@overlay1: @catppuccin[@@lookup][@overlay1];
@overlay0: @catppuccin[@@lookup][@overlay0];
@surface2: @catppuccin[@@lookup][@surface2];
@surface1: @catppuccin[@@lookup][@surface1];
@surface0: @catppuccin[@@lookup][@surface0];
@base: @catppuccin[@@lookup][@base];
@mantle: @catppuccin[@@lookup][@mantle];
@crust: @catppuccin[@@lookup][@crust];
@accent-color: @catppuccin[@@lookup][@@accent];
#catppuccin(@flavor) when (@flavor = frappe) {
@rosewater: hsl(10, 57%, 88%);
@flamingo: hsl(0, 59%, 84%);
@pink: hsl(316, 73%, 84%);
@mauve: hsl(277, 59%, 76%);
@red: hsl(359, 68%, 71%);
@maroon: hsl(358, 66%, 76%);
@peach: hsl(20, 79%, 70%);
@yellow: hsl(40, 62%, 73%);
@green: hsl(96, 44%, 68%);
@teal: hsl(172, 39%, 65%);
@sky: hsl(189, 48%, 73%);
@sapphire: hsl(199, 55%, 69%);
@blue: hsl(222, 74%, 74%);
@lavender: hsl(239, 66%, 84%);
@text: hsl(227, 70%, 87%);
@subtext1: hsl(227, 44%, 80%);
@subtext0: hsl(228, 29%, 73%);
@overlay2: hsl(228, 22%, 66%);
@overlay1: hsl(227, 17%, 58%);
@overlay0: hsl(229, 13%, 52%);
@surface2: hsl(228, 13%, 44%);
@surface1: hsl(227, 15%, 37%);
@surface0: hsl(230, 16%, 30%);
@base: hsl(229, 19%, 23%);
@mantle: hsl(231, 19%, 20%);
@crust: hsl(229, 20%, 17%);
}
#catppuccin(@flavor) when (@flavor =macchiato) {
@rosewater: hsl(10, 58%, 90%);
@flamingo: hsl(0, 58%, 86%);
@pink: hsl(316, 74%, 85%);
@mauve: hsl(267, 83%, 80%);
@red: hsl(351, 74%, 73%);
@maroon: hsl(355, 71%, 77%);
@peach: hsl(21, 86%, 73%);
@yellow: hsl(40, 70%, 78%);
@green: hsl(105, 48%, 72%);
@teal: hsl(171, 47%, 69%);
@sky: hsl(189, 59%, 73%);
@sapphire: hsl(199, 66%, 69%);
@blue: hsl(220, 83%, 75%);
@lavender: hsl(234, 82%, 85%);
@text: hsl(227, 68%, 88%);
@subtext1: hsl(228, 39%, 80%);
@subtext0: hsl(227, 27%, 72%);
@overlay2: hsl(228, 20%, 65%);
@overlay1: hsl(228, 15%, 57%);
@overlay0: hsl(230, 12%, 49%);
@surface2: hsl(230, 14%, 41%);
@surface1: hsl(231, 16%, 34%);
@surface0: hsl(230, 19%, 26%);
@base: hsl(232, 23%, 18%);
@mantle: hsl(233, 23%, 15%);
@crust: hsl(236, 23%, 12%);
}
#catppuccin(@flavor) when (@flavor = mocha) {
@rosewater: hsl(10, 56%, 91%);
@flamingo: hsl(0, 59%, 88%);
@pink: hsl(316, 72%, 86%);
@mauve: hsl(267, 84%, 81%);
@red: hsl(343, 81%, 75%);
@maroon: hsl(350, 65%, 77%);
@peach: hsl(23, 92%, 75%);
@yellow: hsl(41, 86%, 83%);
@green: hsl(115, 54%, 76%);
@teal: hsl(170, 57%, 73%);
@sky: hsl(189, 71%, 73%);
@sapphire: hsl(199, 76%, 69%);
@blue: hsl(217, 92%, 76%);
@lavender: hsl(232, 97%, 85%);
@text: hsl(226, 64%, 88%);
@subtext1: hsl(227, 35%, 80%);
@subtext0: hsl(228, 24%, 72%);
@overlay2: hsl(228, 17%, 64%);
@overlay1: hsl(230, 13%, 55%);
@overlay0: hsl(231, 11%, 47%);
@surface2: hsl(233, 12%, 39%);
@surface1: hsl(234, 13%, 31%);
@surface0: hsl(237, 16%, 23%);
@base: hsl(240, 21%, 15%);
@mantle: hsl(240, 21%, 12%);
@crust: hsl(240, 23%, 9%);
}
/* ----- Accent Mixins ----- */
#accent(@accentColor) when (@accentColor = rosewater) {
@accent-color: @rosewater;
}
#accent(@accentColor) when (@accentColor = flamingo) {
@accent-color: @flamingo;
}
#accent(@accentColor) when (@accentColor = pink) {
@accent-color: @pink;
}
#accent(@accentColor) when (@accentColor = mauve) {
@accent-color: @mauve;
}
#accent(@accentColor) when (@accentColor = red) {
@accent-color: @red;
}
#accent(@accentColor) when (@accentColor = maroon) {
@accent-color: @maroon;
}
#accent(@accentColor) when (@accentColor = peach) {
@accent-color: @peach;
}
#accent(@accentColor) when (@accentColor = yellow) {
@accent-color: @yellow;
}
#accent(@accentColor) when (@accentColor = green) {
@accent-color: @green;
}
#accent(@accentColor) when (@accentColor = teal) {
@accent-color: @teal;
}
#accent(@accentColor) when (@accentColor = blue) {
@accent-color: @blue;
}
#accent(@accentColor) when (@accentColor = sapphire) {
@accent-color: @sapphire;
}
#accent(@accentColor) when (@accentColor =sky) {
@accent-color: @sky;
}
#accent(@accentColor) when (@accentColor = lavender) {
@accent-color: @lavender;
}
#accent(@accentColor) when (@accentColor = subtext0) {
@accent-color: @subtext0;
}
#nixos-search {
/* Generic */
html,
body {
@ -312,14 +175,7 @@
}
/* Overrides menu item hover color */
.search-page
> .search-results
> div
> :first-child
> div:first-child
> ul
> li
> a {
.search-page > .search-results > div > :first-child > div:first-child > ul > li > a {
color: @text;
}
@ -399,72 +255,30 @@
color: @accent-color;
}
.search-page
> .search-results
> div
> :nth-child(2)
> li.package
> :nth-child(5)
> :nth-child(2)
ul.nav-tabs
> li
> a {
.search-page > .search-results > div > :nth-child(2) > li.package > :nth-child(5) > :nth-child(2) ul.nav-tabs > li > a {
color: @text;
}
.search-page
> .search-results
> div
> :nth-child(2)
> li.package
> :nth-child(5)
> :nth-child(2)
pre {
.search-page > .search-results > div > :nth-child(2) > li.package > :nth-child(5) > :nth-child(2) pre {
color: @text;
background-color: @mantle;
border: none;
}
.search-page
> .search-results
> div
> :nth-child(2)
> li.package
.result-item-show-more {
.search-page > .search-results > div > :nth-child(2) > li.package .result-item-show-more {
background-color: @base;
color: @text;
}
.search-page
> .search-results
> div
> :nth-child(2)
> li.package
> :nth-child(3)
> li {
.search-page > .search-results > div > :nth-child(2) > li.package > :nth-child(3) > li {
color: @text;
}
.search-page
> .search-results
> div
> :nth-child(2)
> li.package
> :nth-child(5)
> :nth-child(2)
div.tab-content {
.search-page > .search-results > div > :nth-child(2) > li.package > :nth-child(5) > :nth-child(2) div.tab-content {
border: 1px solid @surface0;
}
.search-page
> .search-results
> div
> :nth-child(2)
> li.option
> :nth-child(2)
> div:nth-child(2n)
pre
code {
.search-page > .search-results > div > :nth-child(2) > li.option > :nth-child(2) > div:nth-child(2n) pre code {
color: @text;
background-color: @mantle;
}
@ -522,3 +336,118 @@
}
}
}
@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;
}
@frappe: {
@rosewater: #f2d5cf;
@flamingo: #eebebe;
@pink: #f4b8e4;
@mauve: #ca9ee6;
@red: #e78284;
@maroon: #ea999c;
@peach: #ef9f76;
@yellow: #e5c890;
@green: #a6d189;
@teal: #81c8be;
@sky: #99d1db;
@sapphire: #85c1dc;
@blue: #8caaee;
@lavender: #babbf1;
@text: #c6d0f5;
@subtext1: #b5bfe2;
@subtext0: #a5adce;
@overlay2: #949cbb;
@overlay1: #838ba7;
@overlay0: #737994;
@surface2: #626880;
@surface1: #51576d;
@surface0: #414559;
@base: #303446;
@mantle: #292c3c;
@crust: #232634;
}
@macchiato: {
@rosewater: #f4dbd6;
@flamingo: #f0c6c6;
@pink: #f5bde6;
@mauve: #c6a0f6;
@red: #ed8796;
@maroon: #ee99a0;
@peach: #f5a97f;
@yellow: #eed49f;
@green: #a6da95;
@teal: #8bd5ca;
@sky: #91d7e3;
@sapphire: #7dc4e4;
@blue: #8aadf4;
@lavender: #b7bdf8;
@text: #cad3f5;
@subtext1: #b8c0e0;
@subtext0: #a5adcb;
@overlay2: #939ab7;
@overlay1: #8087a2;
@overlay0: #6e738d;
@surface2: #5b6078;
@surface1: #494d64;
@surface0: #363a4f;
@base: #24273a;
@mantle: #1e2030;
@crust: #181926;
}
@mocha: {
@rosewater: #f5e0dc;
@flamingo: #f2cdcd;
@pink: #f5c2e7;
@mauve: #cba6f7;
@red: #f38ba8;
@maroon: #eba0ac;
@peach: #fab387;
@yellow: #f9e2af;
@green: #a6e3a1;
@teal: #94e2d5;
@sky: #89dceb;
@sapphire: #74c7ec;
@blue: #89b4fa;
@lavender: #b4befe;
@text: #cdd6f4;
@subtext1: #bac2de;
@subtext0: #a6adc8;
@overlay2: #9399b2;
@overlay1: #7f849c;
@overlay0: #6c7086;
@surface2: #585b70;
@surface1: #45475a;
@surface0: #313244;
@base: #1e1e2e;
@mantle: #181825;
@crust: #11111b;
}
}