Skip to content

Commit

Permalink
Merge pull request #265 from SnowdogApps/feature/global-var-update
Browse files Browse the repository at this point in the history
update global variables, focus, fonts
  • Loading branch information
anqaka authored May 8, 2020
2 parents ae37915 + 0ff90e9 commit 06b7849
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 66 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- update global variables, color, focus

## [0.5.0] - 15-10-2019
### Added
Expand Down
4 changes: 4 additions & 0 deletions assets/styles/_focus-visible.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
.js-focus-visible :focus:not([data-focus-visible-added]) {
outline: none;
}

.js-focus-visible .focus-visible {
@include focus();
}
1 change: 1 addition & 0 deletions assets/styles/_globals.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import 'variables';
@import 'mixins/mq';
@import 'mixins/focus';
@import 'mixins/visually-hidden';
6 changes: 6 additions & 0 deletions assets/styles/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ body {
font-weight: $font-weight-base;
font-size: $font-size-base;
font-family: $font-family-base;
line-height: $font-line-height;
scroll-behavior: smooth;
}

body {
Expand All @@ -38,3 +40,7 @@ dt,
dd {
margin: 0;
}

form {
margin: 0;
}
181 changes: 117 additions & 64 deletions assets/styles/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,87 +1,140 @@
// Colors
$white: #fff !default;
$black: #000 !default;
$red: #e32926 !default;
$orange: #fab216 !default;
$yellow: #ffd500 !default;
$green: #31e37d !default;
$blue: #2962ff !default;
$teal: #5bc0de !default;
$pink: #ff5b77 !default;
$purple: #613d7c !default;
$white : #fff !default;
$black : #000 !default;
$red : #e62325 !default;
$orange : #fab216 !default;
$yellow : #ffd500 !default;
$green : #31e37d !default;
$blue : #0075e4 !default;
$bright-sky-blue : #00b8ff !default;
$teal : #0194ab !default;
$pink : #ff5b77 !default;
$seafoam-blue : #77ccb9 !default;

// Grayscale colors
$gray-darkest: #333 !default;
$gray-darker: #393243 !default;
$gray-dark: #4c4555 !default;
$gray: #73739c !default;
$gray-light: #c2c1df !default;
$gray-lighter: #c9c9c9 !default;
$gray-lightest: #f6f6fa !default;
$gray-darkest : #1a1b1d !default;
$gray-darker : #393243 !default;
$gray-dark : #6e7577 !default;
$gray : #d8d8d8 !default;
$gray-light : #eaeaea !default;
$gray-lighter : #fbfbfb !default;
$gray-lightest : #f7f7f9 !default;

// Semantic color scheme
$color-primary: $green !default;
$color-secondary: $gray-darker !default;
$color-success: $green !default;
$color-info: $teal !default;
$color-warning: $orange !default;
$color-danger: $red !default;
$color-inverted: $gray-darker !default;
$color-primary : $gray-darkest !default;
$color-secondary : $gray-dark !default;
$color-success : $green !default;
$color-info : $blue !default;
$color-warning : $red !default;
$color-danger : $red !default;
$color-inverse : $gray-dark !default;
$color-focus : $bright-sky-blue !default;

// Background
$bg-color-base: $white !default;
$bg-color-dark: $black !default;
$bg-color-base : $white !default;
$bg-color-secondary : $gray-lighter !default;
$bg-color-dark : $gray-darkest !default;

// Border
$border-color-base: $gray-darker !default;
$border-width-base: 1px !default;
$border-style-base: solid !default;
$border-color-base : $gray !default;
$border-width-base : 1px !default;
$border-style-base : solid !default;
$border-color-secondary : $gray-dark !default;
$border-width-secondary : 1px !default;
$border-style-secondary : solid !default;
$border-radius : 0 !default;

$border-base: $border-width-base $border-style-base $border-color-base !default;
$border-base : $border-width-base $border-style-base $border-color-base !default;
$border-secondary : $border-width-secondary $border-style-secondary $border-color-secondary !default;

// Outline
$outline-base: none !default;
$outline-base : none !default;

// Focus
$border-focus : 2px solid $color-focus !default;
$border-focus-dark : 2px solid $color-primary !default;

// Focus inline
$color-focus-inline : $color-primary !default;
$color-focus-inline-dark : $color-primary !default;
$bg-focus-inline : $color-focus !default;
$bg-focus-inline-dark : $color-primary !default;
$outline-focus-inline : 0 !default;
$text-decoration-focus-inline: underline !default;
$focus-outline-offset : -1px !default;
$focus-input-border : $border-focus-dark;

// Spacers
$spacer: 8px !default;
$spacer--medium: 16px !default;
$spacer--large: 32px !default;
$spacer--extra-large: 48px !default;
$spacer--extra-small : 4px !default;
$spacer : 8px !default;
$spacer--small : 12px !default;
$spacer--medium : 16px !default;
$spacer--semi-medium : 24px !default;
$spacer--large : 32px !default;
$spacer--semi-large : 40px !default;
$spacer--extra-large : 48px !default;

// Typography
$font-family-sans-serif: 'Montserrat', sans-serif !default;
$font-family-monospace: Menlo, Monaco, Consolas, 'Liberation Mono',
'Courier New', monospace !default;
$font-family-sans-serif : 'Work Sans', sans-serif !default;
$font-family-serif : 'Playfair Display', serif !default;
$font-family-monospace : Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace !default;

$font-family-base: $font-family-sans-serif !default;
$font-family-base : $font-family-sans-serif !default;
$font-family-secondary : $font-family-serif !default;

$font-color-base: $gray-darkest !default;
$font-weight-normal: normal !default;
$font-weight-bold: bold !default;
$font-weight-base: $font-weight-normal !default;
$font-line-height: 1.5 !default;
$font-color-base : $color-primary !default;
$font-weight-normal : 400 !default;
$font-weight-medium : 500 !default;
$font-weight-bold : 700 !default;
$font-weight-base : $font-weight-normal !default;
$font-line-height : 1.6 !default;

$font-size-extra-large: 22px !default;
$font-size-large: 18px !default;
$font-size-base: 14px !default;
$font-size-small: 12px !default;
$font-size-extra-small: 10px !default;
$font-size-super-extra-large : 32px !default;
$font-size-extra-large : 24px !default;
$font-size-large : 18px !default;
$font-size-medium : 16px !default;
$font-size-base : 14px !default;
$font-size-small : 12px !default;
$font-size-extra-small : 10px !default;

// Z-index
$z-index-lowest : -1 !default;
$z-index-initial : auto !default;
$z-index-low : 1 !default;
$z-index-normal : 10 !default;
$z-index-high : 50 !default;
$z-index-highest : 99 !default; // reserved for modals - check _modal-variables.scss for more

// Layout
$max-content-width: 1328px !default;
$max-content-width : 1328px !default;

// Layout - breakpoints
$screen-xs: 320px !default;
$screen-s: 480px !default;
$screen-m: 768px !default;
$screen-l: 992px !default;
$screen-xl: 1200px !default;
$screen-xxl: 1600px !default;

// Components
$border-radius: 4px !default;
$form-elements-radius: 32px !default;
$form-elements-radius--small: 10px !default;
$form-elements-border-color: $gray-light !default;
$transition-base: all 0.3s ease-in-out !default;
$transition-fade: opacity 0.25s linear !default;
$screen-xs : 320px !default;
$screen-s : 480px !default;
$screen-m : 768px !default;
$screen-l : 1024px !default;
$screen-xl : 1200px !default;
$screen-xxl : 1600px !default;

// shadow
$shadow : 0 2px 6px 0 rgba(0, 0, 0, 0.1) !default;
$darken-layout-hover : rgba($black, 0.2) !default;

// animations
$animation-position-top : -300px !default;
$animation-position-right : -300px !default;
$animation-position-left : -300px !default;

// form elements
$form-elements-radius : 0 !default;
$form-elements-radius--small : 0 !default;
$form-elements-border-color : $border-color-secondary !default;
$form-element-border-width : 1px !default;
$form-element-border-style : solid !default;
$form-elements-border : $form-element-border-width $form-element-border-style $form-elements-border-color !default;
$form-elements-border-focus : 2px solid $color-primary !default;
$form-input-box-shadow-focus : none !default;

// Transition
$transition-base : all 0.3s ease-in-out !default;
$transition-fade : opacity 0.25s linear !default;
33 changes: 33 additions & 0 deletions assets/styles/mixins/_focus.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@mixin focus($mode: '') {
outline-offset: $focus-outline-offset;

@if $mode == 'dark' {
outline: $border-focus-dark;
}

@else {
outline: $border-focus;
}
}

@mixin focus-inline($mode: '') {
text-decoration: $text-decoration-focus-inline;
outline: $outline-focus-inline;

@if $mode == 'dark' {
color: $color-focus-inline-dark;
background-color: $bg-focus-inline-dark;
}

@else {
color: $color-focus-inline;
background-color: $bg-focus-inline;
}
}

@mixin focus-input() {
outline: $form-elements-border-focus;
outline-offset: -1px;
box-shadow: $form-input-box-shadow-focus;
transition: $transition-base;
}
2 changes: 1 addition & 1 deletion src/atoms/link/Link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $link__color-hover : $color-secondary !default;
$link__line-height : $font-line-height !default;
$link__text-decoration : none !default;
$link__transition : $transition-base !default;
$link__color--inverted : $color-inverted !default;
$link__color--inverted : $color-inverse !default;
$link__color-hover--inverted : $blue !default;
$link__color--secondary : $gray-lighter !default;
$link__color-hover--secondary: $color-primary !default;
Expand Down
2 changes: 1 addition & 1 deletion src/templates/app/App.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Not the prettiest way, but I need it to work now */
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700,900&subset=latin-ext');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display&family=Work+Sans:wght@400;500;700&display=swap');
@import '../../../assets/styles/_globals.scss';
@import '../../../assets/styles/_reset.scss';
@import '../../../assets/styles/_focus-visible.scss';
Expand Down

1 comment on commit 06b7849

@vercel
Copy link

@vercel vercel bot commented on 06b7849 May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.