button.pcss.css
Same filename in this branch
Same filename in other branches
- 8.9.x core/themes/claro/css/components/button.pcss.css
- 10 core/misc/dialog/off-canvas/css/button.pcss.css
- 10 core/themes/olivero/css/components/button.pcss.css
- 10 core/themes/claro/css/components/button.pcss.css
- 11.x core/misc/dialog/off-canvas/css/button.pcss.css
- 11.x core/themes/olivero/css/components/button.pcss.css
- 11.x core/themes/claro/css/components/button.pcss.css
Buttons.
File
-
core/
themes/ olivero/ css/ components/ button.pcss.css
View source
- /**
- * @file
- * Buttons.
- */
-
- @import "../base/variables.pcss.css";
-
- .button {
- display: inline-block;
- height: var(--sp3);
- margin-block: var(--sp1);
- margin-inline-start: 0;
- margin-inline-end: var(--sp1);
- padding-block: calc((var(--sp3) - var(--line-height-s)) / 2);
- padding-inline: var(--sp1-5);
- cursor: pointer;
- text-align: center;
- text-decoration: none;
- color: var(--color--blue-20);
- border: solid 2px var(--color--blue-20);
- border-radius: var(--border-radius);
- background-color: var(--color--white);
- font-family: var(--font-sans);
- font-size: var(--font-size-l);
- font-weight: 700;
- appearance: none;
- -webkit-font-smoothing: antialiased;
-
- &:hover,
- &:focus {
- text-decoration: none;
- color: var(--color--blue-10);
- border: solid 2px var(--color--blue-10);
- background: none;
- font-weight: 700;
- }
-
- &:focus {
- outline: 2px solid var(--color--blue-70);
- outline-offset: 2px;
- }
-
- &:active {
- color: var(--color--blue-20);
- border-color: var(--color--blue-20);
- }
-
- &:disabled,
- &.is-disabled {
- cursor: default;
- color: var(--color--gray-70);
- border-color: var(--color--gray-70);
- }
-
- /*
- IE11 doesn't work properly on button elements so we only do
- inline-flex on modern browsers.
- */
- @supports (display: inline-flex) {
- display: inline-flex;
- align-items: center;
-
- /* Top padding accounts for font not being vertically centered within line-height. */
- padding-block: 1px 0;
- padding-inline: var(--sp1-5);
- line-height: var(--line-height-s);
- }
- }
-
- /* No margin if is part of a menu. */
- .menu .button {
- margin-block: 0;
- margin-inline-start: 0;
- margin-inline-end: 0;
- }
-
- .button--small {
- height: var(--sp2-5);
- padding-block: calc((var(--sp2-5) - var(--line-height-s)) / 2);
- padding-inline: var(--sp);
- font-size: var(--font-size-base);
- line-height: normal;
- }
-
- .button--primary {
- color: var(--color--white);
- background-color: var(--color--blue-20);
-
- &:hover,
- &:focus {
- color: var(--color--white);
- border-color: var(--color--blue-10);
- background-color: var(--color--blue-10);
- }
-
- &:active {
- color: var(--color--white);
- background-color: var(--color--blue-20);
- }
-
- &:disabled,
- &.is-disabled {
- color: var(--color--white);
- background-color: var(--color--gray-70);
- }
- }
-
- .button--icon-back {
- display: inline-flex;
- align-items: center;
-
- &:before {
- display: block;
- width: 0.5em;
- height: 0.5em;
- margin-inline-end: 0.5em;
- content: "";
- transform: rotate(45deg); /* LTR */
- border-block-end: solid 2px currentColor;
- border-inline-start: solid 2px currentColor;
- }
- }
-
- [dir="rtl"] .button--icon-back:before {
- transform: rotate(-45deg);
- }
-
- .shepherd-cancel-icon {
- font-size: 1.5em;
- }
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.