Skip to content

Commit

Permalink
fix(overrides): Re-adding overrides and additions
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltruong committed Jun 14, 2024
1 parent d210db5 commit 1393e28
Show file tree
Hide file tree
Showing 6 changed files with 1,910 additions and 1,625 deletions.
3,187 changes: 1,605 additions & 1,582 deletions index.html

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions scss/_additions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
//---------------------------------------------------------------------------------------
// Additions are for extra classes not found in the normal Bootstrap
// WARNING: Do not create alot of new things here, remember always try to tweak and variable
// or override bootstrap css before trying to create something new.
//---------------------------------------------------------------------------------------
// sass-lint:disable force-element-nesting, force-pseudo-nesting

// The label element is no longer bolded by default, neither is this class defined
.control-label {
font-weight: 700;
}

// Remove background and left padding on page breadcrumbs
.breadcrumb.page-breadcrumb {
background: transparent;
margin-bottom: 10px;
margin-top: -5px;
padding-left: 0;
}

// Option to keep footer at the bottom of the page
@each $breakpoint in map-keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);

@include media-breakpoint-up($breakpoint) {

// Set on html element to keep footer at bottom of window short pages
.fill-height#{$infix} {
height: 100%;

body,
.fill-body {
display: flex;
flex-flow: column nowrap;
min-height: 100%;
}

// Apply to extra container element(s) around the main
.fill-body {
flex: auto;
}

header,
.header,
footer,
.footer {
flex: none;
}

main,
.main {
flex: auto;
overflow: auto;
}
}
}
}

$info-alert-border-level: -4;

// Request a theme color level
@function panel-border-level($color-name: "primary") {
@if ($color-name =='info' or $color-name =='warning') {
@return $info-alert-border-level;
}

@return $alert-border-level;
}

// Add panel-success, panel-info etc. equivalents (like bootstrap v3)
@each $color, $value in (primary, secondary, success, info, warning, danger) {
.card-#{$color} {
border-color: theme-color-level($color, panel-border-level($color));

>.card-header {
@include gradient-bg(theme-color-level($color, $alert-bg-scale));
border-color: theme-color-level($color, panel-border-level($color));
color: theme-color-level($color, $alert-color-scale);
}

>.card-footer {
border-color: theme-color-level($color, panel-border-level($color));
}
}
}
41 changes: 22 additions & 19 deletions scss/_fonts.scss
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
@font-face {
src: url("#{$bcgov-font-path}/bc-sans/BCSans-Regular.woff2") format('woff2'),
src: url("#{$bcgov-font-path}/bc-sans/BCSans-Regular.woff2") format('woff2'),
url("#{$bcgov-font-path}/bc-sans/BCSans-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
font-family: "BCSans";
font-weight: normal;
font-style: normal;
font-family: "BCSans";
}

@font-face {
src: url("#{$bcgov-font-path}/bc-sans/BCSans-BoldItalic.woff2") format("woff2"),
url("#{$bcgov-font-path}/bc-sans/BCSans-BoldItalic.woff") format("woff");
font-weight: 700;
font-style: italic;
font-family: "BCSans";
src: url("#{$bcgov-font-path}/bc-sans/BCSans-Bold.woff2") format("woff2"),
url("#{$bcgov-font-path}/bc-sans/BCSans-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-family: "BCSans";
}

@font-face {
src: url("#{$bcgov-font-path}/bc-sans/BCSans-Italic.woff2") format("woff2"),
src: url("#{$bcgov-font-path}/bc-sans/BCSans-Italic.woff2") format("woff2"),
url("#{$bcgov-font-path}/bc-sans/BCSans-Italic.woff") format("woff");
font-weight: 400;
font-style: italic;
font-family: "BCSans";
font-weight: normal;
font-style: italic;
font-family: "BCSans";
}

@font-face {
src: url("#{$bcgov-font-path}/bc-sans/BCSans-Bold.woff2") format("woff2"),
url("#{$bcgov-font-path}/bc-sans/BCSans-Bold.woff") format("woff");
font-weight: 700;
font-style: normal;
font-family: "BCSans";
}
src: url("#{$bcgov-font-path}/bc-sans/BCSans-BoldItalic.woff2") format("woff2"),
url("#{$bcgov-font-path}/bc-sans/BCSans-BoldItalic.woff") format("woff");
font-weight: bold;
font-style: italic;
font-family: "BCSans";
}
115 changes: 115 additions & 0 deletions scss/_overrides.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
//---------------------------------------------------------------------------------------
// Overrides Bootstrap classes are change here, consider changing a variable before
// overriding classes.
//---------------------------------------------------------------------------------------
// Reference: http://www2.gov.bc.ca/gov/content/governments/services-for-government/policies-procedures/web-content-development-guides/developers-guide/css-elements
// sass-lint:disable force-element-nesting, force-pseudo-nesting

.nav-link,
.navbar-brand,
.page-link,
a.btn {
text-decoration: none;
}

// Highlight focused links
a:not(.btn):focus {
color: $link-hover-color;
}

.nav-tabs .nav-link:not(.active) {

&:hover,
&:focus {
background-color: $control-link-bg;
border-color: $control-link-border-color;
color: $control-link-color;
}
}

// Add focus ring to btn-link, highlight as regular link
.btn.btn-link {
text-decoration: underline;

&:focus,
&.focus {
box-shadow: 0 0 0 $btn-focus-width $btn-link-outline-color;
color: $link-hover-color;
}
}

.list-group .list-group-item-action {

&:hover,
&:focus {
text-decoration: underline;
}
}

// Header, adds the gold bottom border and shadow
header nav {
background-color: $primary-nav;
border-bottom: 2px solid $bcgold;

&.shadow {
box-shadow: 0 3px 3px 1px $header-box-shadow-color;
}
}

// Add spacing around content (use p-* to override)
main {
padding-bottom: 40px;
padding-top: 20px;
}

// Underline navbar links when active
.navbar-nav .nav-link {

&:hover,
&:focus {
text-decoration: underline;
}
}

// Set footer background, add gold border above
footer nav {
background-color: $primary-nav;
border-top: 2px solid $bcgold;
}

// Only sibling list items in footer get left border
@each $breakpoint in map-keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);

footer .navbar-expand#{$infix} .nav-item+.nav-item {
@include media-breakpoint-up($breakpoint) {
border-left: 1px solid $footer-separator-color;
}
}
}

// Stronger border colour
.alert.alert-info {
border-color: theme-color-level(info, -4);
}

.alert.alert-warning {
border-color: theme-color-level(warning, -4);
}

.btn-success,
.btn-success:hover,
.btn-success:active,
.btn-success:visited {
color: white;
}

.btn-danger,
.btn-danger:hover,
.btn-danger:active,
.btn-danger:visited {
color: white;
}

$component-active-bg: $primary;
$nav-pills-link-active-color: white;
97 changes: 76 additions & 21 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//---------------------------------------------------------------------------------------
// Reference: http://www2.gov.bc.ca/gov/content/governments/services-for-government/policies-procedures/web-content-development-guides/developers-guide/css-elements

// Change theme-colors
$blue: #005C98;
$primary: #013366;
$secondary: #3470B1;
Expand All @@ -15,10 +14,32 @@ $info: #D8EAFD;
$dark: #252423;
$light: #FFFFFF;

$primary-nav: #013366;
$secondary-nav: #3470B1;
$bcgold: #F8BA47;
$form-grey: #FAF9F8;

// Change theme-colors
$theme-colors: (
blue: $blue,
primary: $primary,
secondary: $secondary,
success: $success,
danger: $danger,
warning: $warning,
info: $info,
dark: $dark,
light: $light,
);
$custom-colors: (
primary-nav: $primary,
secondary-nav: $secondary,
bcgold: $bcgold,
form-grey: $form-grey,
);

$theme-colors: map-merge($theme-colors, $custom-colors);

$gray-100: #FAF9F8;
$gray-200: #F3F2F1;
$gray-300: #ECEAE8;
Expand Down Expand Up @@ -54,25 +75,59 @@ $nav-tabs-link-active-color: #2D2D2D;
$nav-link-disabled-color: #9F9D9C;
$breadcrumb-active-color: $secondary;
$custom-control-label-disabled-color: #9F9D9C;
$font-family-sans-serif: BCSans, "Noto Sans", Verdana, Arial, sans serif;

$theme-colors: (
blue: $blue,
primary: $primary,
secondary: $secondary,
success: $success,
danger: $danger,
warning: $warning,
info: $info,
dark: $dark,
light: $light,
);
$custom-colors: (
primary-nav: $primary,
secondary-nav: $secondary,
bcgold: $bcgold,
form-grey: $form-grey,
);
// Add our font as default
$bcgov-font-path: "../fonts" !default;
$font-family-sans-serif: BCSans, "Noto Sans", Verdana, Arial, sans serif !default;
$font-family-base: $font-family-sans-serif !default;

$theme-colors: map-merge($theme-colors, $custom-colors);
$bcgov-font-path: "../fonts" !default;
// Headings
$headings-font-weight: 700 !default;
$headings-line-height: 1.1 !default;
$headings-margin-bottom: 1.25rem !default;
$h1-font-size: 2.074rem !default;
$h2-font-size: 1.54912rem !default;
$h3-font-size: 1.33882rem !default;
$h4-font-size: 1rem !default;
$h5-font-size: 0.86425rem !default;
$h6-font-size: 0.80345rem !default;

// Links
$link-decoration: underline !default;
$link-hover-color: #0631f3 !default;
$btn-link-outline-color: rgba($primary, 0.5) !default;

// Navbar - header and footer
$header-box-shadow-color: rgba(51, 51, 51, 0.5) !default;
$nav-link-padding-x: 0.8rem !default;
$nav-link-padding-y: 0.4rem !default;
$navbar-nav-link-padding-x: 0.8rem !default;
$navbar-nav-link-padding-y: 0.4rem !default;
$navbar-dark-color: #fff !default;
$navbar-dark-toggler-border-color: rgba(255, 255, 255, 0.6) !default;
$footer-separator-color: #4b5e73 !default;

// Darker borders
$alpha-border-color: rgba(black, 0.3) !default;
$alert-border-level: -7 !default;
$card-border-color: $alpha-border-color !default;
$hr-border-color: $alpha-border-color !default;
$border-color: $gray-400 !default;
$input-border-color: $gray-500 !default;
$list-group-border-color: $alpha-border-color !default;
$nav-tabs-border-color: $gray-500 !default;
$nav-tabs-link-active-border-color: $gray-500 $gray-500 white !default;
$pagination-border-color: $gray-500 !default;
$pagination-disabled-border-color: $gray-400 !default;

// Clearer hover states
$control-link-color: white !default;
$control-link-bg: lighten($secondary-nav, 10%) !default; // custom var
$control-link-border-color: lighten($secondary-nav, 8%) !default; // custom var
$pagination-hover-color: $control-link-color;
$pagination-hover-bg: $control-link-bg !default;
$pagination-hover-border-color: $control-link-border-color !default;
$list-group-active-bg: $control-link-bg !default;
$list-group-active-border-color: $control-link-border-color !default;
$list-group-action-hover-color: $link-hover-color;
$nav-tabs-link-hover-border-color: $control-link-color $control-link-color $nav-tabs-border-color !default;
10 changes: 7 additions & 3 deletions scss/bootstrap-theme.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
@import "bootstrap/scss/functions";

@import "variables";

// Now bring in the rest of bootstrap!
@import "bootstrap/scss/bootstrap";

// Overrides of bootstrap classes
@import "overrides";

// Import the additions to bootstrap base
@import "additions";

// Import the font(s)
@import "fonts";
@import "fonts";

0 comments on commit 1393e28

Please sign in to comment.