From cbe80205275ab1153b0a797c43f99590950899b2 Mon Sep 17 00:00:00 2001 From: LB Johnston Date: Sun, 5 May 2019 15:48:51 +1000 Subject: [PATCH] Docs: Update CSS Guidelines to align with new shared config - also make changes to set up similar sections to JS docs --- docs/contributing/css_guidelines.rst | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/contributing/css_guidelines.rst b/docs/contributing/css_guidelines.rst index 0fc10ad65c..ee2d7a36c2 100644 --- a/docs/contributing/css_guidelines.rst +++ b/docs/contributing/css_guidelines.rst @@ -1,7 +1,7 @@ CSS coding guidelines =========================== -Our CSS is written in Sass, using the SCSS syntax. +Our CSS is written in `Sass `_, using the SCSS syntax. Compiling ~~~~~~~~~ @@ -32,13 +32,16 @@ automatically recompiling when any changes are observed, by running: $ npm start -Linting SCSS -~~~~~~~~~~~~ +Linting and formatting SCSS +~~~~~~~~~~~~~~~~~~~~~~~~~~~ Wagtail uses the `stylelint `_ linter. You'll need Node.js and npm on your development machine. Ensure project dependencies are installed by running ``npm install --no-save`` +Linting code +------------ + Run the linter from the wagtail project root: .. code-block:: console @@ -49,12 +52,27 @@ Run the linter from the wagtail project root: The linter is configured to check your code for adherance to the guidelines below, plus a little more. +Formatting code +--------------- + If you want to autofix errors, you can run that command directly with: .. code-block:: console $ npm run lint:css -- --fix +Changing the linter configuration +--------------------------------- + +To edit ignored files, add an entry to the ``.stylelintrc.yaml`` file under ``ignoreFiles``. + +To the configuration for the linting rules is managed in an external +repository so that it can be easily shared across other Wagtail projects +or plugins. This configuration can be found at +`stylelint-config-wagtail `_. + +Styleguide Reference +~~~~~~~~~~~~~~~~~~~~ Spacing -------