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

Commit 531aec2

Browse files
authoredMar 15, 2018
Merge pull request #162 from ckeditor/t/ckeditor5-image/187
Feature: Implemented .ck-button_save and _cancel classes with distinctive colors (see ckeditor/ckeditor5-image#187).
2 parents dcf8599 + 8b5a340 commit 531aec2

File tree

7 files changed

+29
-16
lines changed

7 files changed

+29
-16
lines changed
 

‎docs/_snippets/examples/custom.css

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
--ck-color-button-action-disabled-background: hsl(168, 76%, 42%);
4646
--ck-color-button-action-text: var(--ck-custom-white);
4747

48+
--ck-color-button-save: hsl(120, 100%, 46%);
49+
--ck-color-button-cancel: hsl(15, 100%, 56%);
50+
4851
/* -- Overrides the default .ck-dropdown class colors --------------------------------------- */
4952

5053
--ck-color-dropdown-panel-background: var(--ck-custom-background);

‎docs/framework/guides/theme-customization.md

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ The file containing custom variables will be named `custom.css` and it will look
111111
--ck-color-button-action-disabled-background: hsl(168, 76%, 42%);
112112
--ck-color-button-action-text: var(--ck-custom-white);
113113

114+
--ck-color-button-save: hsl(120, 100%, 46%);
115+
--ck-color-button-cancel: hsl(15, 100%, 56%);
116+
114117
/* -- Overrides the default .ck-dropdown class colors --------------------------------------- */
115118

116119
--ck-color-dropdown-panel-background: var(--ck-custom-background);

‎tests/manual/inverted.html

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
--ck-color-button-action-disabled-background: hsl(168, 76%, 42%);
4040
--ck-color-button-action-text: var(--ck-custom-white);
4141

42+
--ck-color-button-save: hsl(120, 100%, 46%);
43+
--ck-color-button-cancel: hsl(15, 100%, 56%);
44+
4245
/* -- Overrides the default .ck-dropdown class colors --------------------------------------- */
4346

4447
--ck-color-dropdown-panel-background: var(--ck-custom-background);

‎tests/manual/theme.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import LabeledInputView from '@ckeditor/ckeditor5-ui/src/labeledinput/labeledinp
2323

2424
import boldIcon from '@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg';
2525
import italicIcon from '@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg';
26+
import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg';
27+
import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg';
28+
2629
import SplitButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview';
2730

2831
class TextView extends View {
@@ -114,9 +117,11 @@ function renderButton() {
114117
const actionButton = button( { label: 'Action button' } );
115118
const roundedButton = button( { label: 'Rounded corners' } );
116119
const boldButton = button( { label: 'Bold text' } );
120+
const saveButton = button( { label: 'Save', withText: false, icon: checkIcon } );
121+
const cancelButton = button( { label: 'Cancel', withText: false, icon: cancelIcon } );
117122

118123
ui.buttonTypes.add( toolbar( [
119-
actionButton, roundedButton, boldButton
124+
actionButton, roundedButton, boldButton, saveButton, cancelButton
120125
] ) );
121126

122127
// TODO: It requires model interface.
@@ -128,6 +133,9 @@ function renderButton() {
128133
// TODO: It requires model interface.
129134
boldButton.element.classList.add( 'ck-button-bold' );
130135

136+
saveButton.element.classList.add( 'ck-button-save' );
137+
cancelButton.element.classList.add( 'ck-button-cancel' );
138+
131139
// --- Icon ------------------------------------------------------------
132140

133141
ui.buttonIcon.add( toolbar( [

‎theme/ckeditor5-link/link.css

-15
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,8 @@
33
* For licensing, see LICENSE.md.
44
*/
55

6-
:root {
7-
--ck-color-link-form-save-icon: hsl(120, 100%, 27%);
8-
--ck-color-link-form-cancel-icon: hsl(15, 100%, 43%);
9-
}
10-
116
/* Class added to span element surrounding currently selected link. */
127
.ck-link_selected {
138
background: var(--ck-color-link-selected-background);
149
outline: 1px solid var(--ck-color-link-selected-background);
1510
}
16-
17-
.ck-link-form .ck-button {
18-
&:first-of-type {
19-
color: var(--ck-color-link-form-save-icon);
20-
}
21-
22-
&:last-of-type {
23-
color: var(--ck-color-link-form-cancel-icon);
24-
}
25-
}

‎theme/ckeditor5-ui/components/button/button.css

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ a.ck-button {
6868
@mixin ck-button-colors --ck-color-button-on;
6969
}
7070

71+
&.ck-button-save {
72+
color: var(--ck-color-button-save);
73+
}
74+
75+
&.ck-button-cancel {
76+
color: var(--ck-color-button-cancel);
77+
}
78+
7179
& .ck-button__icon {
7280
& use,
7381
& use * {

‎theme/ckeditor5-ui/globals/_colors.css

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
--ck-color-button-action-disabled-background: hsl(104, 44%, 58%);
4343
--ck-color-button-action-text: var(--ck-color-base-background);
4444

45+
--ck-color-button-save: hsl(120, 100%, 27%);
46+
--ck-color-button-cancel: hsl(15, 100%, 43%);
47+
4548
/* -- Dropdown ------------------------------------------------------------------------------ */
4649

4750
--ck-color-dropdown-panel-background: var(--ck-color-base-background);

0 commit comments

Comments
 (0)