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

Commit

Permalink
Merge pull request #146 from ckeditor/t/ckeditor5/816
Browse files Browse the repository at this point in the history
Other: Adjusted the `border-radius` of the various UI components (drop-down, dropdown panel, list drop-down, and split button) for a better look when placed next to one another. Closes ckeditor/ckeditor5#816.
  • Loading branch information
oleq committed Feb 21, 2018
2 parents ebc23cb + 383dcbf commit d81568d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
16 changes: 13 additions & 3 deletions theme/ckeditor5-ui/components/dropdown/dropdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
@mixin ck-disabled;
}

/* https://github.com/ckeditor/ckeditor5/issues/816 */
&.ck-on {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}

/* #23 */
& .ck-button__label {
width: 7em;
Expand All @@ -51,11 +57,15 @@
@mixin ck-rounded-corners;
@mixin ck-drop-shadow;

/* Disabled radius of top-left border to be consistent with .dropdown__button
https://github.com/ckeditor/ckeditor5/issues/816 */
@mixin ck-rounded-corners {
border-top-left-radius: 0;
}

background: var(--ck-color-dropdown-panel-background);
border: 1px solid var(--ck-color-dropdown-panel-border);

/* Compensate double border from button and from box when positioned below the button. */
bottom: 1px;
bottom: 0;

/* Make sure the panel is at least as wide as the dropdown's button. */
min-width: 100%;
Expand Down
20 changes: 15 additions & 5 deletions theme/ckeditor5-ui/components/dropdown/listdropdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
* For licensing, see LICENSE.md.
*/

/* Using absolute units to make sure each element has the same height and padding.
https://github.com/ckeditor/ckeditor5-heading/issues/63 */
.ck-dropdown .ck-dropdown__panel .ck-list__item {
line-height: calc(.8*var(--ck-line-height-base)*var(--ck-font-size-base));
padding: calc(.4*var(--ck-line-height-base)*var(--ck-font-size-base));
@import "../../../mixins/_rounded.css";

.ck-dropdown .ck-dropdown__panel .ck-list {
/* Disabled radius of top-left border to be consistent with .dropdown__button
https://github.com/ckeditor/ckeditor5/issues/816 */
@mixin ck-rounded-corners {
border-top-left-radius: 0;
}

/* Using absolute units to make sure each element has the same height and padding.
https://github.com/ckeditor/ckeditor5-heading/issues/63 */
& > .ck-list__item {
line-height: calc(.8*var(--ck-line-height-base)*var(--ck-font-size-base));
padding: calc(.4*var(--ck-line-height-base)*var(--ck-font-size-base));
}
}
14 changes: 14 additions & 0 deletions theme/ckeditor5-ui/components/dropdown/splitbutton.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,18 @@
border-left-color: var(--ck-color-split-button-hover-border);
}
}

/* Don't round the bottom left and right corners of the buttons when "open"
https://github.com/ckeditor/ckeditor5/issues/816 */
&.ck-splitbutton_open {
@mixin ck-rounded-corners {
& > .ck-splitbutton__action {
border-bottom-left-radius: 0;
}

& > .ck-splitbutton__arrow {
border-bottom-right-radius: 0;
}
}
}
}

0 comments on commit d81568d

Please sign in to comment.