annotate core/themes/seven/css/components/buttons.css @ 11:bfffd8d7479a

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