79b0fe4aa40d9037e3625e4a001e07e7b8097012
[yaffs-website] / web / core / themes / seven / css / components / buttons.css
1 /**
2  * @file
3  * Structural styles for Seven’s UI buttons
4  *
5  * Apply these classes to any element (<link>, <button>, <input>, etc.) that
6  * should appear as a button.
7  */
8
9 /**
10  * Buttons.
11  *
12  * 1. Enable z-index on buttons.
13  * 2. Normalize 'line-height'; can’t be changed from 'normal' in Firefox 4+.
14  * 3. Allows full range of styling in Webkit and Gecko.
15  * 4. Use px units to ensure button text is centered vertically.
16  * 5. Use rems to avoid the font size cascade of ems, with a px fallback for
17  *    older browsers.
18  * 6. Prevent fat text in WebKit.
19  *
20  * @todo Consider moving box-sizing into base.css under a universal selector.
21  * See https://www.drupal.org/node/2124251
22  *
23  */
24 .button {
25   box-sizing: border-box;
26   display: inline-block;
27   position: relative;  /* 1 */
28   text-align: center;
29   line-height: normal;  /* 2 */
30   cursor: pointer;
31   -webkit-appearance: none;  /* 3 */
32   -moz-appearance: none;  /* 3 */
33   padding: 4px 1.5em;  /* 4 */
34   border: 1px solid #a6a6a6;
35   border-radius: 20em;
36   background-color: #f2f1eb;
37   background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
38   background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
39   color: #333;
40   text-decoration: none;
41   text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
42   font-weight: 600;
43   font-size: 14px;
44   font-size: 0.875rem;  /* 5 */
45   -webkit-transition: all 0.1s;
46   transition: all 0.1s;
47   -webkit-font-smoothing: antialiased;  /* 6 */
48 }
49 .button:hover,
50 .button:focus {
51   background-color: #f9f8f6;
52   background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
53   background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
54   color: #1a1a1a;
55   text-decoration: none;
56   outline: none;
57 }
58 .button:hover {
59   box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
60 }
61
62 /* Prevent focus ring being covered by next siblings. */
63 .button:focus {
64   z-index: 10;
65   border: 1px solid #3ab2ff;
66   box-shadow: 0 0 0.5em 0.1em hsla(203, 100%, 60%, 0.7);
67 }
68 .button:active {
69   border: 1px solid #a6a6a6;
70   background-color: #dfdfd9;
71   background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
72   background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
73   box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
74   -webkit-transition: none;
75   transition: none;
76 }
77
78 .button--primary {
79   border-color: #1e5c90;
80   background-color: #0071b8;
81   background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
82   background-image: linear-gradient(to bottom, #007bc6, #0071b8);
83   color: #fff;
84   text-shadow: 0 1px hsla(0, 0%, 0%, 0.5);
85   font-weight: 700;
86   -webkit-font-smoothing: antialiased;
87 }
88 .button--primary:hover,
89 .button--primary:focus {
90   background-color: #2369a6;
91   background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7);
92   background-image: linear-gradient(to bottom, #0c97ed, #1f86c7);
93   border-color: #1e5c90;
94   color: #fff;
95 }
96 .button--primary:focus {
97   border: 1px solid #1280df;
98 }
99 .button--primary:hover {
100   box-shadow: 0 1px 2px hsla(203, 10%, 10%, 0.25);
101 }
102 .button--primary:active {
103   background-image: -webkit-linear-gradient(top, #08639b, #0071b8);
104   background-image: linear-gradient(to bottom, #08639b, #0071b8);
105   border-color: #144b78;
106   box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
107 }
108
109 /**
110  * Overrides styling from system.theme.
111  */
112 .button-action:before {
113   margin-left: -0.2em; /* LTR */
114   padding-right: 0.2em; /* LTR */
115   font-size: 14px;
116   font-size: 0.875rem;
117   line-height: 16px;
118   -webkit-font-smoothing: auto;
119 }
120 [dir="rtl"] .button-action:before {
121   margin-right: -0.2em;
122   margin-left: 0;
123   padding-right: 0;
124   padding-left: 0.2em;
125 }
126
127 /**
128  * 1. Use px units to ensure button text is centered vertically.
129  */
130 .no-touchevents .button--small {
131   font-size: 13px;
132   font-size: 0.813rem;
133   padding: 2px 1em;  /* 1 */
134 }
135
136 .button:disabled,
137 .button:disabled:active,
138 .button.is-disabled,
139 .button.is-disabled:active {
140   border-color: #d4d4d4;
141   background: #ededed;
142   box-shadow: none;
143   color: #5c5c5c;
144   font-weight: normal;
145   cursor: default;
146   text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
147 }
148
149 /* Link actions. */
150
151 /**
152  * Style a clickable/tappable element as a link. Duplicates the base style for
153  * the <a> tag, plus a reset for padding, borders and background.
154  */
155 .link {
156   display: inline;
157   cursor: pointer;
158   padding: 0;
159   border: 0;
160   background: none;
161   -webkit-appearance: none;
162   -moz-appearance: none;
163   color: #0074bd;
164   text-decoration: none;
165 }
166 .link:hover,
167 .link:focus {
168   color: #008ee6;
169   text-decoration: underline;
170 }
171
172 /**
173  * We've temporarily added the danger button here, bit of a harsh reset but we
174  * need it.
175  * @todo replace with link--danger.
176  * See https://www.drupal.org/node/2123731
177  */
178 .button--danger {
179   display: inline;
180   cursor: pointer;
181   padding: 0;
182   border: 0;
183   border-radius: 0;
184   box-shadow: none;
185   background: none;
186   -webkit-appearance: none;
187   -moz-appearance: none;
188   color: #c72100;
189   font-weight: 400;
190   text-decoration: underline;
191 }
192 .button--danger:hover,
193 .button--danger:focus,
194 .button--danger:active {
195   color: #ff2a00;
196   text-decoration: underline;
197   text-shadow: none;
198   padding: 0;
199   border: 0;
200   box-shadow: none;
201   background: none;
202 }
203 .button--danger:disabled,
204 .button--danger.is-disabled {
205   color: #737373;
206   cursor: default;
207   text-decoration: none;
208   -webkit-font-smoothing: antialiased;
209   padding: 0;
210   border: 0;
211   box-shadow: none;
212   background: none;
213 }