Chris@0: /** Chris@0: * @file Chris@0: * Structural styles for Seven’s UI buttons Chris@0: * Chris@0: * Apply these classes to any element (, , , etc.) that Chris@0: * should appear as a button. Chris@0: */ Chris@0: Chris@0: /** Chris@0: * Buttons. Chris@0: * Chris@0: * 1. Enable z-index on buttons. Chris@0: * 2. Normalize 'line-height'; can’t be changed from 'normal' in Firefox 4+. Chris@0: * 3. Allows full range of styling in Webkit and Gecko. Chris@0: * 4. Use px units to ensure button text is centered vertically. Chris@0: * 5. Use rems to avoid the font size cascade of ems, with a px fallback for Chris@0: * older browsers. Chris@0: * 6. Prevent fat text in WebKit. Chris@0: * Chris@0: * @todo Consider moving box-sizing into base.css under a universal selector. Chris@0: * See https://www.drupal.org/node/2124251 Chris@0: * Chris@0: */ Chris@0: .button { Chris@18: position: relative; /* 1 */ Chris@18: display: inline-block; Chris@0: box-sizing: border-box; Chris@18: padding: 4px 1.5em; /* 4 */ Chris@18: cursor: pointer; Chris@18: -webkit-transition: all 0.1s; Chris@18: transition: all 0.1s; Chris@0: text-align: center; Chris@18: text-decoration: none; Chris@18: color: #333; Chris@0: border: 1px solid #a6a6a6; Chris@0: border-radius: 20em; Chris@0: background-color: #f2f1eb; Chris@0: background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df); Chris@14: background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df); Chris@0: text-shadow: 0 1px hsla(0, 0%, 100%, 0.6); Chris@0: font-size: 14px; Chris@0: font-size: 0.875rem; /* 5 */ Chris@18: font-weight: 600; Chris@18: line-height: normal; /* 2 */ Chris@18: -webkit-appearance: none; /* 3 */ Chris@18: -moz-appearance: none; /* 3 */ Chris@0: -webkit-font-smoothing: antialiased; /* 6 */ Chris@0: } Chris@0: .button:hover, Chris@0: .button:focus { Chris@18: text-decoration: none; Chris@18: color: #1a1a1a; Chris@18: outline: none; Chris@0: background-color: #f9f8f6; Chris@0: background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd); Chris@14: background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd); Chris@0: } Chris@0: .button:hover { Chris@0: box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125); Chris@0: } Chris@0: Chris@0: /* Prevent focus ring being covered by next siblings. */ Chris@0: .button:focus { Chris@0: z-index: 10; Chris@14: border: 1px solid #3ab2ff; Chris@0: box-shadow: 0 0 0.5em 0.1em hsla(203, 100%, 60%, 0.7); Chris@0: } Chris@0: .button:active { Chris@18: -webkit-transition: none; Chris@18: transition: none; Chris@0: border: 1px solid #a6a6a6; Chris@0: background-color: #dfdfd9; Chris@0: background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df); Chris@14: background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df); Chris@0: box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2); Chris@0: } Chris@0: Chris@0: .button--primary { Chris@18: color: #fff; Chris@0: border-color: #1e5c90; Chris@0: background-color: #0071b8; Chris@0: background-image: -webkit-linear-gradient(top, #007bc6, #0071b8); Chris@14: background-image: linear-gradient(to bottom, #007bc6, #0071b8); Chris@0: text-shadow: 0 1px hsla(0, 0%, 0%, 0.5); Chris@0: font-weight: 700; Chris@0: -webkit-font-smoothing: antialiased; Chris@0: } Chris@0: .button--primary:hover, Chris@0: .button--primary:focus { Chris@18: color: #fff; Chris@18: border-color: #1e5c90; Chris@0: background-color: #2369a6; Chris@0: background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7); Chris@14: background-image: linear-gradient(to bottom, #0c97ed, #1f86c7); Chris@0: } Chris@0: .button--primary:focus { Chris@14: border: 1px solid #1280df; Chris@0: } Chris@0: .button--primary:hover { Chris@0: box-shadow: 0 1px 2px hsla(203, 10%, 10%, 0.25); Chris@0: } Chris@0: .button--primary:active { Chris@18: border-color: #144b78; Chris@0: background-image: -webkit-linear-gradient(top, #08639b, #0071b8); Chris@14: background-image: linear-gradient(to bottom, #08639b, #0071b8); Chris@0: box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Overrides styling from system.theme. Chris@0: */ Chris@0: .button-action:before { Chris@0: margin-left: -0.2em; /* LTR */ Chris@0: padding-right: 0.2em; /* LTR */ Chris@0: font-size: 14px; Chris@0: font-size: 0.875rem; Chris@0: line-height: 16px; Chris@0: -webkit-font-smoothing: auto; Chris@0: } Chris@0: [dir="rtl"] .button-action:before { Chris@0: margin-right: -0.2em; Chris@0: margin-left: 0; Chris@0: padding-right: 0; Chris@0: padding-left: 0.2em; Chris@0: } Chris@0: Chris@0: /** Chris@0: * 1. Use px units to ensure button text is centered vertically. Chris@0: */ Chris@0: .no-touchevents .button--small { Chris@18: padding: 2px 1em; /* 1 */ Chris@0: font-size: 13px; Chris@0: font-size: 0.813rem; Chris@0: } Chris@0: Chris@0: .button:disabled, Chris@0: .button:disabled:active, Chris@0: .button.is-disabled, Chris@0: .button.is-disabled:active { Chris@18: cursor: default; Chris@18: color: #5c5c5c; Chris@0: border-color: #d4d4d4; Chris@0: background: #ededed; Chris@0: box-shadow: none; Chris@18: text-shadow: 0 1px hsla(0, 0%, 100%, 0.6); Chris@0: font-weight: normal; Chris@0: } Chris@0: Chris@0: /* Link actions. */ Chris@0: Chris@0: /** Chris@0: * Style a clickable/tappable element as a link. Duplicates the base style for Chris@0: * the tag, plus a reset for padding, borders and background. Chris@0: */ Chris@0: .link { Chris@0: display: inline; Chris@18: padding: 0; Chris@0: cursor: pointer; Chris@18: text-decoration: none; Chris@18: color: #0074bd; Chris@0: border: 0; Chris@0: background: none; Chris@0: -webkit-appearance: none; Chris@0: -moz-appearance: none; Chris@0: } Chris@0: .link:hover, Chris@0: .link:focus { Chris@18: text-decoration: underline; Chris@0: color: #008ee6; Chris@0: } Chris@0: Chris@0: /** Chris@0: * We've temporarily added the danger button here, bit of a harsh reset but we Chris@0: * need it. Chris@0: * @todo replace with link--danger. Chris@0: * See https://www.drupal.org/node/2123731 Chris@0: */ Chris@0: .button--danger { Chris@0: display: inline; Chris@18: padding: 0; Chris@0: cursor: pointer; Chris@18: text-decoration: underline; Chris@18: color: #c72100; Chris@0: border: 0; Chris@0: border-radius: 0; Chris@18: background: none; Chris@0: box-shadow: none; Chris@18: font-weight: 400; Chris@0: -webkit-appearance: none; Chris@0: -moz-appearance: none; Chris@0: } Chris@0: .button--danger:hover, Chris@0: .button--danger:focus, Chris@0: .button--danger:active { Chris@18: padding: 0; Chris@18: text-decoration: underline; Chris@0: color: #ff2a00; Chris@18: border: 0; Chris@18: background: none; Chris@18: box-shadow: none; Chris@0: text-shadow: none; Chris@0: } Chris@0: .button--danger:disabled, Chris@0: .button--danger.is-disabled { Chris@18: padding: 0; Chris@0: cursor: default; Chris@0: text-decoration: none; Chris@18: color: #737373; Chris@18: border: 0; Chris@18: background: none; Chris@18: box-shadow: none; Chris@0: -webkit-font-smoothing: antialiased; Chris@0: }