Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WDTK] Improved visual elements for button classes #1918

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 61 additions & 20 deletions app/assets/stylesheets/responsive/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@


/* Buttons */
@mixin focus-state {
&:focus,
&:visited:focus {
background-color: $color_yellow;
color: $color_black;
}
}

@mixin button-base {
padding: 0.5em 1.25em;
border-radius: 3px;
Expand All @@ -33,44 +41,52 @@
@include button-base;
color: $color_white;
background-color: $button-bg;
border: none;
border: 1.5px solid $button-bg;
&:hover,
&:active,
&:focus,
&:visited:hover,
&:visited:active,
&:visited:focus {
background-color: darken($button-bg, 10%);
color: $color_white;
&:visited:active {
background: linear-gradient(-180deg, lighten($button-bg, 40%) 0%, lighten($button-bg, 42%) 100%);
color: $button-bg;
}

@include focus-state;
}


@mixin button-secondary {
@include button-base;
background-color: mix($color_light_grey, $color_yellow, 95%);
color: $color_black;
font-weight: normal;
border: 1.5px solid lighten($color_black, 10%);
&:hover,
&:active,
&:focus {
color: $color_black;
background-color: darken($color_light_grey, 7.5%);
color: $color_black;
&:active {
background-color: $color_black;
color: $color_white;
border: 1.5px solid $color_white;
}

@include focus-state;
}

@mixin button-tertiary {
@include button-base;
background-color: transparent;
color: $color_black;
color: $link-color;
font-weight: normal;
border: 1px solid $color_light_grey;
border: 1.5px solid $link-color;
&:hover,
&:active,
&:focus {
background-color: darken($color_light_grey, 7.5%);
border: 1px solid darken($color_light_grey, 12.5%);
&:visited:hover,
&:visited:active {
color: $color_white;
// We are darkening the background and border for cases there is a defaul button and a tertiary button together. In this case when we are hovering over the tertiary one it won't look just like the default button nect to it.
background-color: darken($link-color, 15%);
border: 1.5px solid darken($link-color, 15%);
}

@include focus-state;
}

@mixin button-disabled {
Expand All @@ -83,22 +99,47 @@
}

@mixin button-pro {
background-image: linear-gradient(-180deg, #4C858D 0%, #3E6D75 100%);
background: linear-gradient(-180deg, #4C858D 0%, #3E6D75 100%);
border: 1.5px solid #3E6D75;
box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.22);
&:hover,
&:active,
&:focus,
&:visited:hover,
&:visited:active,
&:visited:focus {
&:visited:active {
box-shadow: 0 1px 0 0 rgba(0,0,0,0.22);
color: #3E6D75;
background: linear-gradient(-180deg, #d8edf0 0%, #bfe0e6 100%);
}

@include focus-state;

&:disabled {
@include button-disabled;
}
}

@mixin button-pro-tertiary {
background: $color-white;
color: #3E6D75;
border: 1.5px solid #3E6D75;
box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.22);
&:hover,
&:active,
&:visited:hover,
&:visited:active {
background: linear-gradient(-180deg, #1a4146 0%, #153a40 100%);
color: $color-white;
box-shadow: 0 1px 0 0 rgba(0,0,0,0.22);
}

@include focus-state;

&:disabled {
@include button-disabled;
}
}


/* Menu items */
@mixin menu-item {
text-decoration: none;
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/responsive/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ a.button-secondary,

.button-tertiary {
@include button-tertiary;
.alaveteli-pro & {
@include button-pro-tertiary;
}
}

.button-disabled {
Expand Down
Loading