annotate core/themes/seven/css/components/buttons.css @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents af1871eacc83
children
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@18 25 position: relative; /* 1 */
Chris@18 26 display: inline-block;
Chris@0 27 box-sizing: border-box;
Chris@18 28 padding: 4px 1.5em; /* 4 */
Chris@18 29 cursor: pointer;
Chris@18 30 -webkit-transition: all 0.1s;
Chris@18 31 transition: all 0.1s;
Chris@0 32 text-align: center;
Chris@18 33 text-decoration: none;
Chris@18 34 color: #333;
Chris@0 35 border: 1px solid #a6a6a6;
Chris@0 36 border-radius: 20em;
Chris@0 37 background-color: #f2f1eb;
Chris@0 38 background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
Chris@14 39 background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
Chris@0 40 text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
Chris@0 41 font-size: 14px;
Chris@0 42 font-size: 0.875rem; /* 5 */
Chris@18 43 font-weight: 600;
Chris@18 44 line-height: normal; /* 2 */
Chris@18 45 -webkit-appearance: none; /* 3 */
Chris@18 46 -moz-appearance: none; /* 3 */
Chris@0 47 -webkit-font-smoothing: antialiased; /* 6 */
Chris@0 48 }
Chris@0 49 .button:hover,
Chris@0 50 .button:focus {
Chris@18 51 text-decoration: none;
Chris@18 52 color: #1a1a1a;
Chris@18 53 outline: none;
Chris@0 54 background-color: #f9f8f6;
Chris@0 55 background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
Chris@14 56 background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
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@14 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@18 69 -webkit-transition: none;
Chris@18 70 transition: none;
Chris@0 71 border: 1px solid #a6a6a6;
Chris@0 72 background-color: #dfdfd9;
Chris@0 73 background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
Chris@14 74 background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
Chris@0 75 box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
Chris@0 76 }
Chris@0 77
Chris@0 78 .button--primary {
Chris@18 79 color: #fff;
Chris@0 80 border-color: #1e5c90;
Chris@0 81 background-color: #0071b8;
Chris@0 82 background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
Chris@14 83 background-image: linear-gradient(to bottom, #007bc6, #0071b8);
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@18 90 color: #fff;
Chris@18 91 border-color: #1e5c90;
Chris@0 92 background-color: #2369a6;
Chris@0 93 background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7);
Chris@14 94 background-image: linear-gradient(to bottom, #0c97ed, #1f86c7);
Chris@0 95 }
Chris@0 96 .button--primary:focus {
Chris@14 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@18 103 border-color: #144b78;
Chris@0 104 background-image: -webkit-linear-gradient(top, #08639b, #0071b8);
Chris@14 105 background-image: linear-gradient(to bottom, #08639b, #0071b8);
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@18 131 padding: 2px 1em; /* 1 */
Chris@0 132 font-size: 13px;
Chris@0 133 font-size: 0.813rem;
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@18 140 cursor: default;
Chris@18 141 color: #5c5c5c;
Chris@0 142 border-color: #d4d4d4;
Chris@0 143 background: #ededed;
Chris@0 144 box-shadow: none;
Chris@18 145 text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
Chris@0 146 font-weight: normal;
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@18 157 padding: 0;
Chris@0 158 cursor: pointer;
Chris@18 159 text-decoration: none;
Chris@18 160 color: #0074bd;
Chris@0 161 border: 0;
Chris@0 162 background: none;
Chris@0 163 -webkit-appearance: none;
Chris@0 164 -moz-appearance: none;
Chris@0 165 }
Chris@0 166 .link:hover,
Chris@0 167 .link:focus {
Chris@18 168 text-decoration: underline;
Chris@0 169 color: #008ee6;
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@18 180 padding: 0;
Chris@0 181 cursor: pointer;
Chris@18 182 text-decoration: underline;
Chris@18 183 color: #c72100;
Chris@0 184 border: 0;
Chris@0 185 border-radius: 0;
Chris@18 186 background: none;
Chris@0 187 box-shadow: none;
Chris@18 188 font-weight: 400;
Chris@0 189 -webkit-appearance: none;
Chris@0 190 -moz-appearance: none;
Chris@0 191 }
Chris@0 192 .button--danger:hover,
Chris@0 193 .button--danger:focus,
Chris@0 194 .button--danger:active {
Chris@18 195 padding: 0;
Chris@18 196 text-decoration: underline;
Chris@0 197 color: #ff2a00;
Chris@18 198 border: 0;
Chris@18 199 background: none;
Chris@18 200 box-shadow: none;
Chris@0 201 text-shadow: none;
Chris@0 202 }
Chris@0 203 .button--danger:disabled,
Chris@0 204 .button--danger.is-disabled {
Chris@18 205 padding: 0;
Chris@0 206 cursor: default;
Chris@0 207 text-decoration: none;
Chris@18 208 color: #737373;
Chris@18 209 border: 0;
Chris@18 210 background: none;
Chris@18 211 box-shadow: none;
Chris@0 212 -webkit-font-smoothing: antialiased;
Chris@0 213 }