Skip to content

Commit

Permalink
Use space indent style in md files
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicalynch committed Nov 16, 2024
1 parent 66b303c commit 1a1d87b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 44 deletions.
7 changes: 4 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[examples/advanced/tailwind-preset/**/*]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
indent_style = space # indent_size ignored in github codeblocks
82 changes: 41 additions & 41 deletions examples/advanced/tailwind-preset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Builds [Tailwind preset](https://tailwindcss.com/docs/presets#creating-a-preset)

## Building the preset

Run `npm run build-tokens` to generate files in `build/tailwind/`.
Run `npm run build-tokens` to generate these files in `build/tailwind/`:

### cssVarPlugin.js

Expand All @@ -16,21 +16,21 @@ Token values are transformed into space-separated RGB channels for compatability
import plugin from 'tailwindcss/plugin';

export default plugin(function ({ addBase }) {
addBase({
':root': {
'--sd-text-small': '0.75',
'--sd-text-base': '46 46 70',
'--sd-text-secondary': '100 100 115',
'--sd-text-tertiary': '129 129 142',
'--sd-text-neutral': '0 0 0 / 0.55',
'--sd-theme': '31 197 191',
'--sd-theme-light': '153 235 226',
'--sd-theme-dark': '0 179 172',
'--sd-theme-secondary': '106 80 150',
'--sd-theme-secondary-dark': '63 28 119',
'--sd-theme-secondary-light': '196 178 225',
},
});
addBase({
':root': {
'--sd-text-small': '0.75',
'--sd-text-base': '46 46 70',
'--sd-text-secondary': '100 100 115',
'--sd-text-tertiary': '129 129 142',
'--sd-text-neutral': '0 0 0 / 0.55',
'--sd-theme': '31 197 191',
'--sd-theme-light': '153 235 226',
'--sd-theme-dark': '0 179 172',
'--sd-theme-secondary': '106 80 150',
'--sd-theme-secondary-dark': '63 28 119',
'--sd-theme-secondary-light': '196 178 225',
},
});
});
```

Expand All @@ -40,16 +40,16 @@ Tailwind theme color values that reference the plugin css vars.

```js
export default {
'sd-text-base': 'rgb(var(--sd-text-base) / <alpha-value>)',
'sd-text-secondary': 'rgb(var(--sd-text-secondary) / <alpha-value>)',
'sd-text-tertiary': 'rgb(var(--sd-text-tertiary) / <alpha-value>)',
'sd-text-neutral': 'rgba(var(--sd-text-neutral))',
'sd-theme': 'rgb(var(--sd-theme) / <alpha-value>)',
'sd-theme-light': 'rgb(var(--sd-theme-light) / <alpha-value>)',
'sd-theme-dark': 'rgb(var(--sd-theme-dark) / <alpha-value>)',
'sd-theme-secondary': 'rgb(var(--sd-theme-secondary) / <alpha-value>)',
'sd-theme-secondary-dark': 'rgb(var(--sd-theme-secondary-dark) / <alpha-value>)',
'sd-theme-secondary-light': 'rgb(var(--sd-theme-secondary-light) / <alpha-value>)',
'sd-text-base': 'rgb(var(--sd-text-base) / <alpha-value>)',
'sd-text-secondary': 'rgb(var(--sd-text-secondary) / <alpha-value>)',
'sd-text-tertiary': 'rgb(var(--sd-text-tertiary) / <alpha-value>)',
'sd-text-neutral': 'rgba(var(--sd-text-neutral))',
'sd-theme': 'rgb(var(--sd-theme) / <alpha-value>)',
'sd-theme-light': 'rgb(var(--sd-theme-light) / <alpha-value>)',
'sd-theme-dark': 'rgb(var(--sd-theme-dark) / <alpha-value>)',
'sd-theme-secondary': 'rgb(var(--sd-theme-secondary) / <alpha-value>)',
'sd-theme-secondary-dark': 'rgb(var(--sd-theme-secondary-dark) / <alpha-value>)',
'sd-theme-secondary-light': 'rgb(var(--sd-theme-secondary-light) / <alpha-value>)',
};
```

Expand All @@ -62,14 +62,14 @@ import themeColors from './themeColors.js';
import cssVarsPlugin from './cssVarsPlugin.js';

export default {
theme: {
extend: {
colors: {
...themeColors, // <-- theme colors defined here
},
},
},
plugins: [cssVarsPlugin], // <-- plugin imported here
theme: {
extend: {
colors: {
...themeColors, // <-- theme colors defined here
},
},
},
plugins: [cssVarsPlugin], // <-- plugin imported here
};
```

Expand All @@ -82,13 +82,13 @@ import tailwindPreset from './build/tailwind/preset';

/** @type {import('tailwindcss').Config} */
export default {
content: [],
theme: {
extend: {},
},
presets: [tailwindPreset],
content: ['./demo/**/*.{html,js}'],
plugins: [],
content: [],
theme: {
extend: {},
},
presets: [tailwindPreset],
content: ['./demo/**/*.{html,js}'],
plugins: [],
};
```

Expand Down

0 comments on commit 1a1d87b

Please sign in to comment.