|
7 | 7 |
|
8 | 8 |
|
9 | 9 | /* Buttons */
|
| 10 | +@mixin focus-state { |
| 11 | + &:focus, |
| 12 | + &:visited:focus { |
| 13 | + // It overrides any specificity like the Pro buttons |
| 14 | + background: $color_yellow !important; |
| 15 | + color: $color_black !important; |
| 16 | + |
| 17 | + outline: 3px solid $color_off_white; // Most of the time this won't be visible, but it will be helpful when the button is in a dark background. |
| 18 | + outline-offset: 0; |
| 19 | + box-shadow: inset 0px 0px 0px 2px $color_black !important; // It overrides any specificity like the Pro buttons |
| 20 | + } |
| 21 | +} |
| 22 | + |
10 | 23 | @mixin button-base {
|
11 | 24 | padding: 0.5em 1.25em;
|
12 | 25 | border-radius: 3px;
|
13 | 26 | display: inline-block;
|
14 | 27 | font-weight: 600;
|
15 | 28 | text-decoration: none;
|
16 |
| - transition: background-color 300ms ease-out; |
| 29 | + -webkit-transition: background 300ms ease-out, color 300ms ease-out, border 300ms ease-out; |
| 30 | + -moz-transition: background 300ms ease-out, color 300ms ease-out, border 300ms ease-out; |
| 31 | + -o-transition: background 300ms ease-out, color 300ms ease-out, border 300ms ease-out; |
| 32 | + transition: background 300ms ease-out, color 300ms ease-out, border 300ms ease-out; |
17 | 33 | line-height: normal;
|
18 | 34 | margin-bottom: 0;
|
19 | 35 | font-family: $font-family;
|
20 | 36 | &:hover,
|
21 | 37 | &:active,
|
22 | 38 | &:focus {
|
23 | 39 | text-decoration: none;
|
24 |
| - transition: background-color 300ms ease-out; |
25 | 40 | }
|
26 | 41 |
|
| 42 | + @include focus-state; |
| 43 | + |
27 | 44 | &:disabled {
|
28 | 45 | @include button-disabled;
|
29 | 46 | }
|
|
32 | 49 | @mixin button {
|
33 | 50 | @include button-base;
|
34 | 51 | color: $color_white;
|
35 |
| - background-color: $button-bg; |
36 |
| - border: none; |
| 52 | + background: $button-bg; |
| 53 | + border: 1.5px solid $button-bg; |
37 | 54 | &:hover,
|
38 | 55 | &:active,
|
39 |
| - &:focus, |
40 | 56 | &:visited:hover,
|
41 |
| - &:visited:active, |
42 |
| - &:visited:focus { |
43 |
| - background-color: darken($button-bg, 10%); |
44 |
| - color: $color_white; |
| 57 | + &:visited:active { |
| 58 | + background:lighten($button-bg, 50%); |
| 59 | + color: $button-bg; |
45 | 60 | }
|
46 | 61 | }
|
47 | 62 |
|
| 63 | + |
48 | 64 | @mixin button-secondary {
|
49 | 65 | @include button-base;
|
50 |
| - background-color: mix($color_light_grey, $color_yellow, 95%); |
| 66 | + background: mix($color_light_grey, $color_yellow, 95%); |
51 | 67 | color: $color_black;
|
52 | 68 | font-weight: normal;
|
| 69 | + border: 1.5px solid lighten($color_black, 10%); |
53 | 70 | &:hover,
|
54 |
| - &:active, |
55 |
| - &:focus { |
56 |
| - color: $color_black; |
57 |
| - background-color: darken($color_light_grey, 7.5%); |
58 |
| - color: $color_black; |
| 71 | + &:active { |
| 72 | + background: $color_black; |
| 73 | + color: $color_white; |
| 74 | + border: 1.5px solid $color_white; |
59 | 75 | }
|
60 | 76 | }
|
61 | 77 |
|
62 | 78 | @mixin button-tertiary {
|
63 | 79 | @include button-base;
|
64 |
| - background-color: transparent; |
65 |
| - color: $color_black; |
| 80 | + background: $color_off_white; // Adding a colour instead of transparent, that way we can use this button even in dark backgrounds |
| 81 | + color: $link-color; |
66 | 82 | font-weight: normal;
|
67 |
| - border: 1px solid $color_light_grey; |
| 83 | + border: 1.5px solid $link-color; |
68 | 84 | &:hover,
|
69 | 85 | &:active,
|
70 |
| - &:focus { |
71 |
| - background-color: darken($color_light_grey, 7.5%); |
72 |
| - border: 1px solid darken($color_light_grey, 12.5%); |
| 86 | + &:visited:hover, |
| 87 | + &:visited:active { |
| 88 | + color: $color_white; |
| 89 | + // 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. |
| 90 | + background: darken($link-color, 15%); |
| 91 | + border: 1.5px solid darken($link-color, 15%); |
73 | 92 | }
|
74 | 93 | }
|
75 | 94 |
|
|
78 | 97 | &:hover,
|
79 | 98 | &:active,
|
80 | 99 | &:focus {
|
81 |
| - background-color: inherit; |
| 100 | + background: inherit; |
82 | 101 | }
|
83 | 102 | }
|
84 | 103 |
|
85 | 104 | @mixin button-pro {
|
86 |
| - background-image: linear-gradient(-180deg, #4C858D 0%, #3E6D75 100%); |
| 105 | + background: linear-gradient(-180deg, #4C858D 0%, #3E6D75 100%); |
| 106 | + border: 1.5px solid #3E6D75; |
87 | 107 | box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.22);
|
88 | 108 | &:hover,
|
89 | 109 | &:active,
|
90 |
| - &:focus, |
91 | 110 | &:visited:hover,
|
92 |
| - &:visited:active, |
93 |
| - &:visited:focus { |
| 111 | + &:visited:active { |
| 112 | + box-shadow: 0 1px 0 0 rgba(0,0,0,0.22); |
| 113 | + color: #3E6D75; |
| 114 | + background: linear-gradient(-180deg, #d8edf0 0%, #bfe0e6 100%); |
| 115 | + } |
| 116 | + |
| 117 | + &:disabled { |
| 118 | + @include button-disabled; |
| 119 | + } |
| 120 | +} |
| 121 | + |
| 122 | +@mixin button-pro-tertiary { |
| 123 | + background: $color-white; |
| 124 | + color: #3E6D75; |
| 125 | + border: 1.5px solid #3E6D75; |
| 126 | + box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.22); |
| 127 | + &:hover, |
| 128 | + &:active, |
| 129 | + &:visited:hover, |
| 130 | + &:visited:active { |
| 131 | + background: linear-gradient(-180deg, #1a4146 0%, #153a40 100%); |
| 132 | + color: $color-white; |
94 | 133 | box-shadow: 0 1px 0 0 rgba(0,0,0,0.22);
|
95 | 134 | }
|
96 | 135 |
|
| 136 | + @include focus-state; |
| 137 | + |
97 | 138 | &:disabled {
|
98 | 139 | @include button-disabled;
|
99 | 140 | }
|
|
106 | 147 | @include ie8 {
|
107 | 148 | color: $main_menu-link_text;
|
108 | 149 | }
|
109 |
| - transition: background-color 0.5s ease-out; |
| 150 | + transition: background 0.5s ease-out; |
110 | 151 | &:hover,
|
111 | 152 | &:active,
|
112 | 153 | &:focus {
|
113 |
| - background-color: darken($main_menu-bg, 10%); |
| 154 | + background: darken($main_menu-bg, 10%); |
114 | 155 | color: transparentize($main_menu-link_text, 0);
|
115 | 156 | }
|
116 | 157 | }
|
117 | 158 |
|
118 | 159 | @mixin selected-menu-item {
|
119 | 160 | font-weight: 600;
|
120 | 161 | color: $main_menu-active_link_text;
|
121 |
| - background-color: $main_menu-active_link_bg; |
| 162 | + background: $main_menu-active_link_bg; |
122 | 163 | &:hover,
|
123 | 164 | &:active,
|
124 | 165 | &:focus {
|
125 |
| - background-color: $main_menu-active_link_bg; |
| 166 | + background: $main_menu-active_link_bg; |
126 | 167 | }
|
127 | 168 | }
|
0 commit comments