diff --git a/core/themes/stable/css/core/splitbutton/splitbutton.css b/core/themes/stable/css/core/splitbutton/splitbutton.css new file mode 100644 index 0000000000..411301b33b --- /dev/null +++ b/core/themes/stable/css/core/splitbutton/splitbutton.css @@ -0,0 +1,124 @@ + +/** + * @file + * Base styles for splitbuttons. + */ + +/** + * When a splitbutton has only one item, it is simply a button. + */ +.splitbutton { + display: inline-block; + box-sizing: border-box; + max-width: 100%; +} + +.splitbutton--multiple { + padding-right: 2em; /* LTR */ +} + +[dir="rtl"] .splitbutton--multiple { + padding-right: 0; + padding-left: 2em; +} + +.js .splitbutton--multiple { + position: relative; +} + +.splitbutton__action.splitbutton__action { + width: 100%; + margin: 0; + text-align: left; /* LTR */ +} +[dir="rtl"] .splitbutton__action.splitbutton__action { + text-align: right; +} + +@media screen and (max-width: 600px) { + .js .splitbutton { + width: 100%; + } +} + +.js td .splitbutton-multiple .splitbutton-action a, +.js td .splitbutton-multiple .splitbutton-action input, +.js td .splitbutton-multiple .splitbutton-action button { + width: auto; +} + +/* UL styles are over-scoped in core, so this selector needs weight parity. */ +.splitbutton__list.splitbutton__list { + margin: 0; + padding: 0; + list-style: none; +} + +.js .splitbutton__list .splitbutton__action { + display: none; +} + +.splitbutton__list.open .splitbutton__action { + display: block; +} + +/** + * The splitbutton styling. + * + * A splitbutton is a widget that displays a list of action links as a button + * with a primary action. Secondary actions are hidden behind a click on a + * twisty arrow. + * + * The arrow is created using border on a zero-width, zero-height span. + * The arrow inherits the link color, but can be overridden with border colors. + */ +.splitbutton.open { + z-index: 100; + max-width: none; +} + +.splitbutton__toggle.splitbutton__toggle { + position: absolute; + top: 0; + right: 0; /* LTR */ + bottom: 0; + width: 2em; + margin: 0; + padding: 0; +} +[dir="rtl"] .splitbutton__toggle.splitbutton__toggle { + right: auto; + left: 0; +} + +.splitbutton__toggle-arrow { + position: absolute; + top: 50%; + left: 50%; + width: 0; + height: 0; + transform: translate(-50%, -50%); + border-width: 0.3333em 0.3333em 0; + border-style: solid; + border-right-color: transparent; + border-bottom-color: transparent; + border-left-color: transparent; + line-height: 0; +} + +.splitbutton.open .splitbutton__toggle-arrow { + border-top-color: transparent; + border-bottom: 0.3333em solid; +} + +.splitbutton .ajax-progress-throbber { + position: absolute; + top: 100%; + left: 0; + display: flex; + width: auto; +} + +.splitbutton .ajax-progress-throbber .message { + flex: 1 0 auto; +} diff --git a/core/themes/stable/stable.info.yml b/core/themes/stable/stable.info.yml index 0f20f7c604..608db4af6e 100644 --- a/core/themes/stable/stable.info.yml +++ b/core/themes/stable/stable.info.yml @@ -85,6 +85,13 @@ libraries-override: css: component: misc/dropbutton/dropbutton.css: css/core/dropbutton/dropbutton.css + + core/drupal.splitbutton: + css: + component: + misc/splitbutton/splitbutton.css: css/core/splitbutton/splitbutton.css + + core/drupal.vertical-tabs: css: component: