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 #138 from ckeditor/t/ckeditor5/820
Browse files Browse the repository at this point in the history
Other: Increased the spacing in the toolbar by making the buttons bigger. Unified rendering of several components. Closes ckeditor/ckeditor5#820.
  • Loading branch information
dkonopka committed Feb 15, 2018
2 parents c9ae59c + ea690f5 commit f223d6a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
3 changes: 2 additions & 1 deletion theme/ckeditor5-link/linkactions.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
}

& .ck-button.ck-link-actions__preview {
padding: 0;
padding-left: 0;
padding-right: 0;

&,
&:hover,
Expand Down
12 changes: 4 additions & 8 deletions theme/ckeditor5-ui/components/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ a.ck-button {
padding: var(--ck-spacing-tiny);
text-align: center;

/* A very important piece of styling. Go to variable declaration to learn more. */
min-width: var(--ck-ui-component-min-height);
min-height: var(--ck-ui-component-min-height);

/* Normalize the height of the line. Removing this will break consistent height
among text and text-less buttons (with icons). */
line-height: 1;
Expand Down Expand Up @@ -67,14 +71,6 @@ a.ck-button {
}
}

&:not(.ck-button_with-text) .ck-button__icon {
/* This margin is neccessary for icons in label-less buttons to stretch
the button properly. When there's no text in the button, browsers render
them too small. It's a really tricky topic, when browsers render svg as an inline
content and line size (character width) measurement and alignment kicks in. */
margin: var(--ck-spacing-tiny);
}

& .ck-button__label {
/* Enable font size inheritance, which allows fluid UI scaling. */
font-size: inherit;
Expand Down
3 changes: 3 additions & 0 deletions theme/ckeditor5-ui/components/dropdown/splitbutton.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
/* Disable a double border between the button and the arrow button. */
border-left: 0;

/* It's a text-less button but still, it should not be square. */
min-width: unset;

/* Don't round the arrow button on the right side */
@mixin ck-rounded-corners {
border-top-left-radius: unset;
Expand Down
3 changes: 3 additions & 0 deletions theme/ckeditor5-ui/components/inputtext/inputtext.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
padding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);
min-width: var(--ck-input-text-width);

/* This is important to stay of the same height as surrounding buttons */
min-height: var(--ck-ui-component-min-height);

&:focus {
@mixin ck-focus-ring;
@mixin ck-box-shadow var(--ck-focus-outer-shadow), var(--ck-inner-shadow);
Expand Down
8 changes: 8 additions & 0 deletions theme/ckeditor5-ui/globals/_reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
* For licensing, see LICENSE.md.
*/

:root {
/* This is super-important. This is **manually** adjusted so a button without an icon
is never smaller than a button with icon, additionally making sure that text-less buttons
are perfect squares. The value is also shared by other components which should stay "in-line"
with buttons. */
--ck-ui-component-min-height: 2.3em;
}

/**
* Resets an element, ignoring its children.
*/
Expand Down
2 changes: 1 addition & 1 deletion theme/ckeditor5-ui/globals/_spacing.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
--ck-spacing-standard: var(--ck-spacing-unit);
--ck-spacing-medium: calc(var(--ck-spacing-unit) * 0.8);
--ck-spacing-small: calc(var(--ck-spacing-unit) * 0.5);
--ck-spacing-tiny: calc(var(--ck-spacing-unit) * 0.25);
--ck-spacing-tiny: calc(var(--ck-spacing-unit) * 0.3);
--ck-spacing-extra-tiny: calc(var(--ck-spacing-unit) * 0.16);
}
1 change: 0 additions & 1 deletion theme/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
* Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

0 comments on commit f223d6a

Please sign in to comment.