1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

Cleanup of the SCSS Variables (#1255)

* Clean up variable names and comments

* Fix Option Colour - issue #1338

* Update old scss variable name

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
This commit is contained in:
Danny Murphy
2022-01-26 04:54:15 +00:00
committed by GitHub
parent f387a4d469
commit 2ffe3bd6ad
9 changed files with 65 additions and 66 deletions

View File

@@ -14,7 +14,7 @@ body {
} }
@include themify($themes) { @include themify($themes) {
background-color: themed("layoutFrontendColor"); background-color: themed("layoutFrontendColor");
color: themed("headingColor"); color: themed("textHeadingColor");
} }
} }
@@ -53,7 +53,7 @@ body {
h4 { h4 {
margin: 0; margin: 0;
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
} }
} }
} }
@@ -114,7 +114,7 @@ h3,
h4, h4,
h5 { h5 {
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
} }
small { small {
@@ -123,7 +123,7 @@ h5 {
&.spaced-header { &.spaced-header {
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
} }
} }
} }
@@ -135,7 +135,7 @@ a {
&.text-body { &.text-body {
@include themify($themes) { @include themify($themes) {
color: themed("headingColor") !important; color: themed("textHeadingColor") !important;
font-weight: themed("linkWeight"); font-weight: themed("linkWeight");
} }
} }
@@ -190,14 +190,14 @@ code {
.bg-success { .bg-success {
@include themify($themes) { @include themify($themes) {
background-color: themed("success") !important; background-color: themed("success") !important;
color: themed("successTextColor") !important; color: themed("textSuccessColor") !important;
} }
} }
.bg-warning { .bg-warning {
@include themify($themes) { @include themify($themes) {
background-color: themed("warning") !important; background-color: themed("warning") !important;
color: themed("warningTextColor") !important; color: themed("textWarningColor") !important;
} }
} }
@@ -205,14 +205,14 @@ code {
.bg-danger { .bg-danger {
@include themify($themes) { @include themify($themes) {
background-color: themed("danger") !important; background-color: themed("danger") !important;
color: themed("dangerTextColor") !important; color: themed("textDangerColor") !important;
} }
} }
.bg-info { .bg-info {
@include themify($themes) { @include themify($themes) {
background-color: themed("info") !important; background-color: themed("info") !important;
color: themed("infoTextColor") !important; color: themed("textInfoColor") !important;
} }
} }

View File

@@ -224,13 +224,13 @@
.badge-warning { .badge-warning {
@include themify($themes) { @include themify($themes) {
background-color: themed("warning"); background-color: themed("warning");
color: themed("warningTextColor"); color: themed("textWarningColor");
} }
} }
.badge-success { .badge-success {
@include themify($themes) { @include themify($themes) {
background-color: themed("success"); background-color: themed("success");
color: themed("successTextColor"); color: themed("textSuccessColor");
} }
} }

View File

@@ -29,7 +29,7 @@
.card-header { .card-header {
@include themify($themes) { @include themify($themes) {
background-color: themed("headerColor"); background-color: themed("headerColor");
color: themed("headingColor"); color: themed("textHeadingColor");
} }
a:hover { a:hover {

View File

@@ -24,14 +24,14 @@ label:not(.form-check-label):not(.btn),
label.bold { label.bold {
font-weight: 600; font-weight: 600;
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
} }
} }
label.form-check-label, label.form-check-label,
.form-control-file { .form-control-file {
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
} }
} }
@@ -78,6 +78,10 @@ label.form-check-label,
background-color: themed("inputBackgroundColor"); background-color: themed("inputBackgroundColor");
border-color: themed("inputBorderColor"); border-color: themed("inputBorderColor");
color: themed("inputTextColor"); color: themed("inputTextColor");
option {
background-color: themed("backgroundColor");
}
} }
&:disabled, &:disabled,

View File

@@ -108,7 +108,7 @@
display: block; display: block;
font-size: $font-size-lg; font-size: $font-size-lg;
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
} }
} }
} }

View File

@@ -59,7 +59,7 @@ app-org-vault-groupings,
.card-body a { .card-body a {
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
font-weight: themed("linkWeight"); font-weight: themed("linkWeight");
} }

View File

@@ -185,7 +185,7 @@
margin: 0; margin: 0;
padding: 10px 0 15px; padding: 10px 0 15px;
@include themify($themes) { @include themify($themes) {
color: themed("headingColor"); color: themed("textHeadingColor");
} }
} }

View File

@@ -51,7 +51,7 @@
&:before, &:before,
& .toast-close-button { & .toast-close-button {
@include themify($themes) { @include themify($themes) {
color: themed("dangerTextColor") !important; color: themed("textDangerColor") !important;
} }
} }
@@ -69,7 +69,7 @@
&:before, &:before,
& .toast-close-button { & .toast-close-button {
@include themify($themes) { @include themify($themes) {
color: themed("warningTextColor") !important; color: themed("textWarningColor") !important;
} }
} }
@@ -87,7 +87,7 @@
&:before, &:before,
& .toast-close-button { & .toast-close-button {
@include themify($themes) { @include themify($themes) {
color: themed("infoTextColor") !important; color: themed("textInfoColor") !important;
} }
} }
@@ -105,7 +105,7 @@
&:before, &:before,
& .toast-close-button { & .toast-close-button {
@include themify($themes) { @include themify($themes) {
color: themed("successTextColor") !important; color: themed("textSuccessColor") !important;
} }
} }

View File

@@ -10,6 +10,8 @@ $warning: #bf7e16;
$danger: #dd4b39; $danger: #dd4b39;
$white: #ffffff; $white: #ffffff;
// Bootstrap Variable Overrides
$theme-colors: ( $theme-colors: (
"primary-accent": $primary-accent, "primary-accent": $primary-accent,
"secondary-alt": $secondary-alt, "secondary-alt": $secondary-alt,
@@ -74,9 +76,10 @@ $grid-breakpoints: (
xl: 4px, xl: 4px,
); );
$text-color: #333333;
$border-color: $secondary; $border-color: $secondary;
// Font Awesome webfonts path
$fa-font-path: "~font-awesome/fonts"; $fa-font-path: "~font-awesome/fonts";
// MFA Types for logo styling with no dark theme alternative // MFA Types for logo styling with no dark theme alternative
@@ -84,8 +87,13 @@ $fa-font-path: "~font-awesome/fonts";
$mfaTypes: 0, 2, 3, 4, 6; $mfaTypes: 0, 2, 3, 4, 6;
// Theme Variables // Theme Variables
// Light
$lightDangerHover: #c43421; $lightDangerHover: #c43421;
$lightInputColor: #465057;
$lightInputPlaceholderColor: #b6b8b8;
// Dark
$darkPrimary: #6a99f0; $darkPrimary: #6a99f0;
$darkPrimary-alt: #b4ccf9; $darkPrimary-alt: #b4ccf9;
@@ -101,30 +109,18 @@ $darkBlue1: #4c525f;
$darkBlue2: #3c424e; $darkBlue2: #3c424e;
$darkDarkBlue1: #2f343d; $darkDarkBlue1: #2f343d;
$darkDarkBlue2: #1f242e; $darkDarkBlue2: #1f242e;
$lightInputColor: #465057;
$lightInputPlaceholderColor: #b6b8b8;
$darkInputColor: $white; $darkInputColor: $white;
$darkInputPlaceholderColor: $darkGrey1; $darkInputPlaceholderColor: $darkGrey1;
$themes: ( $themes: (
light: ( light: (
logoSuffix: "dark",
primary: $primary, primary: $primary,
primaryAlt: $primary-accent, primaryAlt: $primary-accent,
danger: $danger, danger: $danger,
info: #343a40,
success: $success, success: $success,
warning: $warning, warning: $warning,
info: #343a40, backgroundColor: $white,
textColor: $text-color,
headingColor: #333333,
darkTextColor: #495057,
warningTextColor: $white,
successTextColor: $white,
dangerTextColor: $white,
infoTextColor: $white,
textMuted: #6c757d,
backgroundColor: $body-bg,
badgeDangerBackground: $danger, badgeDangerBackground: $danger,
badgeDangerText: $white, badgeDangerText: $white,
badgeInfoBackground: #555555, badgeInfoBackground: #555555,
@@ -134,15 +130,16 @@ $themes: (
badgePrimaryText: $white, badgePrimaryText: $white,
badgeSecondaryBackground: #ced4da, badgeSecondaryBackground: #ced4da,
badgeSecondaryText: #212529, badgeSecondaryText: #212529,
bgPrimaryColor: $primary,
bgLightColor: #f8f9fa, bgLightColor: #f8f9fa,
bgPrimaryColor: $primary,
borderColor: $border-color, borderColor: $border-color,
borderPrimaryColor: $primary, borderPrimaryColor: $primary,
browserInputIconsFilter: invert(0),
btnDanger: $danger, btnDanger: $danger,
btnDangerHover: $lightDangerHover, btnDangerHover: $lightDangerHover,
btnDangerText: $white, btnDangerText: $white,
btnLinkTextColor: $primary, btnLinkText: $primary,
btnLinkTextColorHover: #104097, btnLinkTextHover: #104097,
btnOutlineDangerBackground: $input-bg, btnOutlineDangerBackground: $input-bg,
btnOutlineDangerBackgroundHover: $danger, btnOutlineDangerBackgroundHover: $danger,
btnOutlineDangerBorder: #ced4da, btnOutlineDangerBorder: #ced4da,
@@ -176,9 +173,8 @@ $themes: (
cdkDraggingBackground: $white, cdkDraggingBackground: $white,
codeColor: #e83e8c, codeColor: #e83e8c,
dropdownBackground: $white, dropdownBackground: $white,
dropdownDangerHover: #c43421,
dropdownHover: rgba(0, 0, 0, 0.06), dropdownHover: rgba(0, 0, 0, 0.06),
dropdownTextColor: $text-color, dropdownTextColor: $body-color,
dropdownTextMuted: #6c757d, dropdownTextMuted: #6c757d,
focus: rgb(23 93 220 / 25%), focus: rgb(23 93 220 / 25%),
footerBackgroundColor: #fbfbfb, footerBackgroundColor: #fbfbfb,
@@ -187,7 +183,7 @@ $themes: (
iconColor: #777777, iconColor: #777777,
iconHover: $body-color, iconHover: $body-color,
imgFilter: invert(0) grayscale(0), imgFilter: invert(0) grayscale(0),
inputBackgroundColor: #fbfbfb, inputBackgroundColor: $input-bg,
inputBorderColor: $border-color, inputBorderColor: $border-color,
inputDisabledBackground: #e0e0e0, inputDisabledBackground: #e0e0e0,
inputDisabledColor: #6c757d, inputDisabledColor: #6c757d,
@@ -198,22 +194,21 @@ $themes: (
linkColor: $primary, linkColor: $primary,
linkColorHover: #104097, linkColorHover: #104097,
linkWeight: 400, linkWeight: 400,
listItemActive: $text-color, listItemActive: $body-color,
listItemBorder: rgba(0, 0, 0, 0.125), listItemBorder: rgba(0, 0, 0, 0.125),
listItemColor: $primary,
listItemColorHover: #104097,
loadingSvg: url("../images/loading.svg"), loadingSvg: url("../images/loading.svg"),
logoSuffix: "dark",
mfaLogoSuffix: ".png",
navActiveBackground: $white, navActiveBackground: $white,
navActiveWeight: 600, navActiveWeight: 600,
navBackground: $primary, navBackground: $primary,
navBackgroundAlt: $secondary-alt, navBackgroundAlt: $secondary-alt,
navOrgBackgroundColor: #fbfbfb, navOrgBackgroundColor: #fbfbfb,
navWeight: 600, navWeight: 600,
pwLetter: $text-color, pwLetter: $body-color,
pwNumber: #007fde, pwNumber: #007fde,
pwSpecial: #c40800, pwSpecial: #c40800,
pwStrengthBackground: #e9ecef, pwStrengthBackground: #e9ecef,
registerHeadingColor: $white,
separator: $secondary, separator: $secondary,
separatorHr: rgb(0, 0, 0, 0.1), separatorHr: rgb(0, 0, 0, 0.1),
tableColorHover: #333333, tableColorHover: #333333,
@@ -221,25 +216,21 @@ $themes: (
tableLinkColorHover: #104097, tableLinkColorHover: #104097,
tableRowHover: rgba(0, 0, 0, 0.03), tableRowHover: rgba(0, 0, 0, 0.03),
tableSeparator: #dee2e6, tableSeparator: #dee2e6,
browserInputIconsFilter: invert(0), textColor: $body-color,
mfaLogoSuffix: ".png", textDangerColor: $white,
textInfoColor: $white,
textHeadingColor: #333333,
textMuted: #6c757d,
textSuccessColor: $white,
textWarningColor: $white,
), ),
dark: ( dark: (
logoSuffix: "white",
primary: $darkPrimary, primary: $darkPrimary,
primaryAlt: $darkPrimary-alt, primaryAlt: $darkPrimary-alt,
danger: $darkDanger, danger: $darkDanger,
info: $darkInfo,
success: $darkSuccess, success: $darkSuccess,
warning: $darkWarning, warning: $darkWarning,
info: $darkInfo,
textColor: $darkGrey1,
headingColor: $white,
darkTextColor: $darkDarkBlue2,
warningTextColor: $darkDarkBlue2,
successTextColor: $darkDarkBlue2,
dangerTextColor: $darkDarkBlue2,
infoTextColor: $darkDarkBlue2,
textMuted: $darkGrey1,
backgroundColor: $darkDarkBlue2, backgroundColor: $darkDarkBlue2,
badgeDangerBackground: $darkDanger, badgeDangerBackground: $darkDanger,
badgeDangerText: $darkDarkBlue2, badgeDangerText: $darkDarkBlue2,
@@ -250,10 +241,11 @@ $themes: (
badgePrimaryText: $darkDarkBlue2, badgePrimaryText: $darkDarkBlue2,
badgeSecondaryBackground: $darkGrey2, badgeSecondaryBackground: $darkGrey2,
badgeSecondaryText: $darkDarkBlue2, badgeSecondaryText: $darkDarkBlue2,
bgPrimaryColor: $darkPrimary,
bgLightColor: $darkDarkBlue2, bgLightColor: $darkDarkBlue2,
bgPrimaryColor: $darkPrimary,
borderColor: $darkBlue1, borderColor: $darkBlue1,
borderPrimaryColor: $darkPrimary, borderPrimaryColor: $darkPrimary,
browserInputIconsFilter: invert(1),
btnDanger: $darkDanger, btnDanger: $darkDanger,
btnDangerHover: $darkDangerHover, btnDangerHover: $darkDangerHover,
btnDangerText: $darkDarkBlue2, btnDangerText: $darkDarkBlue2,
@@ -292,7 +284,6 @@ $themes: (
cdkDraggingBackground: $darkDarkBlue1, cdkDraggingBackground: $darkDarkBlue1,
codeColor: #e83e8c, codeColor: #e83e8c,
dropdownBackground: $darkDarkBlue1, dropdownBackground: $darkDarkBlue1,
dropdownDangerHover: $darkDangerHover,
dropdownHover: rgba(255, 255, 255, 0.03), dropdownHover: rgba(255, 255, 255, 0.03),
dropdownTextColor: $white, dropdownTextColor: $white,
dropdownTextMuted: #bec6cf, dropdownTextMuted: #bec6cf,
@@ -316,9 +307,9 @@ $themes: (
linkWeight: 600, linkWeight: 600,
listItemActive: $darkPrimary, listItemActive: $darkPrimary,
listItemBorder: $darkBlue1, listItemBorder: $darkBlue1,
listItemColor: $white,
listItemColorHover: $white,
loadingSvg: url("../images/loading-white.svg"), loadingSvg: url("../images/loading-white.svg"),
logoSuffix: "white",
mfaLogoSuffix: "-w.png",
navActiveBackground: $darkDarkBlue2, navActiveBackground: $darkDarkBlue2,
navActiveWeight: 600, navActiveWeight: 600,
navBackground: $darkDarkBlue1, navBackground: $darkDarkBlue1,
@@ -329,7 +320,6 @@ $themes: (
pwNumber: #52bdfb, pwNumber: #52bdfb,
pwSpecial: #ff7c70, pwSpecial: #ff7c70,
pwStrengthBackground: $darkBlue2, pwStrengthBackground: $darkBlue2,
registerHeadingColor: $white,
separator: $darkBlue1, separator: $darkBlue1,
separatorHr: $darkBlue1, separatorHr: $darkBlue1,
tableColorHover: $darkGrey1, tableColorHover: $darkGrey1,
@@ -337,8 +327,13 @@ $themes: (
tableLinkColorHover: $white, tableLinkColorHover: $white,
tableRowHover: rgba(255, 255, 255, 0.03), tableRowHover: rgba(255, 255, 255, 0.03),
tableSeparator: $darkBlue1, tableSeparator: $darkBlue1,
browserInputIconsFilter: invert(1), textColor: $darkGrey1,
mfaLogoSuffix: "-w.png", textDangerColor: $darkDarkBlue2,
textHeadingColor: $white,
textInfoColor: $darkDarkBlue2,
textMuted: $darkGrey1,
textSuccessColor: $darkDarkBlue2,
textWarningColor: $darkDarkBlue2,
), ),
); );