diff --git a/styles/crates.io/catppuccin.user.less b/styles/crates.io/catppuccin.user.less index 3a441a28..fdcb1dbf 100644 --- a/styles/crates.io/catppuccin.user.less +++ b/styles/crates.io/catppuccin.user.less @@ -18,24 +18,10 @@ @import "https://userstyles.catppuccin.com/lib/std/v1.less"; @-moz-document domain("crates.io") { - @import url("https://unpkg.com/@catppuccin/highlightjs@1.0.0/css/catppuccin-variables.important.css"); - - code.hljs { - background: none !important; - } - - :root[data-color-scheme="system"] { - @media (prefers-color-scheme: light) { - #catppuccin(@lightFlavor); - } - @media (prefers-color-scheme: dark) { - #catppuccin(@darkFlavor); - } - } - :root[data-color-scheme="dark"] { #catppuccin(@darkFlavor); } + :root[data-color-scheme="light"] { #catppuccin(@lightFlavor); } @@ -45,216 +31,450 @@ #lib.defaults(); #lib.css-variables(); - &, - * { - --shadow: none !important; - --csstools-color-scheme--dark: none; + :focus-visible { + outline-color: @accent; + outline-style: solid; + } - --header-bg-color: @mantle; - --main-color: @text; - --main-color-light: @subtext1; - --main-shadow-color: @surface0; + @layer global { --main-bg: @mantle; --main-bg-dark: @base; - --gray-border: @surface0; + --main-color: @text; + --main-color-light: @subtext1; + --main-shadow-color: @crust; + --link-color: @accent; - --link-hover-color: darken(@accent, 5%); - --footer-header-color: @text; + --link-hover-color: lighten(@accent, 5%); - /* Main article/readme background */ - --csstools-light-dark-toggle--63: @base; + --gray-border: @surface2; - /* Inline code background */ - --csstools-light-dark-toggle--92: @mantle; - /* Code block background */ - --csstools-light-dark-toggle--91: @mantle; - /* Copyable text hover */ - --csstools-light-dark-toggle--78: @base; + --header-bg-color: @base; - /* Versions cards */ - --csstools-light-dark-toggle--111: @text; - --csstools-light-dark-toggle--113: @base; - --csstools-light-dark-toggle--114: fade(@green, 15%); - --csstools-light-dark-toggle--117: fade(@yellow, 15%); - --csstools-light-dark-toggle--109: @surface0; - --csstools-light-dark-toggle--110: @surface0; - --csstools-light-dark-toggle--115: @surface0; - --csstools-light-dark-toggle--118: @surface0; - --csstools-light-dark-toggle--126: @text; - [class*="_new"] { - color: @green; - } - /* Dependencies cards */ - --csstools-light-dark-toggle--83: @base; - --csstools-light-dark-toggle--79: @surface0; - --csstools-light-dark-toggle--80: @text; - --csstools-light-dark-toggle--81: @text; - --csstools-light-dark-toggle--84: @subtext0; - --grey600: @subtext0; - --grey700: @text; - /* Dependents cards */ - --csstools-light-dark-toggle--89: @base; - --csstools-light-dark-toggle--86: @surface0; - /* Search results cards */ - --csstools-light-dark-toggle--2: @base; - /* Homepage cards */ - --csstools-light-dark-toggle--74: @base; - --csstools-light-dark-toggle--77: @surface0; - --csstools-light-dark-toggle--75: @subtext1; - --csstools-light-dark-toggle--76: @text; - --csstools-light-dark-toggle--19: @subtext0; - --csstools-light-dark-toggle--20: @subtext0; - - /* Header search bar */ - --csstools-light-dark-toggle--34: @crust; --yellow500: @accent; --yellow700: darken(@accent, 5%); - /* Dropdown */ - --csstools-light-dark-toggle--23: @mantle; - --csstools-light-dark-toggle--35: @mantle; - /* Dropdown items */ - [class*="_item_"] { - button:hover, - > a:hover, - [class*="_selected_"] { - background: @surface0; - color: @text !important; + .button { + --text-color: @base; + --disabled-text-color: @surface1; + + --bg-color-top: @accent; + --bg-color-bottom: @accent; + --bg-color-top-light: @accent; + --bg-color-bottom-light: @accent; + --bg-color-top-dark: darken(@accent, 5%); + --bg-color-bottom-dark: darken(@accent, 5%); + } + + .button--red { + --bg-color-top: @maroon; + --bg-color-bottom: @maroon; + --bg-color-top-light: @maroon; + --bg-color-bottom-light: @maroon; + --bg-color-top-dark: @red; + --bg-color-bottom-dark: @red; + } + + input[type="checkbox"] { + accent-color: @accent; + } + + input { + background-color: @base; + color: @text; + + &[aria-invalid="true"] { + border-color: @red; } } - } - /* Toasts */ - .c-notification { - --ecn-green: @green; - --ecn-blue: @blue; - --ecn-orange: @peach; - --ecn-red: @red; - - &, - .c-notification__icon { - color: @crust; - } - } - - /* Tooltips */ - .ember-tooltip { - color: @text; - background-color: @crust; - text-shadow: none; - - &[x-placement^="top"] .ember-tooltip-arrow { - border-top-color: @crust; - } - } - - /* Icons and icon badges */ - [class*="downloads_"] [fill="#FFF"] { - fill: @surface0 !important; - } - [fill="#B13B89"], - [fill="#B84D94"], - svg[class*="_download-icon"] { - fill: @accent !important; - } - [stroke="#B84D94"] { - stroke: @accent !important; - } - - /* Footer links */ - ._content_hautyr { - h1 { - text-shadow: none; - } - - a { - color: @accent; - - &:hover { - color: darken(@accent, 5%); - text-shadow: none; - } - } - } - - /* Misc header text */ - [class*="_header-inner_"] { - &, - a { + select { + background-color: @base; color: @text; } } - /* Search bar magnifying glass icon */ - form[action="/search"] button { - color: @crust; - } + .tooltip { + background-color: @mantle; + color: @text; - /* Sort by search results */ - ._icon_xsqxju { - color: @accent; - } - - /* Primary buttons */ - [class*="_tan-button_"], - [class*="_yellow-button_"] { - color: @crust !important; - background: @accent; - - &:hover { - background-color: darken(@accent, 5%); - } - } - - [class*="_red-button_"] { - --bg-color-top: @maroon; - --bg-color-bottom: @maroon; - --bg-color-top-dark: @red; - --bg-color-bottom-dark: @red; - } - - /* User email settings */ - [class*="_me-email_"] { - [class*="_row_"] { - border-color: @surface0; - } - [class*="_verified_"] { + .rt-latest { color: @green; } + + .new { + color: @peach; + } } - /* Logged out home page hero */ - [class*="_hero-title_"] { - color: @text; - text-shadow: none; + .dropdown ul { + background-color: @base; + border-color: @surface1; + + li { + a:hover, + button:hover, + button.selected { + background-color: @surface0; + color: @text !important; + } + + .icon { + background-color: @text; + } + } } - [class*="_hero-button_"] [class*="_icon_"] { - color: @crust; + + nav { + .login-button { + color: @text; + } + + .color-scheme-menu .icon { + background-color: @text; + } } - [class*="_blurb_"] [class*="_stats-value_"] { - [class*="_label_"], - svg { + + footer { + h2 { + text-shadow: none; + } + + ul li a { + color: @text; + } + } + + /* Crates List */ + .results-meta .sort-dropdown { + .icon { + background-color: @accent; + } + } + + .crate-row { + --shadow: 0 1px 3px var(--main-shadow-color); + background-color: @base; + } + + /* Crates */ + .main { + // Crates - README + .header, + .docs { + --shadow: 0 2px 3px if((@flavor = latte), @surface2, @base); + background-color: @base; + } + + .wrapper { + p code, + li code { + background-color: @surface0 !important; + } + pre { + background-color: @mantle; + } + } + + .crate-downloads { + .stat-icon { + color: @mantle; + background-color: @text; + } + } + + // Crates - Code + .viewer { + .code { + background-color: @base; + diffs-container { + --diffs-fg: @text; + --diffs-bg: @base; + } + } + } + + .viewer file-tree-container { + --trees-search-bg: @mantle; + --trees-search-fg: @text; + --trees-border-color: @mantle; + --trees-bg: @base; + --trees-fg: @subtext0; + --trees-selected-fg: @text; + --trees-fg-muted: @subtext0; + --trees-accent: @accent; + } + + // Crates - Versions, Dependencies, Dependents + [role="list"] .row, + .list .row { + background-color: @base; + + &:hover { + background-color: @surface0; + } + + .description { + color: @subtext0; + } + + // Versions + .release-track { + background-color: @text; + color: @base; + } + + .num-link { + color: @subtext1; + } + + &.latest { + &:hover { + background-color: fade(@green, 10%); + } + + .release-track { + background-color: @green; + border-color: @green; + } + + .num-link { + color: @green; + } + } + + &.prerelease { + &:hover { + background-color: fade(@peach, 10%); + } + + .release-track { + background-color: @peach; + border-color: @peach; + } + + .num-link { + color: @peach; + } + } + + &.yanked { + &:hover { + background-color: fade(@red, 10%); + } + + .release-track { + background-color: @red; + border-color: @red; + } + + .num-link { + color: @red; + } + } + + .metadata { + color: @subtext1; + + time[role="listitem"].new { + color: @peach; + } + + .publisher a:hover { + color: @text; + } + } + + // Dependencies + .link, + .range-lg { + color: @subtext1; + } + + .name-and-metadata { + .optional-label, + .features-label { + color: @subtext0; + } + } + + // Dependents + .top { + a, + .range, + .downloads { + color: @subtext1; + } + } + } + + // Crate - Security + .advisories .row { + background-color: @base; + + .affected-versions { + border-color: @peach; + background-color: @mantle; + } + } + + .no-results { + background-color: @mantle; + } + } + + .notification { + color: @base; + + .notification__icon { + color: @base; + } + + .notification--success { + background-color: @green; + } + } + + /* Homepage */ + .header-inner { + button.submit-button .icon { + background-color: @base; + } + + .input-lg, + .input-sm { + background-color: @mantle; + box-shadow: 1px 2px 4px 0 var(--main-shadow-color); + } + + &, + .hero-title, + .index-link { + color: @text; + text-shadow: none; + } + } + + .hero-button .icon { + color: @base; + } + + .blurb .stats { + .icon { + background-color: @subtext0; + } + + .label { color: @subtext0; } } - /* User avatar backgrounds */ - [class*="_avatar_"] { + .box { + --shadow: 0 2px 3px if((@flavor = latte), @surface2, @surface0); background-color: @surface0; - box-shadow: none; - } + color: @text; - [class*="_yanked-badge_"] { - background-color: @red; - color: @crust; - } - - /* Tables in READMEs */ - table { - th, - td { - border-color: @surface1; + .subtitle, + .icon { + color: @subtext1; } + + .version, + .downloads { + color: @subtext0; + } + + &:hover { + background-color: @surface1; + } + } + + /* Dashboard */ + .page-header-content .stats .downloads .icon { + background-color: @accent; + } + + .my-info { + .my-crate-lists { + .section-header, + .list { + .link { + background-color: @base; + color: @subtext1; + } + + .icon { + background-color: @accent; + } + } + } + + .my-feed { + .icon { + background-color: @accent; + } + + .feed-row { + background-color: @base; + border-color: @mantle; + } + } + } + + /* Account Settings */ + .verified { + color: @green; + } + + .empty-state { + background-color: @base; + border-color: @surface1; + } + + .list .link.active:hover { + background-color: fade(@base, 60%); + } + + .form-group { + .form-group-error { + color: @red; + } + + .crates-scope { + background-color: @base; + + button:hover { + background-color: @surface0; + } + } + + .scopes-list { + &.invalid { + border-color: @red; + } + + li { + background-color: @base; + color: @text; + } + } + + .crates-unrestricted, + .crates-pattern-button { + background-color: @base; + } + + .icon { + color: @subtext0; + } + + .crates-pattern-button button:hover { + background-color: @surface0; + } + } + + /* Owner Invites */ + .panel { + background-color: @base; } } }