refactor(deepl): rewrite (#1105)

This commit is contained in:
Omar authored and GitHub committed 2024-07-22 13:56:56 -07:00
1 parent 19a01161ea
commit 1fa7b7e397
1 file changed
+190 -584
+190 -584
View File
@@ -2,7 +2,7 @@
@name DeepL Catppuccin @name DeepL Catppuccin
@namespace github.com/catppuccin/userstyles/styles/deepl @namespace github.com/catppuccin/userstyles/styles/deepl
@homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/deepl @homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/deepl
@version 0.3.5 @version 1.0.0
@updateURL https://github.com/catppuccin/userstyles/raw/main/styles/deepl/catppuccin.user.css @updateURL https://github.com/catppuccin/userstyles/raw/main/styles/deepl/catppuccin.user.css
@supportURL https://github.com/catppuccin/userstyles/issues?q=is%3Aopen+is%3Aissue+label%3Adeepl @supportURL https://github.com/catppuccin/userstyles/issues?q=is%3Aopen+is%3Aissue+label%3Adeepl
@description Soothing pastel theme for DeepL @description Soothing pastel theme for DeepL
@@ -13,8 +13,6 @@
@var select lightFlavor "Light Flavor" ["latte:Latte*", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha"] @var select lightFlavor "Light Flavor" ["latte:Latte*", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha"]
@var select darkFlavor "Dark Flavor" ["latte:Latte", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha*"] @var select darkFlavor "Dark Flavor" ["latte:Latte", "frappe:Frappé", "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"] @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"]
@var checkbox zenMode "Zen Mode" 0
==/UserStyle== */ ==/UserStyle== */
@-moz-document regexp("https:\\/\\/www.deepl.com\\/?(.*\\/)translator.*$") { @-moz-document regexp("https:\\/\\/www.deepl.com\\/?(.*\\/)translator.*$") {
@@ -73,221 +71,105 @@
} }
} }
body, /* header */
button { .BasePageHeader-module--container--d81cb {
color: @text; background-color: @mantle !important;
} }
p { /* background */
color: @subtext1; body {
background-color: @base !important;
color: @text !important;
} }
a {
color: @accent-color;
&:hover {
color: darken(@accent-color, 8%);
}
}
input {
background-color: @base;
}
// dammit tailwind
.bg-neutral-next-50, .bg-neutral-next-50,
.bg-deprecated-grey {
background-color: @mantle;
}
&,
.bg-white, .bg-white,
.bg-blue-100 { .contextual-menu-dragging-area,
background-color: @base; input {
background-color: @base !important;
} }
.bg-dark-8 { .pageFooterV2-module--footerOuterContainer--0b055 {
background-color: @surface0; background-color: @mantle !important;
} }
.bg-mosque { /* text color */
background-color: spin(@accent-color, 30); h1,
h2,
&.text-white { h3,
color: @accent-text; h4,
} p,
a,
button,
span,
input,
ul,
li,
.mb-3,
.mb-4,
.GlossaryModalWithIllustration-module--content--2bf03,
.lmt__glossary_editor_glossaryName {
color: @text !important;
} }
.bg-blue-next-500 { /* privacy notice */
background-color: @accent-color; .cookieBanner-module--container--9baef {
background-color: @surface0 !important;
&.text-white { color: @text !important;
color: @accent-text;
}
} }
.border-dark-7, .button-module--button--4f58d.button-module--color_primaryAlt3--cd3cf {
.border-neutral-300 { border-color: @text !important;
border-color: @surface0;
} }
.border-blue-chill, /* side menu */
.bg-blue-next-500 { .classicSidemenu-module--menuContainer--35157 {
border-color: @accent-color; background-color: @base !important;
}
/* borders */
.border-black {
border-color: @surface2 !important;
}
.border-neutral-next-100,
.StartFreeTrialButton-module--startFreeTrialButton--bd671 {
border-color: @surface0 !important;
}
.divide-y > :not([hidden]) ~ :not([hidden]) {
border-color: @base;
}
.TranslatorTab-module--active--0b6ea .TranslatorTab-module--innerLower--8a080 {
background-color: @accent-color !important;
}
.ring-neutral-next-900 {
--tw-ring-color: @surface2
} }
.border-neutral-next-900 { .border-neutral-next-900 {
border-color: @overlay1; border-color: @surface2 !important;
} }
.text-deepl-blue, input {
.text-blue-600 { border-color: @surface0 !important;
color: @accent-color;
} }
.text-blue-chill { /* hover */
color: spin(@accent-color, 30); button:hover, .bg-blue-next-500:hover {
background-color: @surface1 !important;
} }
.text-deprecated-mid-grey { .FlyoutMenuButton-module--flyoutMenuButton--97ae6:hover {
color: @text; background-color: @mantle !important;
} }
.text-neutral-600 { [class*="SourceTranslatorArea-module--focusBorder--"]:has(
color: @subtext0; div[contenteditable="true"]:focus
} ){
.text-dark-1,
.text-deprecated-almost-black {
color: @subtext1;
}
.text-white,
.text-black {
color: @text;
}
.text-neutral-next-800 {
color: @overlay1;
}
[class*="hover:bg-dark-8"]:hover,
[class*="enabled:hover:bg-dark-8"]:hover:enabled,
[class*="hover:bg-neutral-200"]:hover,
[class*="hover:bg-neutral-next-100"]:hover {
background-color: @surface0;
}
[class*="hover:bg-blue-200"]:hover {
background-color: mix(@accent-color, @base, 8%);
}
[class*="hover:bg-blue-next-700"]:hover {
background-color: darken(@accent-color, 8%);
}
[class*="hover:border-blue-next-700"]:hover {
border-color: darken(@accent-color, 8%);
}
[class*="disabled:text-dark-5:disabled"],
[class*="disabled:text-neutral-500:disabled"] {
color: @overlay1;
}
[class*="hover:text-blue-chill"]:hover {
color: darken(@accent-color, 15%);
}
[class*="bg-[#E1F0F5]"] {
background-color: fadeout(@accent-color, 70%);
}
// span[class*="hover:bg-[#B4DAE8]"],
[class*="bg-[#B4DAE8]"] {
// background-color: fadeout(@accent-color, 55%);
&[class*="text-[#01557C]"] {
color: darken(@accent-color, 50%);
}
}
[class*="text-[#25282D]"] {
color: @text;
}
[class*="text-[#01557C]"] {
color: @accent-color;
}
.divide-dark-7 > :not([hidden]) ~ :not([hidden]) {
border-color: @surface1;
}
// general stuff
[class*="button--"] {
&[class*="variant_contained--"],
&[class*="variant_contained--"]:hover {
color: @accent-text;
}
&[class*="color_primary--"] {
background-color: @accent-color;
border-color: @accent-color; border-color: @accent-color;
&:hover {
background-color: darken(@accent-color, 15%);
border-color: darken(@accent-color, 15%);
color: @accent-text;
}
}
}
[class*="IconAnchor-module--anchor--"] {
color: @accent-color;
&:hover {
background-color: @surface0;
}
}
[stroke="#0F2B46"] {
stroke: @accent-color !important;
}
[stroke="#006494"] {
stroke: @subtext0 !important;
}
// header
[class*="BasePageHeader-module--"] {
background-color: @crust;
}
.border-\[\#f1f1f1\] {
border-color: @surface0;
}
[class|="PageHeaderLink-module--pageHeaderLink"],
[class|="FlyoutMenuButton-module--flyoutMenuButton"],
[class|="LoginButton-module--loginButton"] {
color: darken(@accent-color, 8%);
}
[class|="SideMenuButton-module--menuButton"] {
&,
&::before,
&::after {
border-top-color: darken(@accent-color, 8%);
}
&:hover {
&,
&::before,
&::after {
border-top-color: @accent-color;
}
}
} }
[class*="PageHeaderLink-module--pageHeaderLink--"]:not( [class*="PageHeaderLink-module--pageHeaderLink--"]:not(
@@ -297,449 +179,173 @@
border-color: @accent-color; border-color: @accent-color;
} }
[class|="LoginButton-module--loginButton"]:hover { /* buttons */
color: @accent-color; .TranslatorTab-module--cardButton--4b203,
.bg-\[\#EDF8FC\] {
background-color: @surface0 !important;
border-color: @surface0 !important;
} }
[class*="badge-module--badge--"][class*="badge-module--proDark--"] { .StartFreeTrialButton-module--startFreeTrialButton--bd671,
background-color: spin(@accent-color, 30); .bg-blue-next-50 {
color: @accent-text; background-color: @surface0 !important;
} }
[class*="StartFreeTrialButton-module--startFreeTrialButton--"] { .bg-blue-next-500 {
background-color: @accent-color !important;
border-color: @accent-color !important;
color: @accent-text !important;
&:hover {
background-color: darken(@accent-color, 8%);
border-color: darken(@accent-color, 8%);
color: @accent-text;
}
}
[class|="ProductUpdateButton-module--updateToolTip"] {
background-color: @surface0; background-color: @surface0;
color: @text;
&::after {
border-bottom-color: @surface0;
}
}
// buttons above translation container
.bg-\[\#EDF8FC\],
[class|="cardButton"] {
background-color: @base;
border-color: @surface0; border-color: @surface0;
&:not([class*="active--"]):hover {
background-color: @surface0;
}
} }
[class|="textLower"] { .LanguageSelector-module--wrapper--f9f17 {
color: @overlay1; --button-background: @surface0 !important;
--button-border-color: @surface0 !important;
color: @base !important;
} }
[class|="logo"], .CareerBanner-module--container--2ac20 {
[class|="textUpper"] { background-color: @surface0 !important;
color: @accent-color;
} }
[class*="active--"] { /* glossary button */
[class|="logo"], .lmt__glossaryButton, .lmt__glossaryButton__desktop:hover, .ModalDialogContent-module--content--5751e {
[class|="textUpper"] { background-color: @surface0 !important;
color: @text;
} }
[class|="innerLower"] { .lmt__glossary_acceptButton,
background-color: @accent-color; .lmt__glossary_editor,
} .lmt__glossary_editor_subBar_top,
.lmt__glossary_editor_subBar_bottom,
.lmt__glossary_editor_mainBar,
.Select-module--wrapper--53ec7 .Select-module--flyout--c91f3,
.lmt_firstEntry-content,
.lmt__glossary_newEntry_langButton,
.Select-module--wrapper--53ec7,
.Select-module--button--f032e {
background-color: @surface0 !important;
border-color: @surface0 !important;
} }
// translation container .desktop-glossary-overwrites .lmt__language_select__menu {
[class*="SourceTranslatorArea-module--focusBorder--"]:has( background-color: @surface0 !important;
div[contenteditable="true"]:focus color: @text !important;
) {
border-color: @accent-color;
} }
d-textarea > [data-placeholder], .lmt__glossary_newEntry_langDropdown.lmt__language_select__menu button .langName {
d-textarea > div[data-content="true"]::before { color: @text !important;
color: @subtext0;
} }
[class*="enabled:hover-capable:hover:bg-dark-8"]:hover:enabled { /* pro banner */
background-color: @surface0; .ProBanner2021-module--wrapper--c7e3d,
.p-8 {
background: @base !important;
} }
// alternatives /* some button colors */
[data-testid="word-alternatives-list"] { .badge-module--badge--c9ebe.badge-module--proDark--a4d4e {
[class*="root--"] { background-color: @green;
background-color: @base; color: @base !important;
&[class*="selected--"] {
background-color: @surface0;
}
}
} }
div:has(> [class^="DictionaryContent-module--content--"].embedded) { .button-module--button--a854e.button-module--color_secondary--f171e {
background-color: @base; background-color: @peach;
border-color: @peach !important;
.tag_lemma .dictLink { color: @base !important;
color: @subtext1;
} }
.translation_group .translation_group_line .notascommon, .button-module--button--a854e.button-module--variant_outline--b937c {
.translation_group .translation_group_line .translation.sortablemg .sep { background-color: @surface0 !important;
color: @overlay2; border-color: @surface0 !important;
}
} }
// dictionary .button-module--button--a854e.button-module--color_primary--bfa59 {
[class*="DictionaryContent-module--content--"] { background-color: @blue !important;
.isForeignTerm .inflectioninfo, border-color: @blue !important;
.isForeignTerm .tag_lemma, color: @base !important;
.isForeignTerm .tag_lemma a,
.isForeignTerm .tag_s,
.isForeignTerm .tag_s a,
.isForeignTerm .tag_trans_src_context,
.tag_trans {
color: @subtext1;
} }
.isForeignTerm .tag_t, /* dropdowns */
.isForeignTerm .tag_t a, .ProductUpdatesContainer-module--updateContainer--16394,
.isForeignTerm .tag_trans, .ProductUpdateFooter-module--updateFooter--b46f0 {
.isForeignTerm .tag_trans a,
.tag_lemma a {
color: @accent-color;
}
.notascommon,
.sep {
color: @overlay2;
}
}
// glossary
.lmt__glossary_dialog--arrow {
&::before {
border-color: @surface1 transparent transparent;
}
&::after {
border-color: @surface0 transparent transparent;
}
}
.lmt__glossary_onOffSwitch_container {
label[class|="label"] {
--background: @overlay1;
--backgroundHover: darken(@overlay1, 8%);
--inlineLabelColor: @accent-text;
--outline-color: @accent-color;
&[class*="selected--"] {
--background: @green;
--backgroundHover: darken(@green, 8%);
}
[class|="toggle"] [class|="knob"] {
background: @accent-text;
}
}
}
[class|="modal"],
.lmt__glossary_editor {
background-color: @base;
[class*="Form-module--form--"] [class*="Form-module--submit--"] {
background: @accent-color;
color: @accent-text;
&:disabled {
background: fadeout(@accent-color, 50%);
}
}
}
.lmt__glossary_editor {
color: @text;
border-color: @accent-color;
form.bg-deprecated-grey
[class|="wrapper"][class*="Form-module--inputSource--"],
form.bg-deprecated-grey
[class|="wrapper"][class*="Form-module--inputTarget--"] {
--input-background: @base;
--input-border-color: @surface1;
--input-color: @subtext1;
[class|="button"][aria-expanded="true"] {
border-color: @accent-color;
}
[class|="controls"] [class|="wrapper"] {
--button-background: @base;
--button-border-color: @surface1;
--button-color: @subtext1;
[class|="flyout"] {
background: @base;
--option-color: @subtext1;
--option-selected-color: @subtext1;
--option-background: fadeout(@yellow, 80%);
--option-disabled-color: @overlay1;
--option-icon-color: @accent-color;
}
}
}
}
.lmt__glossary_editor_mainBar {
background-color: @accent-color;
color: @accent-text;
.lmt__glossary_editorClose {
color: inherit;
}
}
.lmt__glossary_editor .lmt__glossary_editor_subBar_top,
.lmt__glossary_editor_subBar_bottom {
background-color: @mantle;
}
.lmt__glossary_editor
.lmt__glossary_editor_subBar_top
.lmt__glossary_editor_glossarySelect
.lmt__glossary_editor_glossaryNameWrapper
.lmt__glossary_editor_glossaryName {
color: inherit;
}
.lmt__glossary_editor
.lmt__glossary_editor_subBar_top
.lmt__glossary_editor_glossarySelect
.lmt__glossary_editor_glossaryNameWrapper
.lmt__glossary_editor_glossarySelectChevron.lmt__glossary_arrowDown {
border-right-color: darken(@accent-color, 8%);
border-bottom-color: darken(@accent-color, 8%);
}
.lmt__glossary_button .lmt__glossary_button_label:hover,
.lmt__glossary_highlight,
.lmt__glossary_editor_subBar_bottom
.lmt__glossary_editor_glossaryAddNewWrapper
.lmt__glossary_editor_glossaryAddNew {
color: @accent-color;
}
.lmt_firstEntry-content .lmt__glossary_newEntry_inputSource,
.lmt_firstEntry-content .lmt__glossary_newEntry_inputTarget {
border-color: @surface1;
color: @subtext1;
&:focus {
border-color: @accent-color;
}
}
.lmt__glossary_editor_langPairHeadline {
color: inherit;
border-bottom-color: @surface1;
}
.lmt__glossary_editorRow {
color: inherit;
.iconButton {
color: @subtext0;
}
}
.lmt__glossary_arrowRightWrapper .lmt__glossary_arrowRight {
border-bottom-color: @surface1;
border-right-color: @surface1;
}
.lmt__glossary_dialog {
background-color: @surface0;
border-color: @surface1;
color: @text;
}
.lmt__glossary_dialog__line--suggestions,
.lmt__glossary_dialog__line .choice .option {
color: @accent-color;
}
// this this appears when you click on a word on the translated container...
.root--Te5J3 {
background-color: @base;
}
.divider--CI8JQ {
color: @surface1;
}
// translate files
[class^="UploadPanel-module--docTrans__help_popup--"] {
background-color: @base;
}
// quotes
[class|="Quote-module--quote"] {
background-color: @base !important; background-color: @base !important;
border-color: @surface0; border-color: @surface0 !important;
color: @text;
} }
[class|="Quote-module--quoteSource"] { /* allow mic/get extension prompt */
> a { .bg-neutral-next-900, .bg-blue-next-800 {
color: darken(@accent-color, 8%); background-color: @surface0 !important;
}
}
[class|="Quotes-module--quotesNavigationEntry"] {
background-color: @surface1;
}
[class*="Quotes-module--quotesNavigationEntryActive--"] {
background-color: @accent-color;
}
// aside
[class^="ProBanner2021-module--wrapper--"],
[class|="CareerBanner-module--container"] {
background: @base;
}
[class|="CareerBanner-module--text"] {
h2 {
color: @overlay1;
}
}
[class|="PopularLangPairList-module--seoText"] {
color: @overlay0;
p[class|="PopularLangPairList-module--title"] {
color: @overlay2;
}
}
// footer
footer [class|="pageFooterV2-module--footerOuterContainer"] {
background-color: @base;
}
[class|="ProBanner2021-module--textLink"] {
color: spin(@accent-color, 30);
}
[class|="pageFooterV2-module--footerOuterContainer"]
[class|="pageFooterV2-module--footerContainer"]
[class|="pageFooterV2-module--footerContentContainer"]
[class|="pageFooterV2-module--linksContainer"]
[class|="pageFooterV2-module--linkList"]
li {
&:first-of-type {
color: @overlay1;
}
&:not(:first-of-type) a {
color: @text !important;
}
}
[class|="LanguageSelector-module--wrapper"] {
--button-background: @surface0;
--button-border-color: @surface1;
--button-color: @subtext1;
[class|="LanguageSelector-module--flyout"] {
background: @surface0;
// --option-background: @surface0;
--option-color: @subtext1;
--option-icon-color: @accent-color;
[class|="LanguageSelector-module--option"][class*="LanguageSelector-module--active--"] {
--option-background: fadeout(@yellow, 80%);
}
}
}
// side menu
[class|="classicSidemenu-module--menuContainer"] {
background-color: @base;
[class|="closeButton-module--closeButton"] {
&::before,
&::after {
background-color: @accent-color;
}
}
}
[class|="classicSidemenu-module--mainContent"] {
border-bottom-color: @surface0;
}
[class|="mainMenu-module--container"] a {
color: @text;
&:hover {
color: @accent-color;
}
}
[class|="subMenu-module--container"] {
button {
color: @text !important; color: @text !important;
} }
[class|="button-module--button"][class*="button-module--variant_text--"] { /* icons, svgs and images */
&, svg {
&:hover { color: @text !important;
background-color: transparent;
} }
.lmt__glossary_ad_checkmark, .lmt__glossary_arrowDown {
border-color: @text !important;
}
& when (@lookup = latte) {
path,
.DeeplLogoText-module--logoText--34a4f,
.ProBanner2021-module--lockitem--febe3,
.FlyoutMenuButton-module--flyoutMenuButton--97ae6::after,
#top-navi-sidemenu-opener,
.pageFooterV2-module--socialMediaLinks--71305,
.ProBanner2021-module--checkitem--2d8e7 {
filter: brightness(0) invert(29%) sepia(7%) saturate(1782%) hue-rotate(196deg) brightness(97%) contrast(88%);
}
.Logo-module--logoImg--1ee7e {
filter: invert(24%) sepia(95%) saturate(2507%) hue-rotate(217deg) brightness(102%) contrast(92%);
} }
} }
.lmt__glossary_ad_checkmark { & when (@lookup = frappe) {
border-bottom-color: @green; path,
border-right-color: @green; .DeeplLogoText-module--logoText--34a4f,
.ProBanner2021-module--lockitem--febe3,
.FlyoutMenuButton-module--flyoutMenuButton--97ae6::after,
#top-navi-sidemenu-opener,
.pageFooterV2-module--socialMediaLinks--71305,
.ProBanner2021-module--checkitem--2d8e7 {
filter: brightness(0) invert(79%) sepia(9%) saturate(884%) hue-rotate(193deg) brightness(106%) contrast(92%);
} }
& when (@zenMode = 1) { .Logo-module--logoImg--1ee7e, .deeplLogo-module--logo--ffd7a {
header, filter: invert(60%) sepia(77%) saturate(428%) hue-rotate(192deg) brightness(101%) contrast(87%);
[class="w-full bg-white px-8 lg:px-[70px]"], }
[class="p-8 lg:px-[70px]"],
footer,
[href="/write"].block {
display: none;
} }
body { & when (@lookup = macchiato) {
background: @mantle; path,
.DeeplLogoText-module--logoText--34a4f,
.ProBanner2021-module--lockitem--febe3,
.FlyoutMenuButton-module--flyoutMenuButton--97ae6::after,
#top-navi-sidemenu-opener,
.pageFooterV2-module--socialMediaLinks--71305,
.ProBanner2021-module--checkitem--2d8e7 {
filter: brightness(0) invert(75%) sepia(22%) saturate(286%) hue-rotate(191deg) brightness(110%) contrast(92%);
} }
[class="relative pr-0 false"] { .Logo-module--logoImg--1ee7e, .deeplLogo-module--logo--ffd7a {
height: 100%; filter: invert(61%) sepia(75%) saturate(404%) hue-rotate(190deg) brightness(98%) contrast(95%);
}
} }
[data-testid="translator"] { & when (@lookup = mocha) {
place-content: center center; path,
align-items: center; .DeeplLogoText-module--logoText--34a4f,
.ProBanner2021-module--lockitem--febe3,
> div:first-of-type { .FlyoutMenuButton-module--flyoutMenuButton--97ae6::after,
width: 100vw; #top-navi-sidemenu-opener,
.pageFooterV2-module--socialMediaLinks--71305,
.ProBanner2021-module--checkitem--2d8e7 {
filter: brightness(0) invert(86%) sepia(4%) saturate(1588%) hue-rotate(192deg) brightness(101%) contrast(91%);
} }
.Logo-module--logoImg--1ee7e, .deeplLogo-module--logo--ffd7a {
filter: invert(61%) sepia(85%) saturate(375%) hue-rotate(189deg) brightness(98%) contrast(100%);
} }
} }
} }