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

Commit e66f921

Browse files
committed
Other: Increased the specificity of CSS rules. Introduced the .ck class for editor UI components (see: ckeditor/ckeditor5#494).
1 parent 0a6154d commit e66f921

9 files changed

+19
-11
lines changed

src/linkediting.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ export default class LinkEditing extends Plugin {
8080
const doc = model.document;
8181
const highlightDescriptor = {
8282
id: 'linkBoundaries',
83-
class: 'ck-link_selected',
83+
class: [
84+
'ck',
85+
'ck-link_selected'
86+
],
8487
priority: 1
8588
};
8689

src/ui/linkactionsview.js

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export default class LinkActionsView extends View {
114114

115115
attributes: {
116116
class: [
117+
'ck',
117118
'ck-link-actions',
118119
],
119120

@@ -202,6 +203,7 @@ export default class LinkActionsView extends View {
202203
button.extendTemplate( {
203204
attributes: {
204205
class: [
206+
'ck',
205207
'ck-link-actions__preview'
206208
],
207209
href: bind.to( 'href' ),

src/ui/linkformview.js

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export default class LinkFormView extends View {
111111

112112
attributes: {
113113
class: [
114+
'ck',
114115
'ck-link-form',
115116
],
116117

tests/linkediting.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe( 'LinkEditing', () => {
166166
);
167167

168168
expect( getViewData( view ) ).to.equal(
169-
'<p>foo <span class="ck-link_selected"><a href="url">b{}ar</a></span> baz</p>'
169+
'<p>foo <span class="ck ck-link_selected"><a href="url">b{}ar</a></span> baz</p>'
170170
);
171171
} );
172172

@@ -188,7 +188,7 @@ describe( 'LinkEditing', () => {
188188
expect( marker.getEnd().path ).to.deep.equal( [ 0, 7 ] );
189189

190190
expect( getViewData( view ) ).to.equal(
191-
'<p>foo <span class="ck-link_selected"><a href="url">{}bar</a></span> baz</p>'
191+
'<p>foo <span class="ck ck-link_selected"><a href="url">{}bar</a></span> baz</p>'
192192
);
193193
} );
194194

@@ -204,7 +204,7 @@ describe( 'LinkEditing', () => {
204204
expect( marker.getEnd().path ).to.deep.equal( [ 0, 7 ] );
205205

206206
expect( getViewData( view ) ).to.equal(
207-
'<p>foo <span class="ck-link_selected"><a href="url">bar{}</a></span> baz</p>'
207+
'<p>foo <span class="ck ck-link_selected"><a href="url">bar{}</a></span> baz</p>'
208208
);
209209
} );
210210

@@ -233,7 +233,7 @@ describe( 'LinkEditing', () => {
233233
);
234234

235235
expect( getViewData( view ) ).to.equal(
236-
'<p>foo <span class="ck-link_selected"><a href="url">li{}nk</a></span> baz</p>'
236+
'<p>foo <span class="ck ck-link_selected"><a href="url">li{}nk</a></span> baz</p>'
237237
);
238238

239239
expect( model.markers.has( 'linkBoundaries' ) ).to.be.true;
@@ -251,15 +251,15 @@ describe( 'LinkEditing', () => {
251251
);
252252

253253
expect( getViewData( view ) ).to.equal(
254-
'<p>foo <span class="ck-link_selected"><a href="url">li{}nk</a></span> baz</p>'
254+
'<p>foo <span class="ck ck-link_selected"><a href="url">li{}nk</a></span> baz</p>'
255255
);
256256

257257
expect( model.markers.has( 'linkBoundaries' ) ).to.be.true;
258258
model.change( writer => writer.setSelection( model.document.getRoot().getChild( 0 ), 5 ) );
259259

260260
expect( model.markers.has( 'linkBoundaries' ) ).to.be.true;
261261
expect( getViewData( view ) ).to.equal(
262-
'<p>foo <span class="ck-link_selected"><a href="url">l{}ink</a></span> baz</p>'
262+
'<p>foo <span class="ck ck-link_selected"><a href="url">l{}ink</a></span> baz</p>'
263263
);
264264
} );
265265
} );

tests/linkui.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ describe( 'LinkUI', () => {
250250
const spy = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
251251

252252
expect( getViewData( view ) ).to.equal(
253-
'<p><span class="ck-link_selected"><a href="url">f{}oo</a></span></p>'
253+
'<p><span class="ck ck-link_selected"><a href="url">f{}oo</a></span></p>'
254254
);
255255

256256
const root = viewDocument.getRoot();
@@ -319,7 +319,7 @@ describe( 'LinkUI', () => {
319319
const spyUpdate = testUtils.sinon.stub( balloon, 'updatePosition' ).returns( {} );
320320
const spyHide = testUtils.sinon.spy( linkUIFeature, '_hideUI' );
321321

322-
expect( getViewData( view ) ).to.equal( '<p><span class="ck-link_selected"><a href="url">f{}oo</a></span></p>' );
322+
expect( getViewData( view ) ).to.equal( '<p><span class="ck ck-link_selected"><a href="url">f{}oo</a></span></p>' );
323323

324324
const root = viewDocument.getRoot();
325325
const text = root.getChild( 0 ).getChild( 0 ).getChild( 0 ).getChild( 0 );

tests/ui/linkactionsview.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe( 'LinkActionsView', () => {
2424

2525
describe( 'constructor()', () => {
2626
it( 'should create element from template', () => {
27+
expect( view.element.classList.contains( 'ck' ) ).to.true;
2728
expect( view.element.classList.contains( 'ck-link-actions' ) ).to.true;
2829
expect( view.element.getAttribute( 'tabindex' ) ).to.equal( '-1' );
2930
} );

tests/ui/linkformview.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe( 'LinkFormView', () => {
2626

2727
describe( 'constructor()', () => {
2828
it( 'should create element from template', () => {
29+
expect( view.element.classList.contains( 'ck' ) ).to.true;
2930
expect( view.element.classList.contains( 'ck-link-form' ) ).to.true;
3031
expect( view.element.getAttribute( 'tabindex' ) ).to.equal( '-1' );
3132
} );

theme/linkactions.css

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

6-
.ck-link-actions {
6+
.ck.ck-link-actions {
77
& .ck-link-actions__preview {
88
display: inline-block;
99

theme/linkform.css

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

6-
.ck-link-form {
6+
.ck.ck-link-form {
77
& .ck-labeled-input {
88
display: inline-block;
99
}

0 commit comments

Comments
 (0)