Skip to content

Commit

Permalink
fixup! Style(repo): Apply markdonw linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Aug 22, 2024
1 parent 62d69f7 commit 980d03c
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Without lexer:
{% endembed %}
```

### API
## API

| Name | Type | Default | Required | Description |
| ------------------ | --------------- | ------- | -------- | ------------------------------------ |
Expand Down
15 changes: 7 additions & 8 deletions packages/web/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

This is an example of a typical file structure of a component:

```
```txt
├── src
├── scss
│ └── components
Expand Down Expand Up @@ -60,7 +60,7 @@ Similarly, component's tools serve as a storage of component-scoped:

## Linking Design Tokens

Components can (and should!) reuse Spirit [design tokens].
Components can (and should!) reuse Spirit [design tokens][design-tokens].

Component's theme properties can be linked to design tokens. This way, the
appearance of individual components is always unified and coherent: **anytime
Expand All @@ -71,7 +71,7 @@ discussion between Spirit developers and designers. Linking component
properties to design tokens needs to be done carefully **in order for the design
to work as a system.**

Default Spirit design tokens live in the [`spirit-design-tokens`] package.
Default Spirit design tokens live in the [`spirit-design-tokens`][design-tokens] package.
Products may define their own design tokens as long as they preserve the same
structure and naming.

Expand All @@ -85,7 +85,7 @@ the [`@tokens` API][tokens-api] with
From the implementation point of view, design tokens are Sass variables
organized in Sass modules. Within component styles, Sass modules with design
tokens are referred to just by filename. However, because the modules do not
exist in the place they are called in (the [`spirit-design-tokens`] package is
exist in the place they are called in (the [`spirit-design-tokens`][design-tokens] package is
stored in `node_modules`), the correct load path for the desired set of design
tokens must be [provided on build time][configuring-load-path]. This is the only
way how Sass modules can be affected from outside, without giving in their
Expand Down Expand Up @@ -193,7 +193,7 @@ great portion of encapsulation, traceability, and more.
<summary>Does <code>@use</code> behave the same way as <code>@import</code>?</summary>

In most situations, no. Most importantly, while `@import` loads everything into
global context, `@use` is scoped and works more like `import` in [ES modules].
global context, `@use` is scoped and works more like `import` in [ES modules][es-modules].

</details>

Expand All @@ -217,12 +217,11 @@ To avoid conflicts, we need a convention to distinguish situations when somethin
- `id` attribute can be used by **JS only**.
</details>

[design tokens]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/design-tokens
[`spirit-design-tokens`]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/design-tokens
[design-tokens]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/design-tokens
[tokens-api]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/design-tokens#tokens-api
[configuring-load-path]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/design-tokens#configuring-load-path
[rebranding]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web#rebranding
[design-tokens-faq]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/design-tokens#faq
[sass-modules]: https://sass-lang.com/blog/the-module-system-is-launched
[es modules]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
[es-modules]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
[sass-true]: https://github.com/oddbird/true
4 changes: 2 additions & 2 deletions packages/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Learn more in the [`spirit-design-tokens` docs][rebranding].

Start local development server with `yarn start` to get started. You will get the live preview of all components and plugins in your browser. Just get dirty and change something and you will see the changes live.

The dev-stack is based on [Vite].
The dev-stack is based on [Vite][vite].

## Deprecations

Expand All @@ -186,7 +186,7 @@ Check your browser console to see if you are using any of the deprecated functio

## Examples

👀 See [examples] for a live demo.
👀 See [examples][examples] for a live demo.

## License

Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/scss/components/Accordion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Building blocks:
- Collapse
- Accordion content

### Accordion
### Accordion component

Common wrapper for all items:

Expand Down
14 changes: 7 additions & 7 deletions packages/web/src/scss/components/Checkbox/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Checkbox

## Basic usage:
## Basic usage

```html
<label for="checkbox-default" class="Checkbox">
Expand All @@ -11,7 +11,7 @@
</label>
```

## Required input:
## Required input

```html
<label for="checkbox-required" class="Checkbox">
Expand All @@ -22,7 +22,7 @@
</label>
```

## Validation State with Validation Text:
## Validation State with Validation Text

See Validation state [dictionary][dictionary-validation].

Expand All @@ -47,7 +47,7 @@ See Validation state [dictionary][dictionary-validation].
</label>
```

## Hidden label:
## Hidden label

```html
<label for="checkbox-hidden-label" class="Checkbox">
Expand All @@ -58,7 +58,7 @@ See Validation state [dictionary][dictionary-validation].
</label>
```

## Helper Text:
## Helper Text

```html
<label for="checkbox-helper-text" class="Checkbox">
Expand All @@ -70,7 +70,7 @@ See Validation state [dictionary][dictionary-validation].
</label>
```

## Disabled state:
## Disabled state

```html
<label for="checkbox-disabled" class="Checkbox Checkbox--disabled">
Expand All @@ -81,7 +81,7 @@ See Validation state [dictionary][dictionary-validation].
</label>
```

## As an Item:
## As an Item

```html
<label for="checkbox-item-default" class="Checkbox Checkbox--item">
Expand Down
8 changes: 4 additions & 4 deletions packages/web/src/scss/components/Collapse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ Hide button when collapse

## Wrapper attributes

| Name | Type | Default | Required | Description |
| ------------------------ | ----------------------- | ------- | -------- | ------------------------------------------------------------------------ |
| `data-spirit-breakpoint` | [`tablet` \| `desktop`] ||| Breakpoint on which the collapsed content is forced to reveal \* |
| `data-spirit-parent` | `string` ||| A parent element selector that ensures that only one item is opened \*\* |
| Name | Type | Default | Required | Description |
| ------------------------ | ------------------------ | ------- | -------- | ------------------------------------------------------------------------ |
| `data-spirit-breakpoint` | \[`tablet` \| `desktop`] ||| Breakpoint on which the collapsed content is forced to reveal \* |
| `data-spirit-parent` | `string` ||| A parent element selector that ensures that only one item is opened \*\* |

There can be several triggers, the same rules apply to each.

Expand Down
8 changes: 4 additions & 4 deletions packages/web/src/scss/components/Dropdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
</div>
```

## Usage with [Item] component
## Usage with [Item][item] component

```html
<div class="Dropdown">
Expand Down Expand Up @@ -267,9 +267,9 @@ There are two options here. Use the trigger element as an anchor or wrap the men

## DropdownPopover

| Attribute | Type | Default | Required | Description |
| --------------------------- | --------------------------------- | ------- | -------- | --------------- |
| `data-spirit-fullwidthmode` | [`off` \| `mobile-only` \| `all`] ||| Full-width mode |
| Attribute | Type | Default | Required | Description |
| --------------------------- | ---------------------------------- | ------- | -------- | --------------- |
| `data-spirit-fullwidthmode` | \[`off` \| `mobile-only` \| `all`] ||| Full-width mode |

## JavaScript API

Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/scss/components/FieldGroup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ To render validation text as a list, use `<ul>` element instead of `<div>`.
When implementing client-side form validation, use JS interaction state classes (`has-success`, `has-warning`,
`has-danger`) on the wrapping `<fieldset>` element and render validation texts in a `<div>` or `<ul>` with
`data-spirit-element="validation_text"` attribute. This way your JS remains disconnected from CSS that may or may not be
[prefixed].
[prefixed][prefixed].

**Remember this approach is only valid for vanilla JS implementation. React components mix CSS with JS by design and
handle prefixes their own way.**
Expand Down
6 changes: 3 additions & 3 deletions packages/web/src/scss/components/FileUploader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FileUploader allows users to pick one or more files to upload.

**FileUploader itself actually does not upload anything to the server.**
> FileUploader itself actually does not upload anything to the server.
FileUploader is a composition of a few subcomponents:

Expand All @@ -25,7 +25,7 @@ Please consult the [main README][web-readme] for how to include JavaScript plugi

Or, feel free to write the controlling script yourself.

## FileUploader
## FileUploader component

This is the main wrapper for the whole composition. It provides proper spacing
for its subcomponents:
Expand Down Expand Up @@ -235,7 +235,7 @@ When implementing client-side form validation, use JS interaction state classes
(`has-success`, `has-warning`, `has-danger`) on the wrapping `<div>` element and
render validation texts in a `<div>` or `<ul>` with `data-spirit-element="validation_text"`
attribute. This way your JS remains disconnected from CSS that may or may not be
[prefixed].
[prefixed][prefixed].

**Remember this approach is only valid for vanilla JS implementation. React
components mix CSS with JS by design and handle CSS class-name prefixes their
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/scss/components/Header/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ building blocks to use:
1. primary actions slot (all breakpoints),
2. secondary actions slot (all breakpoints).

## Header
## Header component

### Mobile-Only Actions

Expand Down Expand Up @@ -487,7 +487,6 @@ And the complete Header Dialog:
✍️ Please do feel free to let us know should you believe this component lacks
some important capabilities. Thank you! 🙏

[examples]: https://spirit-design-system.netlify.app/packages/web/
[web-readme]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web/README.md
[mdn-dialog]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
[offcanvas-docs]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web/src/scss/components/Offcanvas/README.md
2 changes: 1 addition & 1 deletion packages/web/src/scss/components/Item/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Checkbox as a Item:
</label>
```

Usage in [Dropdown] component:
Usage in [Dropdown][dropdown] component:

```html
<div class="DropdownWrapper">
Expand Down
11 changes: 5 additions & 6 deletions packages/web/src/scss/components/Modal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Modal is a composition of several subcomponents:
- [ModalBody](#modalfooter)
- [ModalFooter](#modalfooter)

## Modal
## Modal component

Modal establishes the top layer with a backdrop. Under the hood it uses the [`<dialog>` element][mdn-dialog] which
provides several accessibility advantages.
Expand Down Expand Up @@ -39,7 +39,7 @@ Example:
</dialog>
```

## ModalDialog
## ModalDialog component

ModalDialog is the actual dialog window, a place for the header, body, and footer of the dialog.

Expand Down Expand Up @@ -93,7 +93,7 @@ By default, the docked dialog on mobile screens shrinks to fit the height of its
</article>
```

## ModalHeader
## ModalHeader component

ModalHeader contains the title of the dialog and the close button.

Expand Down Expand Up @@ -130,7 +130,7 @@ the `aria-label` attribute on the `<dialog>` element:
</dialog>
```

## ModalBody
## ModalBody component

ModalBody holds the actual content of the Modal.

Expand All @@ -144,7 +144,7 @@ ModalBody holds the actual content of the Modal.
</div>
```

## ModalFooter
## ModalFooter component

ModalFooter is the place for actions represented by the Button component. While there always must be a primary Button,
secondary actions are optional.
Expand Down Expand Up @@ -456,4 +456,3 @@ Or feel free to write controlling scripts yourself.
[scroll-view]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web/src/scss/components/ScrollView/README.md
[web-readme]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web/README.md
[dictionary-alignment]: https://github.com/lmc-eu/spirit-design-system/blob/main/docs/DICTIONARIES.md#alignment
[readme-feature-flags]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web/README.md#feature-flags

0 comments on commit 980d03c

Please sign in to comment.