├── .github ├── CODEOWNERS ├── CONTRIBUTING.md └── pull_request_template.md ├── CHANGELOG.md ├── README.md ├── accessibility └── README.md ├── assets └── logo.png ├── css └── README.md ├── frame ├── README.md ├── css │ └── README.md ├── html │ └── README.md ├── liquid │ └── README.md └── vs-code │ └── README.md ├── html-vue-template └── README.md ├── javascript-vue-sfc └── README.md ├── liquid ├── README.md └── setting-states.md └── vs-code └── README.md /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # GitHub code owners file 2 | # Each line is a file pattern followed by one or more owners. 3 | # Code owners are will be requested for review when someone opens a pull request. 4 | # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners 5 | 6 | # Global owners. 7 | # Space separated list of GitHub usernames. 8 | # Remove comment to enable. 9 | * @craigsbaldwin 10 | 11 | # Example of a JavaScript file owner. 12 | # The last matching pattern takes the most precedence. 13 | # *.js @js-owner 14 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # 👩‍💻 Contributing 2 | 3 | Please ensure you are familiar with the below documentation before contributing to the repository: 4 | 5 | * [Coding guidelines](https://github.com/we-make-websites/wmw-coding-guidelines/blob/main/README.md) 6 | * [Branch naming convention](https://www.notion.so/wemakewebsites/Naming-Conventions-3b426d0d1f414488a45dcf76e6d469b8?pvs=4#24619e035c814fc1b1c12866f1e6d9d3) 7 | * [Commit messages convention](https://www.notion.so/wemakewebsites/Naming-Conventions-3b426d0d1f414488a45dcf76e6d469b8?pvs=4#39baa06684a943849be83ab75dd8be6e) 8 | * [Code review guidance](https://www.notion.so/wemakewebsites/Code-Reviews-5ab62ce82fc94cafa30128332279beea) 9 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # What are you trying to accomplish with this PR? 2 | 3 | 8 | 9 | **Task:** 10 | 11 | # Checklist 12 | For contributors (tick when done): 13 | 14 | - [ ] New content has been spell checked 15 | - [ ] New rules have code examples 16 | - [ ] New rules have been added to their respective table of contents 17 | - [ ] Code examples feature valid and guideline compliant code 18 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 📏 Coding Guidelines Changelog 2 | 3 | ## 3.1.0 - 2024-01-11 4 | 5 | * Added _.github/_ folder 6 | * Home - General updates to _README.md_ 7 | * CSS - Updated Property order rule 8 | * CSS - Updated Mobile first rule 9 | * CSS - Updated Responsive banner padding and `aspect-ratio` rules 10 | 11 | ## 3.0.1 - 2023-08-30 12 | 13 | * CSS - Fixed unclosed codeblock 14 | 15 | ## 3.0.0 - 2023-08-23 16 | 17 | * Added accessibility section 18 | 19 | ## 2.8.0 - 2023-08-09 20 | 21 | * CSS - Added `height` & `width` rules 22 | * CSS - Expanded `margin` & `padding` rules with variable calculation details 23 | * CSS - Re-ordered rules to be in alphabetical order 24 | * CSS - Moved spacing category rules into formatting category 25 | 26 | ## 2.7.0 - 2023-05-03 27 | 28 | * CSS - Updated to reflect new rules 29 | 30 | ## 2.6.1 - 2023-04-11 31 | 32 | * CSS - Fixed title linking 33 | 34 | ## 2.6.0 - 2022-10-12 35 | 36 | * General proof reading updates 37 | * Updated Canvas and Frame to be Title case 38 | * Removed permalinks as GitHub adds them automatically 39 | * VS Code - Updated recommended extensions and settings 40 | 41 | ### JavaScript & Vue SFC 42 | * Add if conditions, newlines, passing parameters, and whitespace rules 43 | * Updated array and indents rules 44 | 45 | ## 2.5.0 - 2022-06-21 46 | 47 | * VS Code - Updated recommended extensions to match Canvas 48 | 49 | ## 2.4.1 - 2022-04-06 50 | 51 | * CSS - Fixed title linking 52 | 53 | ## 2.4.0 - 2022-04-06 54 | 55 | * Home - Updated Canvas naming 56 | * CSS - General updates 57 | * CSS - Fixed incorrect usage of `margin` and `padding` 58 | * HTML - General updates 59 | * Liquid - General updates 60 | * Liquid - Updated filter guidelines 61 | * Liquid - Updated commenting guidelines 62 | * JavaScript & Vue SFC - General updates 63 | 64 | ## 2.3.0 - 2022-04-05 65 | 66 | * Liquid - Added order for schema settings 67 | * Liquid - Updated conditional statements 68 | * Liquid - Added setting states page linked from conditional statements 69 | * JavaScript & Vue SFC - Updated title linking 70 | 71 | ## 2.2.0 - 2022-04-05 72 | 73 | * JavaScript & Vue SFC - Added Vue SFC order rule 74 | * JavaScript & Vue SFC - Added variable rules 75 | 76 | ## 2.2.0 - 2021-11-03 77 | 78 | * HTML - Added attribute casing rule 79 | * JavaScript & Vue SFC - Updated array rules 80 | 81 | ## 2.1.0 - 2021-10-26 82 | 83 | * VS Code - Removed bracket colorizer extension 84 | * VS Code - Updated recommended settings to use native bracket colourisation and set stylelint to lint SCSS 85 | 86 | ## 2.0.1 - 2021-08-02 87 | 88 | * JavaScript & Vue SFC - Added note about automatic indenting by `eslint` 89 | * Changelog – Fixed dates 90 | 91 | ## 2.0.0 - 2021-07-29 92 | 93 | * Added Canvas rules 94 | * Moved Frame rules into separate folder 95 | 96 | ## 1.2.4 - 2020-12-01 97 | 98 | * VS Code - Updated extensions list 99 | 100 | ## 1.2.3 - 2019-12-09 101 | 102 | * HTML - Replaced `{% include %}` with `{% render %}` 103 | * Liquid - Replaced `{% include %}` with `{% render %}` 104 | 105 | ## 1.2.2 - 2019-12-09 106 | 107 | * Home - Added VS Code section 108 | * VS Code - Details recommended extensions and settings 109 | 110 | ## 1.2.1 – 2019-10-03 111 | 112 | * CSS – Added proper names for variable naming convention 113 | * CSS – Removed fallback rule for BEM 114 | * HTML – Added rule for `aria-` attributes 115 | * HTML – Made examples make more sense 116 | * HTML – Added attribute values rule 117 | 118 | ## 1.2.0 – 2019-09-25 119 | 120 | * HTML – Added example of multi-line attribute 121 | * Liquid – Re-organised structure 122 | * Liquid – Added section and snippet naming conventions and file structure 123 | 124 | ## 1.1.13 – 2019-08-08 125 | 126 | * All - Added navigational aids 127 | * HTML – Change attributes rule name 128 | * Liquid – Added split characters rule 129 | 130 | ## 1.1.12 – 2019-08-07 131 | 132 | * Changelog – Fixed version numbering 133 | 134 | ## 1.1.11 – 2019-08-01 135 | 136 | * Liquid – Fixed issue with wording 137 | 138 | ## 1.1.10 – 2019-07-11 139 | 140 | * Liquid – Updated spacing & line character limits rule 141 | * Liquid – Standardised `{% if %}` tag language 142 | 143 | ## 1.1.9 – 2019-07-10 144 | 145 | * HTML – Updated title of the spacing rule 146 | * Liquid – Updated `{% include %}` and spacing rule 147 | 148 | ## 1.1.8 – 2019-07-09 149 | 150 | * HTML – Fixed indenting example 151 | * Liquid – Corrected typo 152 | 153 | ## 1.1.7 – 2019-07-03 154 | 155 | * Liquid – Added tag naming rule, updated other rules to use tag naming convention 156 | 157 | ## 1.1.6 – 2019-06-26 158 | 159 | * Changelog – Updated order of changelog items 160 | * Home – Updated home with new content 161 | * HTML – Updated spacing rule 162 | * Liquid – Added `{% include %}` rule 163 | 164 | ## 1.1.5 – 2019-06-20 165 | 166 | * Home – Improving home content 167 | 168 | ## 1.1.4 – 2019-06-20 169 | 170 | * All – Added back to TOC links at the end of each section 171 | * HTML – Added `
` or `` rule 172 | * HTML – Updated spacing and attributes rules 173 | 174 | ## 1.1.3 – 2019-06-20 175 | 176 | * CSS – Fixed broken links 177 | * Home – Enabled HTML and Liquid links 178 | * HTML – Updated spacing rule 179 | * Liquid – Added rules for inline if statements and conditional spacing 180 | * Liquid – Fixed broken links 181 | * Liquid – Re-organised some existing rules 182 | 183 | ## 1.1.2 – 2019-06-14 184 | 185 | * Home – Added introductory text 186 | * Liquid – Added rules for language strings and variable assigning 187 | * Liquid – Fixed broken links in TOC 188 | * Liquid – Grouped variables rules together 189 | 190 | ## 1.1.1 – 2019-06-12 191 | 192 | * Liquid – Added rules for conditional settings, DRY, and snippets 193 | * Liquid – Updated whitespace control rule 194 | * Liquid – Corrected terminology 195 | 196 | ## 1.1.0 – 2019-06-11 197 | 198 | * CSS – Added introductory comments guidelines 199 | * CSS – Corrected typo 200 | * HTML – Began work on guidelines 201 | * Liquid – Began work on guidelines 202 | 203 | ## 1.0.3 – 2019-04-23 204 | 205 | * CSS – Initial release of updated guidelines 206 | * CSS – Minor formatting and naming fixes 207 | * JS – Linked to Shopify's guidelines -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

We Make Websites

2 | 3 | # 📏 Coding Guidelines 4 | 5 | Standards, guidelines, and best practice when working on our Canvas framework. 6 | 7 | Updates to Basis and projects using Basis Adapter must also follow these guidelines. 8 | 9 | For Frame projects [follow these guidelines](frame/README.md). 10 | 11 | ## Table of contents 12 | 13 | * [HTML & Vue `template`](html-vue-template/README.md) 14 | * [Liquid](liquid/README.md) 15 | * [CSS/SCSS](css/README.md) 16 | * [JavaScript & Vue SFC](javascript-vue-sfc/README.md) 17 | * [Accessibility](accessibility/README.md) 18 | * [VS Code](vs-code/README.md) 19 | 20 | ## Why do we need guidelines? 21 | 22 | When working on large, long-running projects, with dozens of developers of differing specialities and abilities, it is important that we all work in a unified way in order to: 23 | 24 | * Keep the code base maintainable 25 | * Keep code transparent, sane, and readable 26 | * Keep the code base scalable 27 | * Maintain the code base's performance 28 | 29 | ## Applying the guidelines 30 | 31 | When you are writing new code you are expected to maintain the guidelines, if you update an existing feature you are expected to update any non-adhering code that you interact with or change. This means you are not expected to fix the whole file when adding new functionality, just the code you write or change. 32 | 33 | Assuming you've followed [project setup](https://we-make-websites.gitbook.io/canvas/guides/project-setup) then your JS, SCSS, and Vue files will be formatted by `eslint --fix` and `stylelint --fix` when you save a supported file. Other `eslint` and `stylelint` errors will be flagged when committing your changes. 34 | 35 | You will have to manually apply the guidelines to HTML and Liquid as there is no linter available. Certain Vue and SCSS rules must also be applied manually as their respective linters don't support them. 36 | 37 | ## Can I contribute to the guidelines? 38 | 39 | Please branch from `main` and submit a pull request to the relevant code owner for review. 40 | 41 | See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for more details on process and code quality when contributing. 42 | -------------------------------------------------------------------------------- /accessibility/README.md: -------------------------------------------------------------------------------- 1 | # Accessibility 2 | 3 | These rules apply to all Liquid, HTML, and Vue `