Skip to content

Commit

Permalink
Merge pull request #127 from maicol07/main
Browse files Browse the repository at this point in the history
refactor: Allow other formats for CSS variables
  • Loading branch information
Gibbu committed Jul 4, 2024
2 parents ee0f8b2 + 20febe0 commit 3b716fb
Show file tree
Hide file tree
Showing 30 changed files with 57 additions and 58 deletions.
4 changes: 2 additions & 2 deletions src/core/_root.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
:root {
--accent: 98, 205, 254; /* The colour used throughout the app | R,G,B format | Default: 98, 205, 254 */
--accent: rgb(98, 205, 254); /* The colour used throughout the app | Default: 98, 205, 254 */

--channels-width: 300px; /* Size of the server channel/dms list | Default: 300px */
--members-width: 280px; /* Size of the members list | Default: 280px */

--dark-background-hue: 0; /* The hue of the background colour. | Options: 0 to 360 | Default: 0 */
--dark-background-saturation: 0%; /* How much of the colour should be visible. | Must end in a % | Default: 0% */
}
}
4 changes: 2 additions & 2 deletions src/theme/_vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
--transition: cubic-bezier(0, 0, 0, 1);

--accent-text: #000;
--accent-solid: rgb(var(--accent));
--accent-solid: var(--accent);

--pill-width: 4px;
--pill-height: 16px;
Expand Down Expand Up @@ -79,5 +79,5 @@
--text-normal: var(--text-primary);
--text-muted: var(--text-tertiary);
--interactive-muted: var(--text-quaternary);
--text-link: rgb(var(--accent));
--text-link: var(--accent);
}
2 changes: 1 addition & 1 deletion src/theme/app/_tabbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
display: block;
opacity: 0;
border-radius: 30px;
background: rgb(var(--accent));
background: var(--accent);
position: absolute;
bottom: 0;
left: 50%;
Expand Down
2 changes: 1 addition & 1 deletion src/theme/app/_toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
background: var(--bg-alt);
&::before {
height: 2px;
background: rgb(var(--accent));
background: var(--accent);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/theme/betterdiscord/_input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
width: 18px;
}
&:checked {
background: rgb(var(--accent));
border-color: rgb(var(--accent));
background: var(--accent);
border-color: var(--accent);
&::before {
background: var(--accent-text);
transform: translateX(18px);
Expand Down
2 changes: 1 addition & 1 deletion src/theme/chat/_forum.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
background: var(--bg-interactive-high);
}
&#{cls('forum.card.selected')} {
border-color: rgb(var(--accent));
border-color: var(--accent);
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/theme/chat/_message.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
padding: 8px 16px 16px 16px;
}
.mentioned_d5deea {
background: rgb(var(--chat-mention-colour), 0.05);
background: rgb(from var(--chat-mention-colour) r g b / 5%);
&::before {
background: rgb(var(--chat-mention-colour));
background: var(--chat-mention-colour);
}

&.groupStart_d5deea .contents_ec86aa {
Expand Down Expand Up @@ -125,8 +125,8 @@

// @Mention/Link Channel
.wrapper_d4fa29 {
background: rgb(var(--accent), 0.1);
color: rgb(var(--accent));
background: rgb(from var(--accent) r g b / 10%);
color: var(--accent);
font-weight: var(--font-weight-semibold);
cursor: default;
&:hover {
Expand All @@ -145,9 +145,9 @@
background: var(--bg-interactive-high);
}
&.reactionMe_ec6b19 {
border-color: rgb(var(--accent));
.reactionCount_ec6b19 {
color: rgb(var(--accent));
border-color: var(--accent);
.reactionCount__2c34d {
color: var(--accent);
}
}
}
Expand Down Expand Up @@ -196,5 +196,5 @@

// Light theme
.theme-light #app-mount .mentioned_d5deea {
background: rgb(var(--accent), 0.15);
background: rgb(from var(--accent) r g b / 15%);
}
2 changes: 1 addition & 1 deletion src/theme/chat/_textbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
background: var(--bg-content-alt);
.inner_d0696b::before {
height: 2px;
background: rgb(var(--accent));
background: var(--accent);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/theme/guilds/_server.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@for $i from 21 through 40 {
span[style*='height: #{$i}'] {
transform: scale(1, 1) !important;
background: rgb(var(--accent));
background: var(--accent);
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/theme/inputs/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
align-items: center;
gap: 8px;
}

&.buttonColor_adcaac {
background: rgb(var(--accent));
background: var(--accent);
color: var(--accent-text);
}
&.lookFilled_dd4f85 {
Expand All @@ -34,7 +33,7 @@
transition: box-shadow 0.15s var(--transition);
&.colorBrand_dd4f85,
&.colorGreen-3y-Z79 {
background: rgb(var(--accent));
background: var(--accent);
color: var(--accent-text);
}
&.colorRed_dd4f85 {
Expand Down Expand Up @@ -104,7 +103,7 @@
}
&.lookLink_dd4f85 {
cursor: pointer;
color: rgb(var(--accent));
color: var(--accent);
.contents_dd4f85 {
background: none;
}
Expand Down
4 changes: 2 additions & 2 deletions src/theme/inputs/_checkboxes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
display: none;
}
&[aria-checked='true'] .iconContainer_d90b3d {
border-color: rgb(var(--accent));
background: rgb(var(--accent));
border-color: var(--accent);
background: var(--accent);
&::before {
opacity: 1;
}
Expand Down
4 changes: 2 additions & 2 deletions src/theme/inputs/_radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
display: none;
}
&[aria-checked='true'] .iconContainer_d90b3d {
border-color: rgb(var(--accent));
background: rgb(var(--accent));
border-color: var(--accent);
background: var(--accent);
&::before {
opacity: 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/theme/inputs/_select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
transform: translateY(-50%);
width: 3px;
height: var(--pill-height);
background: rgb(var(--accent));
background: var(--accent);
border-radius: 30%;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/theme/inputs/_slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
height: 4px;
}
.barFill_c7a159 {
background: rgb(var(--accent));
background: var(--accent);
}
.track_c7a159 {
left: 10px;
}
.grabber_c7a159 {
border: 4px solid var(--bg-highest);
margin-top: 0;
background: rgb(var(--accent));
background: var(--accent);
box-shadow: var(--shadow-flyout);
width: 20px;
height: 20px;
Expand Down
4 changes: 2 additions & 2 deletions src/theme/inputs/_steps.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#app-mount .container-2uPlB3 {
.selectedProgressBar-11z5d9 {
background: rgb(var(--accent));
background: var(--accent);
}
.colorBrand-21Le_q {
color: rgb(var(--accent));
color: var(--accent);
}
}
4 changes: 2 additions & 2 deletions src/theme/inputs/_switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
width: 18px;
}
&:checked {
background: rgb(var(--accent));
border-color: rgb(var(--accent));
background: var(--accent);
border-color: var(--accent);
&::before {
background: var(--accent-text);
transform: translateX(18px);
Expand Down
4 changes: 2 additions & 2 deletions src/theme/inputs/_textbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
&:focus,
&:focus-within {
background: var(--textbox-bg-active) !important;
box-shadow: inset 0 -1px 0 rgb(var(--accent));
border-bottom-color: rgb(var(--accent));
box-shadow: inset 0 -1px 0 var(--accent);
border-bottom-color: var(--accent);
}
}
.input-2g-os5.textArea-3WXAeD {
Expand Down
2 changes: 1 addition & 1 deletion src/theme/members/_member.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
height: 0;
left: 0;
opacity: 0;
background: rgb(var(--accent));
background: var(--accent);
transition: var(--pill-transition);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/theme/mixins/_btn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
}

@mixin btnPrimary {
background: rgb(var(--accent));
background: var(--accent);
color: var(--accent-text);
transition: box-shadow 0.15s var(--transition);
font-weight: var(--font-weight-semibold);
border: 1px solid var(--btn-border-x);
border-top-color: var(--btn-border-t);
border-bottom-color: var(--btn-border-b);
&:hover {
background: rgb(var(--accent));
background: var(--accent);
box-shadow: inset 0 0 0 100vmax hsl(0 0% 0% / 0.1) !important;
border-color: hsl(0 0% 0% / 0.1);
}
&:active {
background: rgb(var(--accent));
background: var(--accent);
box-shadow: inset 0 0 0 100vmax hsl(0 0% 0% / 0.2) !important;
border-color: hsl(0 0% 0% / 0.2);
}
Expand Down
6 changes: 3 additions & 3 deletions src/theme/modals/_quickswitcher.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
&:focus,
&:focus-within {
background: var(--textbox-bg-active) !important;
box-shadow: inset 0 -1px 0 rgb(var(--accent));
border-bottom-color: rgb(var(--accent));
box-shadow: inset 0 -1px 0 var(--accent);
border-bottom-color: var(--accent);
}
}

Expand Down Expand Up @@ -75,7 +75,7 @@
transform: translateY(-50%);
width: var(--pill-width);
height: 0;
background: rgb(var(--accent));
background: var(--accent);
border-radius: 30px;
opacity: 0;
transition: var(--pill-transition);
Expand Down
4 changes: 2 additions & 2 deletions src/theme/pages/_friends.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
background: var(--bg-content-alt);
&::before {
height: 2px;
background: rgb(var(--accent));
background: var(--accent);
}
}
}
Expand All @@ -74,7 +74,7 @@
display: block;
height: 0;
width: var(--pill-width);
background: rgb(var(--accent));
background: var(--accent);
border-radius: 50px;
transition: var(--pill-transition);
opacity: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/theme/popouts/_autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
width: var(--pill-width);
height: 0;
border-radius: 30px;
background: rgb(var(--accent));
background: var(--accent);
opacity: 0;
transition: var(--pill-transition);
}
Expand Down
6 changes: 3 additions & 3 deletions src/theme/popouts/_emojipicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
display: block;
opacity: 0;
border-radius: 30px;
background: rgb(var(--accent));
background: var(--accent);
position: absolute;
bottom: 0;
left: 50%;
Expand Down Expand Up @@ -92,8 +92,8 @@
}
&:focus-within {
background: var(--textbox-bg-high-active) !important;
box-shadow: inset 0 -1px 0 rgb(var(--accent));
border-bottom-color: rgb(var(--accent));
box-shadow: inset 0 -1px 0 var(--accent);
border-bottom-color: var(--accent);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/theme/popouts/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
color: hsl(var(--discord-pink));
}
&.colorBrand-3cPPsm {
color: rgb(var(--accent));
color: var(--accent);
}
}
// Reset
Expand Down
4 changes: 2 additions & 2 deletions src/theme/settings/_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
}

.selectedBackground-1qyzak {
background: rgb(var(--accent));
background: var(--accent);
}

// ~~Disabled icons (for now hopefully)
Expand All @@ -112,7 +112,7 @@
height: 0;
width: 4px;
border-radius: 4px;
background: rgb(var(--accent));
background: var(--accent);
opacity: 0;
transition: 0.15s var(--transition);
}
Expand Down
2 changes: 1 addition & 1 deletion src/theme/settings/guild/_roles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
left: 0;
top: 50%;
transform: translateY(-50%);
background: rgb(var(--accent));
background: var(--accent);
width: var(--pill-width);
height: 0;
opacity: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/theme/sidebar/_channel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
&.modeSelected_d8bfb3 {
&::before {
background: rgb(var(--accent));
background: var(--accent);
scale: 1;
}
.link_d8bfb3 {
Expand Down
2 changes: 1 addition & 1 deletion src/theme/sidebar/_dms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
&::before {
scale: 1;
opacity: 1;
background: rgb(var(--accent));
background: var(--accent);
}
&:hover {
background: var(--bg-interactive-high-hover);
Expand Down
Loading

0 comments on commit 3b716fb

Please sign in to comment.