Web guidelinesΒΆ
Apart from π― Zen, the following guidelines apply to the web development.
HTML guidelinesΒΆ
These rules apply to HTML:
IDβs must use the
kebab-case
formatAttributes use the
kebab-case
formatBoolean attributes will not use prefixes like
isβ¦
,hasβ¦
,canβ¦
CSS guidelinesΒΆ
These rules apply to CSS:
CSS classes must use the
kebab-case
formatCSS
.class
selectors must be used for styling when multiple elements are affectedCSS
#id
selectors can (!= must) be used for styling when only one element is affected
Hint
Most of the CSS coding guidelines are automatically checked by the stylelint.
Also have a look at the Web Component guidelines.
JavaScript guidelinesΒΆ
These rules apply to JavaScript:
Vanilla JavaScript is better than frameworks
ECMAScript 6 is better than their predecessors
Backward compatibility is not required and can be ignored
The
id
attribute must be used to query unique / distinct elements in JavaScript
Hint
Most of the JavaScript coding guidelines are automatically checked by the ESLint.
Also have a look at the Web Component guidelines.
Web Component guidelinesΒΆ
These rules apply to Web Components:
Web components must only be customisable by attributes.
Passing CSS classes to web components is prohibited.
CSS selectors directly on the
:host()
are preferred over any layer of indirection or abstraction.
Hint
Since web components use all web technologies, HTML, JavaScript & CSS coding guidelines are also applied to Web Components.