From 8b487a8b509f3699476d423cf3a5717c430d844b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Za=C5=84?= Date: Wed, 9 Jul 2025 11:26:24 +0200 Subject: [PATCH 1/3] Updated code style guide. --- docs/framework/contributing/code-style.md | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/framework/contributing/code-style.md b/docs/framework/contributing/code-style.md index 656f07a37dc..e0273dc3c28 100644 --- a/docs/framework/contributing/code-style.md +++ b/docs/framework/contributing/code-style.md @@ -1224,3 +1224,29 @@ import { AIAssistant } from 'ckeditor5-premium-features'; ### SVG imports only in the `@ckeditor/ckeditor5-icons` package This rule ensures that SVG files are imported and exported only in the `@ckeditor/ckeditor5-icons` package. This package should include all icons used in CKEditor 5. + +## CKEditor 5 custom Stylelint rules + +In addition to the rules provided by Stylelint, CKEditor 5 uses a few custom rules described below. + +### Names of CSS variables within `.ck-content`: `ckeditor5-rules/ck-content-variable-name` + +This rule aims to enforce convention of all variables targeting styling of elements within the editor (`.ck-content`) using a common prefix (`--ck-content-*`) + +👎  Example of incorrect code for this rule: + +```css +.ck-content { + width: var(--variable-name); +} +``` + +👍  Example of correct code for this rule: + +```css +.ck-content { + width: var(--ck-content-variable-name); +} +``` + +[History of the change.](https://github.com/ckeditor/ckeditor5/issues/18805) From 77c5e90022c3e22f4751baa7c2a1105ec5668a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Za=C5=84?= Date: Thu, 10 Jul 2025 14:17:45 +0200 Subject: [PATCH 2/3] Bumped stylelint-config-ckeditor5 --- .stylelintrc | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 6cd8ecd2c98..594ca3ac82c 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,7 +1,7 @@ { "extends": "stylelint-config-ckeditor5", "plugins": [ - "stylelint-plugin-ckeditor5-rules/lib/license-header" + "stylelint-plugin-ckeditor5-rules" ], "ignoreFiles": [ "**/dist/**", diff --git a/package.json b/package.json index d3ee9bbb1ce..392c623b4b3 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "schema-utils": "^4.2.0", "sharp": "^0.34.2", "stylelint": "^16.0.0", - "stylelint-config-ckeditor5": "^11.0.0", + "stylelint-config-ckeditor5": "^12.0.0", "svgo": "^3.3.2", "table": "^6.8.1", "terser-webpack-plugin": "^5.0.0", From 6a2cbb84f0379b2516abc4f0c94326cc7ecf88f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Za=C5=84?= Date: Thu, 10 Jul 2025 14:23:26 +0200 Subject: [PATCH 3/3] Bumped missing packages. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 392c623b4b3..6e64cef63d7 100644 --- a/package.json +++ b/package.json @@ -135,9 +135,9 @@ "date-fns": "^4.0.0", "esbuild": "^0.25.0", "eslint": "^9.26.0", - "eslint-config-ckeditor5": "^11.0.0", + "eslint-config-ckeditor5": "^12.0.0", "eslint-formatter-stylish": "^8.40.0", - "eslint-plugin-ckeditor5-rules": "^11.0.0", + "eslint-plugin-ckeditor5-rules": "^12.0.0", "eslint-plugin-import": "^2.31.0", "estree-walker": "^3.0.3", "fs-extra": "^11.0.0",