Skip to content

Commit

Permalink
Merge pull request #107 from ckeditor/i/106
Browse files Browse the repository at this point in the history
Other: Added the `data-cke-inspector=true` attribute to all `<style>` tags injected by the application. Closes #106.

Also:
* Reduced the number of `<style>` tags injected by the application.
* Used the `.ck-inspector` namespace for CSS custom properties used by the inspector to clean up the developer tools and improve DX.
  • Loading branch information
oleq authored Dec 4, 2020
2 parents 0141bfd + 51eb770 commit ee9cb3f
Show file tree
Hide file tree
Showing 9 changed files with 774 additions and 399 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"react-rnd": "^10.0.0",
"redux": "^4.0.5",
"sinon": "^7.2.3",
"style-loader": "^0.23.1",
"style-loader": "^1.2.1",
"terser-webpack-plugin": "^2.3.5",
"webpack": "^4.29.3",
"webpack-cli": "^3.2.3"
Expand Down
2 changes: 1 addition & 1 deletion src/components/horizontalnav.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

:root {
.ck-inspector {
--ck-inspector-color-tab-background-hover: rgba(0,0,0,.07);
--ck-inspector-color-tab-active-border: #0DACEF
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/navbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

:root {
.ck-inspector {
--ck-inspector-navbox-empty-background: #fafafa;
}

Expand All @@ -30,6 +30,6 @@
display: flex;
flex-direction: row;
height: 100%;
overflow: hidden;
overflow: hidden;
}
}
2 changes: 1 addition & 1 deletion src/components/pane.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

:root {
.ck-inspector {
--ck-inspector-explorer-width: 300px;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/propertylist.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

:root {
.ck-inspector {
--ck-inspector-color-property-list-property-name: #D0363F;
--ck-inspector-color-property-list-property-value-true: green;
--ck-inspector-color-property-list-property-value-false: red;
Expand Down
2 changes: 1 addition & 1 deletion src/components/tree/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

:root {
.ck-inspector {
--ck-inspector-color-tree-node-hover: #EAF2FB;
--ck-inspector-color-tree-node-name: #882680;
--ck-inspector-color-tree-node-attribute-name: #8a8a8a;
Expand Down
2 changes: 1 addition & 1 deletion src/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/

:root {
.ck-inspector {
--ck-inspector-color-white: #fff;
--ck-inspector-color-black: #000;
--ck-inspector-color-background: #F3F3F3;
Expand Down
10 changes: 9 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ module.exports = ( env, argv ) => {
{
test: /\.css$/,
loaders: [
'style-loader',
{
loader: 'style-loader',
options: {
injectType: devMode ? 'styleTag' : 'singletonStyleTag',
attributes: {
'data-cke-inspector': true
}
}
},
{
loader: 'css-loader',
options: {
Expand Down
Loading

0 comments on commit ee9cb3f

Please sign in to comment.