button.css
Same filename in this branch
- 9 core/profiles/demo_umami/themes/umami/css/classy/components/button.css
- 9 core/themes/olivero/css/components/button.css
- 9 core/themes/seven/css/classy/components/button.css
- 9 core/themes/bartik/css/classy/components/button.css
- 9 core/themes/starterkit_theme/css/components/button.css
- 9 core/themes/classy/css/components/button.css
- 9 core/assets/vendor/jquery.ui/themes/base/button.css
Same filename in other branches
- 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/button.css
- 8.9.x core/themes/seven/css/classy/components/button.css
- 8.9.x core/themes/claro/css/components/button.css
- 8.9.x core/themes/bartik/css/classy/components/button.css
- 8.9.x core/themes/classy/css/components/button.css
- 8.9.x core/assets/vendor/jquery.ui/themes/base/button.css
- 10 core/profiles/demo_umami/themes/umami/css/classy/components/button.css
- 10 core/misc/dialog/off-canvas/css/button.css
- 10 core/themes/olivero/css/components/button.css
- 10 core/themes/claro/css/components/button.css
- 10 core/themes/starterkit_theme/css/components/button.css
- 10 core/assets/vendor/jquery.ui/themes/base/button.css
- 11.x core/profiles/demo_umami/themes/umami/css/classy/components/button.css
- 11.x core/misc/dialog/off-canvas/css/button.css
- 11.x core/themes/olivero/css/components/button.css
- 11.x core/themes/claro/css/components/button.css
- 11.x core/themes/starterkit_theme/css/components/button.css
- 11.x core/assets/vendor/jquery.ui/themes/base/button.css
Structural styles for Claro's UI buttons
Apply these classes to button elements (<button>, <input type="button" />).
File
-
core/
themes/ claro/ css/ components/ button.css
View source
- /*
- * DO NOT EDIT THIS FILE.
- * See the following change record for more information,
- * https://www.drupal.org/node/3084859
- * @preserve
- */
-
- /**
- * @file
- * Structural styles for Claro's UI buttons
- *
- * Apply these classes to button elements (, ).
- */
-
- /**
- * Buttons.
- *
- * 1. Padding widths detracted by width of the transparent borders to make
- * button size match with design system.
- * 2. Transparent border is needed for high contrast mode. This has to be set to
- * !important to render Firefox borders with consistent width in high
- * contrast mode.
- * 3. Prevent fat text in WebKit.
- *
- * @todo Consider moving box-sizing into base.css under a universal selector.
- * See https://www.drupal.org/node/2124251
- */
-
- /**
- * Base button styles.
- *
- * These styles have been duplicated to dropbutton.css and action-links.css
- * since those components inherits most of these design elements. Whenever
- * making changes to this file, remember to check if that needs to be applied to
- * dropbutton.css or action-links.css as well.
- */
-
- .button {
- border: 1px solid transparent !important;
- }
-
- .button {
- display: inline-block;
- margin: 1rem 0.75rem 1rem 0; /* LTR */
- padding: calc(1rem - 1px) calc(1.5rem - 1px); /* 1 */
- cursor: pointer;
- text-align: center;
- text-decoration: none;
- color: #232429; /* 2 */
- border-radius: 2px;
- background-color: #d3d4d9;
- font-size: 1rem;
- font-weight: 700;
- line-height: 1rem;
- -webkit-appearance: none;
- appearance: none;
- -webkit-font-smoothing: antialiased; /* 3 */
- }
-
- [dir="rtl"] .button {
- margin: 1rem 0 1rem 0.75rem;
- }
-
- .button:not(:focus) {
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
- }
-
- .button:hover {
- text-decoration: none;
- background-color: #c1c2c7;
- }
-
- .button:focus {
- text-decoration: none;
- }
-
- .button:active {
- background-color: #adaeb3;
- }
-
- /* Common styles for small buttons */
-
- .no-touchevents .button--small {
- margin: 0.75rem 0.5rem 0.75rem 0; /* LTR */
- padding: calc(0.5rem - 1px) calc(1rem - 1px); /* 1 */
- font-size: 0.79rem;
- }
-
- /* Common styles for extra small buttons */
-
- .no-touchevents .button--extrasmall {
- margin: 0.5rem 0.5rem 0.5rem 0; /* LTR */
- padding: calc(0.25rem - 1px) calc(0.75rem - 1px); /* 1 */
- font-size: 0.79rem;
- }
-
- [dir="rtl"].no-touchevents .button--small,
- [dir="rtl"].no-touchevents .button--extrasmall {
- margin-right: 0;
- margin-left: 0.5rem;
- }
-
- /* Styles for action link buttons */
-
- .button--action {
- margin: 0;
- }
-
- .button--action::before {
- margin-left: -0.25em; /* LTR */
- padding-right: 0.25em; /* LTR */
- content: "+";
- font-weight: 900;
- }
-
- [dir="rtl"] .button--action::before {
- margin-right: -0.25em;
- margin-left: 0;
- padding-right: 0;
- padding-left: 0.25em;
- }
-
- a.button:hover,
- a.button:active {
- color: #232429;
- }
-
- /* Primary button styles */
-
- .button--primary {
- color: #fff;
- background-color: #003ecc;
- }
-
- .button--primary:hover {
- color: #fff;
- background-color: #0036b1;
- }
-
- .button--primary:active {
- background-color: #002e9a;
- }
-
- a.button--primary:hover,
- a.button--primary:active {
- color: #fff;
- }
-
- /* Danger button styles */
-
- .button--danger {
- color: #fff;
- background-color: #dc2323;
- }
-
- .button--danger:hover {
- color: #fff;
- background-color: #c61f1f;
- }
-
- .button--danger:active {
- background-color: #b01c1c;
- }
-
- a.button--danger:hover,
- a.button--danger:active {
- color: #fff;
- }
-
- /**
- * Disabled state styles as last.
- *
- * Overrides every definitions before, including variants.
- */
-
- .button:disabled,
- .button.is-disabled {
- color: #919297;
- background-color: #ebebed;
- }
-
- .button--primary:disabled,
- .button--primary.is-disabled {
- color: #828388;
- background-color: #d3d4d9;
- }
-
- /* Make disabled behave like a [disabled] or */
-
- .button.is-disabled {
- -webkit-user-select: none;
- -ms-user-select: none;
- user-select: none;
- pointer-events: none;
- }
-
- /**
- * Style a clickable/tappable element as a link. Duplicates the base style for
- * the tag, plus a reset for padding, borders and background.
- */
-
- .link {
- display: inline;
- padding: 0;
- cursor: pointer;
- text-decoration: underline;
- border: 0;
- background: none;
- -webkit-appearance: none;
- appearance: none;
- }
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.