Skip to content

Commit

Permalink
Merge pull request #1175 from prymitive/fix-scss-imports
Browse files Browse the repository at this point in the history
fix(ui): avoid duplicating bootstrap styles
  • Loading branch information
prymitive authored Nov 21, 2019
2 parents a86a501 + aab5b29 commit f9ac056
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 45 deletions.
34 changes: 1 addition & 33 deletions ui/src/App.scss
Original file line number Diff line number Diff line change
@@ -1,40 +1,8 @@
// bundled font assets, so we don't need to talk to Google Fonts API
@import "src/Fonts.scss";

$lead-font-weight: 400;
@import "Theme.scss";

// custom "dark" color, little less dark than flatly
$blue: #455a64;
// body background color should be same as navbar, so it blends into one
$body-bg: $blue;
// default is ~0.97rem
$font-size-base: 1rem;

// make links light gray by default instead of green
$link-color: #7b8a8b; // $gray-700

// make dark darker, default it's $gray-700
$dark: #3b4247;

// fix active tab color, for some reason it ends up with $primary as bg color
$nav-tabs-link-active-bg: #fff;

// pagination tweaks
$pagination-color: #fff;
$pagination-bg: #b4bcc2; // gray-500
$pagination-hover-color: #fff;
$pagination-hover-bg: #7b8a8b; // gray-700
$pagination-active-bg: $pagination-hover-bg;
$pagination-disabled-color: #fff;
$pagination-disabled-bg: #dee2e6; // gray-300

$enable-shadows: true;

$btn-box-shadow: 0;
$btn-focus-box-shadow: 0;
$btn-active-box-shadow: 0;

@import "~bootswatch/dist/flatly/variables";
@import "~bootstrap/scss/bootstrap";
@import "~bootswatch/dist/flatly/bootswatch";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.components-grid-alertgrid-alertgroup-alert {
&:hover {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/Labels/BaseLabel/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.components-label-with-hover:hover {
filter: brightness(0.85);
Expand Down
4 changes: 2 additions & 2 deletions ui/src/Components/Labels/FilterInputLabel/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.components-filteredinputlabel-text {
font-size: 1rem;
Expand Down Expand Up @@ -62,7 +62,7 @@ button.components-label.btn {
background-color: $light;
}
&.btn-dark:hover {
// same as in App.scss
// same as in Theme.scss
background-color: #3b4247;
}
}
2 changes: 1 addition & 1 deletion ui/src/Components/Labels/LabelWithPercent/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.components-labelWithPercent-percent {
padding-top: 0.25rem;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/MainModal/Configuration/InputRange.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// customize colors and fonts using bootstrap variables
@import "src/App.scss";
@import "src/Theme.scss";

$input-range-font-family: $font-family-sans-serif;
$input-range-primary-color: $primary;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/ManagedSilence/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.components-managed-silence {
.card,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/Modal/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.components-tab-inactive {
&:hover {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/NavBar/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.navbar-brand {
min-width: 2.5rem;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/OverviewModal/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

.navbar-brand {
&:hover,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Components/SilenceModal/DateTimeSelect/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

$datepicker__background-color: $white;
$datepicker__border-color: $gray-300;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/DarkTheme.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "src/App.scss";
@import "src/Theme.scss";

$alertgroup-body-bg: #5a6e7b;
$alertgroup-header-bg: #515658;
Expand Down
37 changes: 37 additions & 0 deletions ui/src/Theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$lead-font-weight: 400;

// custom "dark" color, little less dark than flatly
$blue: #455a64;
// body background color should be same as navbar, so it blends into one
$body-bg: $blue;
// default is ~0.97rem
$font-size-base: 1rem;

// make links light gray by default instead of green
$link-color: #7b8a8b; // $gray-700

// make dark darker, default it's $gray-700
$dark: #3b4247;

// fix active tab color, for some reason it ends up with $primary as bg color
$nav-tabs-link-active-bg: #fff;

// pagination tweaks
$pagination-color: #fff;
$pagination-bg: #b4bcc2; // gray-500
$pagination-hover-color: #fff;
$pagination-hover-bg: #7b8a8b; // gray-700
$pagination-active-bg: $pagination-hover-bg;
$pagination-disabled-color: #fff;
$pagination-disabled-bg: #dee2e6; // gray-300

$enable-shadows: true;

$btn-box-shadow: 0;
$btn-focus-box-shadow: 0;
$btn-active-box-shadow: 0;

@import "~bootswatch/dist/flatly/variables";
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";

0 comments on commit f9ac056

Please sign in to comment.