diff --git a/packages/web/CONTRIBUTING.md b/packages/web/CONTRIBUTING.md index 2304efa8d7..d2ee0fc3d5 100644 --- a/packages/web/CONTRIBUTING.md +++ b/packages/web/CONTRIBUTING.md @@ -14,7 +14,7 @@ This is an example of a typical file structure of a component: -``` +```txt ├── src ├── scss │ └── components @@ -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 @@ -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. @@ -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 @@ -193,7 +193,7 @@ great portion of encapsulation, traceability, and more. Does @use behave the same way as @import? 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]. @@ -217,12 +217,11 @@ To avoid conflicts, we need a convention to distinguish situations when somethin - `id` attribute can be used by **JS only**. -[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 diff --git a/packages/web/README.md b/packages/web/README.md index 17ea959d8d..1c369f96d2 100644 --- a/packages/web/README.md +++ b/packages/web/README.md @@ -1,5 +1,10 @@ + + + # @lmc-eu/spirit-web + + > CSS implementation of Spirit Design System. ## Install @@ -73,7 +78,7 @@ module.exports = { Some components require JavaScript plugins for their full functionality. You can use individual modules or compiled bundle. -#### Individual or compiled +#### Individual or Compiled Plugins can be included individually as an EcmaScript module (using `import { } from '@lmc-eu/spirit-web'`, see [Using Spirit Web as a module](#using-spirit-web-as-a-module)), or all at once using `js/{cjs|esm|bundle}/spirit-web.js` or the minified `js/{cjs|esm|bundle}/spirit-web.min.js` (do not include both), all files are UMD ready. @@ -83,7 +88,7 @@ Plugins can be included individually as an EcmaScript module (using `import {

``` -#### Data attributes +#### Data Attributes Nearly all Spirit-Web plugins can be enabled and configured through HTML alone with data attributes (our preferred way of using JavaScript functionality). Be sure to only use one set of data attributes on a single element (e.g., you cannot trigger a tooltip and modal from the same button.). @@ -136,7 +141,7 @@ var modal = new Modal(myModalEl); // initialized with defaults If you’d like to get a particular plugin instance, each plugin exposes a `getInstance` method. -#### CSS selectors in constructors +#### CSS Selectors in Constructors You can also use a CSS selector as the first argument instead of a DOM element to initialize the plugin. Currently the element for the plugin is found by the `querySelector` method since our plugins support a single element only. @@ -171,7 +176,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 @@ -186,7 +191,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 diff --git a/packages/web/src/scss/components/Accordion/README.md b/packages/web/src/scss/components/Accordion/README.md index fcf9d5a8de..a92930b804 100644 --- a/packages/web/src/scss/components/Accordion/README.md +++ b/packages/web/src/scss/components/Accordion/README.md @@ -14,7 +14,7 @@ Building blocks: - Collapse - Accordion content -### Accordion +### Accordion Component Common wrapper for all items: @@ -172,7 +172,7 @@ When you put it all together: ``` -### Open only one item at a time +### Open Inly One Item at a Time Link individual **Collapse items** to their **Accordion parent** via `data-spirit-parent` attribute to allow just a single item being open at a time. diff --git a/packages/web/src/scss/components/Breadcrumbs/README.md b/packages/web/src/scss/components/Breadcrumbs/README.md index 1541456c2e..7f32b67929 100644 --- a/packages/web/src/scss/components/Breadcrumbs/README.md +++ b/packages/web/src/scss/components/Breadcrumbs/README.md @@ -38,7 +38,7 @@ Shows where the user is within the app hierarchy. ``` -### Dealing with long titles +### Dealing with Long Titles When you need to shorten the title of the Breadcrumbs item you can use a helper class `text-truncate` with defined width. diff --git a/packages/web/src/scss/components/Checkbox/README.md b/packages/web/src/scss/components/Checkbox/README.md index e778268d45..fbb77113d1 100644 --- a/packages/web/src/scss/components/Checkbox/README.md +++ b/packages/web/src/scss/components/Checkbox/README.md @@ -1,6 +1,6 @@ # Checkbox -## Basic usage: +## Basic Usage ```html ``` -## Required input: +## Required Input ```html ``` -## Validation State with Validation Text: +## Validation State with Validation Text See Validation state [dictionary][dictionary-validation]. @@ -47,7 +47,7 @@ See Validation state [dictionary][dictionary-validation]. ``` -## Hidden label: +## Hidden Label ```html ``` -## Helper Text: +## Helper Text ```html ``` -## Disabled state: +## Disabled State ```html ``` -## As an Item: +## As an Item ```html

``` -## Usage with top-end align +## Usage with Top End Align ```html ``` -## Usage with disabled autoclose +## Usage with Disabled Autoclose ```html ``` -## Usage with full width mode `all` +## Usage with Full Width Mode All ```html ``` -## Usage with full width mode `mobile-only` +## Usage with Full Width Mode Mobile-Only ```html ``` -## Usage with [Item] component +## Usage with [Item][item] Component ```html