Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
daenub committed Dec 3, 2024
1 parent 30a9aa9 commit 1769210
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,35 +113,30 @@ At the same time they're not set in stone. If the there is a good reason to chan

### Naming

Every element, class or custom property that will be globally available has to be prefixed with `leu`.
Every element or custom property that will be globally available has to be prefixed with `leu`.

```js
/* Custom elements */
class LeuRadio extends LitElement {
class LeuRadio extends LeuElement {
...
}

window.customElements.define("leu-input", LeuInput)
```

```css
/* CSS class */
.leu-radio-group {
...;
}

/* CSS custom property */
/* CSS custom property of the theme */
:root {
--leu-color-black-0: #000;
}
```

### Scoped styles

All CSS declarations should, whenever possible, always live inside a custom element. This way we ensure that the styles won't interfere with the environment they're loaded into.
The only exceptions are `@font-face` statements and custom property declarations.
All CSS declarations have to live inside a custom element. This way we ensure that the styles won't interfere with the environment they're loaded into.
Styles that are shared between components should be defined as global custom properties inside the `styles/custom-properties.css`.
When a global custom property is used inside a component it should always be assigned to a local custom property in the `:host` declaration block.
When a global custom property is used inside a component it could be a good practice to assign them to a local custom property with a semantic naming.
This only make a sense when the component has a certain complexity and the global custom property are used multiple times.

```css
:host {
Expand Down Expand Up @@ -180,13 +175,11 @@ Thanks to the following people who have contributed to this project
Dan Büschlen <br>
dan.bueschlen@statistik.ji.zh.ch <br>

![Twitter Follow](https://img.shields.io/twitter/follow/statistik_zh?style=social)

## License

This project uses the following license: <br>

- Code license: [Copyright (c) <2023> <Statistisches Amt Kanton Zürich>](LICENSE)
- Code license: [Copyright (c) <2024> <Statistisches Amt Kanton Zürich>](LICENSE)

## Guidelines for contributing

Expand Down

0 comments on commit 1769210

Please sign in to comment.