Skip to content

Commit

Permalink
fix(buttons): updated colors (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian-R authored Nov 12, 2021
1 parent 2bcabf1 commit ceee560
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 33 deletions.
64 changes: 37 additions & 27 deletions src/components/buttons/_button-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ $vanilla-button-padding--large: vanilla-px-to-em(24) !default;
$_height: vanilla-px-to-em(44 - 2);
$_border-radius: $vanilla-component-border-radius;

$_button_color-bg-normal: $vanilla-color-component-normal;
$_button_color-bg-hover: $vanilla-color-component-hover;
$_button_color-bg-pressed: $vanilla-color-component-pressed;
$_button_color-bg-normal: $vanilla-color-darkblue2;
$_button_color-bg-hover: $vanilla-color-darkblue1;
$_button_color-bg-pressed: $vanilla-color-darkblue1;
$_button_color-bg-focus: $vanilla-color-component-selected;
$_button_disabled-color-dark: $vanilla-color-component-disabled-dark;
$_button_disabled-color-light: $vanilla-color-component-disabled-light;
$_button_disabled-color: $vanilla-color-component-disabled-darker;
$_button_disabled-bg-color: $vanilla-color-grey200;
$_ghost-button_disabled-opacity: 0.5;
//

Expand Down Expand Up @@ -85,8 +85,9 @@ $_ghost-button_disabled-opacity: 0.5;
}

&[disabled] {
background-color: $_button_disabled-color-dark;
border-color: $_button_disabled-color-dark;
color: $_button_disabled-color;
background-color: $_button_disabled-bg-color;
border-color: $_button_disabled-bg-color;
cursor: default;
}

Expand Down Expand Up @@ -126,24 +127,28 @@ $_ghost-button_disabled-opacity: 0.5;
/// @access public
@mixin vanilla-button-secondary {
background-color: transparent;
border-color: $vanilla-color-darkblue1;
border-color: $_button_color-bg-normal;

&,
&:visited,
&:link {
color: $_button_color-bg-normal;
}

&:focus,
&:hover,
&:active {
&:focus {
background: transparent;
}

&:active,
&:hover {
color: $vanilla-color-white;
background-color: $_button_color-bg-hover;
}

&[disabled] {
background-color: $_button_disabled-color-light;
border-color: $_button_disabled-color-dark;
color: $_button_disabled-color-dark;
color: $_button_disabled-color;
background-color: transparent;
border-color: $_button_disabled-color;
}
}

Expand All @@ -160,16 +165,21 @@ $_ghost-button_disabled-opacity: 0.5;
color: $_button_color-bg-normal;
}

&:focus,
&:hover,
&:active {
&:focus {
background: transparent;
border: transparent;
}

&:active,
&:hover {
background-color: $_button_color-bg-hover;
color: $vanilla-color-white;
}

&[disabled] {
background-color: $_button_disabled-color-light;
border-color: $_button_disabled-color-dark;
color: $_button_disabled-color-dark;
color: $_button_disabled-color;
background-color: transparent;
border-color: transparent;
}
}

Expand Down Expand Up @@ -235,8 +245,8 @@ $_ghost-button_disabled-opacity: 0.5;

&[disabled] {
background-color: transparent;
border-color: rgba($vanilla-color-grey2, $_ghost-button_disabled-opacity);
color: rgba($vanilla-color-grey2, $_ghost-button_disabled-opacity);
border-color: $_button_disabled-color;
color: $_button_disabled-color;
}
}

Expand Down Expand Up @@ -277,7 +287,7 @@ $_ghost-button_disabled-opacity: 0.5;
&[disabled] {
background-color: transparent;
border-color: transparent;
color: rgba($vanilla-color-grey2, $_ghost-button_disabled-opacity);
color: $_button_disabled-color;
}
}

Expand All @@ -301,8 +311,8 @@ $_ghost-button_disabled-opacity: 0.5;
}

&[disabled] {
background-color: $_button_disabled-color-dark;
border-color: $_button_disabled-color-dark;
background-color: $_button_disabled-bg-color;
border-color: $_button_disabled-bg-color;
}
}

Expand All @@ -326,8 +336,8 @@ $_ghost-button_disabled-opacity: 0.5;
}

&[disabled] {
background-color: $_button_disabled-color-dark;
border-color: $_button_disabled-color-dark;
background-color: $_button_disabled-bg-color;
border-color: $_button_disabled-bg-color;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/buttons/ghost-dark.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ This will create <i>.my-button-class</i> as well as <i>.my-button-class-ghost</i
## Base state

```html
<div class="pl-yellow-bg">
<div class="pl-grey-bg">
<button class="sdv-button sdv-button-ghost-dark">Primary button</button>
</div>
```

## With icon

```html
<div class="pl-yellow-bg">
<div class="pl-grey-bg">
<button class="sdv-button sdv-button-ghost-dark">
<i class="far fa-lock sdv-icon-left"></i>Primary button
</button>
Expand All @@ -56,7 +56,7 @@ This will create <i>.my-button-class</i> as well as <i>.my-button-class-ghost</i
## Disabled state

```html
<div class="pl-yellow-bg">
<div class="pl-grey-bg">
<button class="sdv-button sdv-button-ghost-dark" disabled>
Primary button
</button>
Expand Down
6 changes: 3 additions & 3 deletions src/components/buttons/ghost-light.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ This will create <i>.my-button-class</i> as well as <i>.my-button-class-ghost</i
## Base state

```html
<div class="pl-purple-bg">
<div class="pl-dark-bg">
<button class="sdv-button sdv-button-ghost-light">Ghost button</button>
</div>
```

## With icon

```html
<div class="pl-purple-bg">
<div class="pl-dark-bg">
<button class="sdv-button sdv-button-ghost-light">
<i class="far fa-lock sdv-icon-left"></i>Ghost button
</button>
Expand All @@ -56,7 +56,7 @@ This will create <i>.my-button-class</i> as well as <i>.my-button-class-ghost</i
## Disabled state

```html
<div class="pl-blue-bg">
<div class="pl-dark-bg">
<button class="sdv-button sdv-button-ghost-light" disabled>
Ghost button
</button>
Expand Down
14 changes: 14 additions & 0 deletions src/preview-frame-only.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ $vanilla-font-awesome-inc-path: 'https://designlibrary.sebgroup.com/static/Fonts
min-height: 400px;
}

.pl-grey-bg {
background-color: $vanilla-color-bg-grey;
padding: 2rem;
width: 100%;
text-align: center;
}

.pl-dark-bg {
background-color: $vanilla-color-black;
padding: 2rem;
width: 100%;
text-align: center;
}

.pl-purple-bg {
background-color: $vanilla-color-purple;
padding: 2rem;
Expand Down

0 comments on commit ceee560

Please sign in to comment.