These contribution guidelines extend the general contribution guidelines, where you can find instructions on how to set up the repository for contributing.
General styling rules are suggested through linting with stylelint. At the moment, these rules are not enforced or applied/fixed automatically. This might change in the future.
Stylesheets define their own dependencies and use namespaces for variables, functions and mixins. Using global scss variables is discouraged.
// DO
@use 'variables/buttons'; // Creates "buttons" namespace by convention
.btn {
background: buttons.$background;
}
// DON'T
@import 'variables/buttons'; // Global import, leads to duplicate output
.btn {
background: $background; // No namespace
}This ensures independent component styles that can be reused. The mechanics of the @use keyword also ensures that no file is loaded twice when generating a CSS bundle, even if it is used more than once.
Component file names are lower- and kebab-cased (floating-label.scss) and don't start with an underscore () as they are not partial scss files - they can be compiled standalone and produce valid, usable CSS._floatingLabel.scss
Licenses of third party packages that are bundled with the output need to be included in the output and delivered with the output code.
Block level content elements (headings, paragraphs, images, lists, ...; html tags without any classes or context) should use the following margin system: define block margins but reset the margin start for the first child and the margin end for the last child. The rules for first and last child should have low specificity.
p { margin-block: 1rem; :where(:first-child) { margin-block-start: 0; } :where(:last-child) {
margin-block-end: 0; } }Run the following command to lint all scss files, create a dist folder and build the output CSS files using gulp. This command also copies the entire Scss source files into the dist folder, making them available for developers.
# Production build
npm run build
# Rebuild on change
npm run startAutomated integration tests are not yet available for the Design System Styles.
This project is using Stylelint with a configuration based on the Sass Guidelines, properties are sorted according to the SMACSS sort order.
# Console output only
npm run lint
# Fix all auto-fixable issues
npm run lint:fixPrettier is used to format .scss files with this configuration. If your editor allows for it, we recommend to enable format on save for .scss files.
npm run formatCommon tasks are present as npm scripts:
# Delete the dist folder
npm run cleanPlease refer to the icon generation guide to learn how to generate a new icon variables file.