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

Commit f152dfc

Browse files
authored
Merge pull request #345 from ckeditor/t/144
Other: Migrated the package styles from SASS to PostCSS to bring theme support and avoid duplicates in some editor builds. Closes #144. Closes ckeditor/ckeditor5#420. BREAKING CHANGE: The styles are no longer developed in SASS which means the `.scss` files became unavailable. Please refer to the [Theme Customization](https://docs.ckeditor.com/ckeditor5/latest/framework/guides/ui/theme-customization.html) guide to learn more about migration to PostCSS.
2 parents 876f681 + 27ef57c commit f152dfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+424
-394
lines changed

src/button/buttonview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import TooltipView from '../tooltip/tooltipview';
1313

1414
import { getEnvKeystrokeText } from '@ckeditor/ckeditor5-utils/src/keyboard';
1515

16+
import '../../theme/components/button/button.css';
17+
1618
/**
1719
* The button view class.
1820
*

src/dropdown/dropdownview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import View from '../view';
1111
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
1212
import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
1313

14+
import '../../theme/components/dropdown/dropdown.css';
15+
1416
/**
1517
* The dropdown view class.
1618
*

src/editorui/boxed/boxededitoruiview.js

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
import EditorUIView from '../../editorui/editoruiview';
11+
import LabelView from '../../label/labelview';
1112
import uid from '@ckeditor/ckeditor5-utils/src/uid';
1213

1314
/**
@@ -25,7 +26,6 @@ export default class BoxedEditorUIView extends EditorUIView {
2526
constructor( locale ) {
2627
super( locale );
2728

28-
const t = this.t;
2929
const ariaLabelUid = uid();
3030

3131
/**
@@ -46,6 +46,15 @@ export default class BoxedEditorUIView extends EditorUIView {
4646
*/
4747
this.main = this.createCollection();
4848

49+
/**
50+
* Voice label of the UI.
51+
*
52+
* @protected
53+
* @readonly
54+
* @member {module:ui/view~View} #_voiceLabelView
55+
*/
56+
this._voiceLabelView = this._createVoiceLabel( ariaLabelUid );
57+
4958
this.setTemplate( {
5059
tag: 'div',
5160

@@ -62,17 +71,7 @@ export default class BoxedEditorUIView extends EditorUIView {
6271
},
6372

6473
children: [
65-
{
66-
tag: 'span',
67-
attributes: {
68-
id: `cke-editor__aria-label_${ ariaLabelUid }`,
69-
class: 'cke-voice-label'
70-
},
71-
children: [
72-
// TODO: Editor name?
73-
t( 'Rich Text Editor' )
74-
]
75-
},
74+
this._voiceLabelView,
7675
{
7776
tag: 'div',
7877
attributes: {
@@ -92,4 +91,26 @@ export default class BoxedEditorUIView extends EditorUIView {
9291
]
9392
} );
9493
}
94+
95+
/**
96+
* Creates a voice label view instance.
97+
*
98+
* @private
99+
* @returns {module:ui/label/labelview~LabelView}
100+
*/
101+
_createVoiceLabel( ariaLabelUid ) {
102+
const t = this.t;
103+
const voiceLabel = new LabelView();
104+
105+
voiceLabel.text = t( 'Rich Text Editor' );
106+
107+
voiceLabel.extendTemplate( {
108+
attributes: {
109+
id: `cke-editor__aria-label_${ ariaLabelUid }`,
110+
class: 'cke-voice-label'
111+
}
112+
} );
113+
114+
return voiceLabel;
115+
}
95116
}

src/editorui/editoruiview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import View from '../view';
1313
import Template from '../template';
1414

15+
import '../../theme/components/editorui/editorui.css';
16+
1517
/**
1618
* The editor UI view class. Base class for the editor main views.
1719
*

src/icon/iconview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import View from '../view';
1313

14+
import '../../theme/components/icon/icon.css';
15+
1416
/**
1517
* The icon view class.
1618
*

src/inputtext/inputtextview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
import View from '../view';
1111

12+
import '../../theme/components/inputtext/inputtext.css';
13+
1214
/**
1315
* The text input view class.
1416
*

src/label/labelview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
import View from '../view';
1111

12+
import '../../theme/components/label/label.css';
13+
1214
/**
1315
* The label view class.
1416
*

src/list/listview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
1212
import FocusCycler from '../focuscycler';
1313
import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
1414

15+
import '../../theme/components/list/list.css';
16+
1517
/**
1618
* The list view class.
1719
*

src/panel/balloon/balloonpanelview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import isElement from '@ckeditor/ckeditor5-utils/src/lib/lodash/isElement';
1414
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
1515
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
1616

17+
import '../../../theme/components/panel/balloonpanel.css';
18+
1719
const toPx = toUnit( 'px' );
1820
const defaultLimiterElement = global.document.body;
1921

src/panel/sticky/stickypanelview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import View from '../../view';
1212
import Template from '../../template';
1313
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
1414

15+
import '../../../theme/components/panel/stickypanel.css';
16+
1517
const toPx = toUnit( 'px' );
1618

1719
/**

0 commit comments

Comments
 (0)