Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Improved styling of the toolbar grouping dropdown and separators when…
Browse files Browse the repository at this point in the history
… its grouping items.
  • Loading branch information
oleq committed Feb 25, 2020
1 parent a2d11aa commit ee13902
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions theme/ckeditor5-ui/components/toolbar/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
padding: 0 var(--ck-spacing-small);
border: 1px solid var(--ck-color-toolbar-border);

& .ck.ck-toolbar__separator {
align-self: stretch;
width: 1px;
min-width: 1px;
margin-top: 0;
margin-bottom: 0;
background: var(--ck-color-toolbar-border);
}

& > .ck-toolbar__items {
& > * {
/* Make sure items wrapped to the next line have v-spacing */
Expand All @@ -22,6 +31,12 @@
/* (#11) Separate toolbar items. */
margin-right: var(--ck-spacing-small);
}

/* Don't display a separator after an empty items container, for instance,
when all items were grouped */
&:empty + .ck.ck-toolbar__separator {
display: none;
}
}

&.ck-toolbar_vertical {
Expand Down Expand Up @@ -88,15 +103,6 @@
}
}

& .ck.ck-toolbar__separator {
align-self: stretch;
width: 1px;
min-width: 1px;
margin-top: 0;
margin-bottom: 0;
background: var(--ck-color-toolbar-border);
}

@nest .ck-toolbar-container & {
border: 0;
}
Expand All @@ -108,10 +114,6 @@
*/
[dir="rtl"] .ck.ck-toolbar,
.ck.ck-toolbar[dir="rtl"] {
& > .ck.ck-toolbar__grouped-dropdown {
padding-right: var(--ck-spacing-small);
}

& > .ck.ck-toolbar__items {
& > * {
/* (#11) Separate toolbar items. */
Expand All @@ -124,8 +126,14 @@
}
}

/* Separate the the separator form the grouping dropdown when some items are grouped. */
/* stylelint-disable-next-line no-descending-specificity */
& > .ck.ck-toolbar__separator {
margin-left: var(--ck-spacing-small);
}

/* Some spacing between the items and the separator before the grouped items dropdown. */
&.ck-toolbar_grouping > .ck-toolbar__items:not(:only-child) {
&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {
margin-left: var(--ck-spacing-small);
}
}
Expand All @@ -136,18 +144,20 @@
*/
[dir="ltr"] .ck.ck-toolbar,
.ck.ck-toolbar[dir="ltr"] {
& > .ck.ck-toolbar__grouped-dropdown {
padding-left: var(--ck-spacing-small);
}

& > .ck.ck-toolbar__items {
& > *:last-child {
margin-right: 0;
}
}

/* Separate the the separator form the grouping dropdown when some items are grouped. */
/* stylelint-disable-next-line no-descending-specificity */
& > .ck.ck-toolbar__separator {
margin-right: var(--ck-spacing-small);
}

/* Some spacing between the items and the separator before the grouped items dropdown. */
&.ck-toolbar_grouping > .ck-toolbar__items:not(:only-child) {
&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {
margin-right: var(--ck-spacing-small);
}
}

0 comments on commit ee13902

Please sign in to comment.