Skip to content

Commit

Permalink
Update formatting style
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning committed Feb 8, 2024
1 parent 5320ac5 commit 3905d9b
Show file tree
Hide file tree
Showing 9 changed files with 1,162 additions and 1,161 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ root = true
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

Expand All @@ -14,3 +14,4 @@ trim_trailing_whitespace = false

[*.{json,yml}]
indent_size = 2
indent_style = space
42 changes: 21 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
module.exports = {
extends: ['@zazen/eslint-config/typescript'],
env: {
node: true,
},
rules: {
'@typescript-eslint/indent': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
extends: ['@zazen/eslint-config/typescript'],
env: {
node: true,
},
rules: {
'@typescript-eslint/indent': 'off',
'@typescript-eslint/space-before-function-paren': 'off',

'@typescript-eslint/explicit-function-return-type': 'off',
},
overrides: [
{
// Jest config
files: [
'**/__tests__/**/*.{js,ts,tsx}',
'**/*.@(spec|test).{js,ts,tsx}',
],
env: {
jest: true,
},
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
},
overrides: [
{
// Jest config
files: [
'**/__tests__/**/*.{js,ts,tsx}',
'**/*.@(spec|test).{js,ts,tsx}',
],
env: {
jest: true,
},
},
],
}
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ This plugin requires a `fontMetrics` key added to your Tailwind theme. It should

```ts
{
ascent: number
descent: number
lineGap: number
unitsPerEm: number
capHeight: number
ascent: number
descent: number
lineGap: number
unitsPerEm: number
capHeight: number
}
```

Expand All @@ -33,24 +33,24 @@ These values can be determined by using the [Capsize website](https://seek-oss.g
```js
// tailwind.config.js
module.exports = {
theme: {
fontFamily: {
sans: ['Inter', 'sans-serif'],
},
fontMetrics: {
sans: {
capHeight: 2048,
ascent: 2728,
descent: -680,
lineGap: 0,
unitsPerEm: 2816,
},
},
fontSize: { ... },
lineHeight: { ... },
...
},
plugins: [require('tailwindcss-capsize')],
theme: {
fontFamily: {
sans: ['Inter', 'sans-serif'],
},
fontMetrics: {
sans: {
capHeight: 2048,
ascent: 2728,
descent: -680,
lineGap: 0,
unitsPerEm: 2816,
},
},
fontSize: { ... },
lineHeight: { ... },
...
},
plugins: [require('tailwindcss-capsize')],
}
```

Expand Down Expand Up @@ -94,12 +94,12 @@ By default the plugin replaces the `fontFamily`, `fontSize`, and `lineHeight` co

```diff
.font-sans {
+ --ascent-scale: 0.9688;
+ --descent-scale: 0.2415;
+ --cap-height-scale: 0.7273;
+ --line-gap-scale: 0;
+ --line-height-scale: 1.2102;
font-family: Inter, sans-serif;
+ --ascent-scale: 0.9688;
+ --descent-scale: 0.2415;
+ --cap-height-scale: 0.7273;
+ --line-gap-scale: 0;
+ --line-height-scale: 1.2102;
font-family: Inter, sans-serif;
}
```

Expand All @@ -119,7 +119,7 @@ Sometimes an interface calls for truncating text to a single line or clamping te
<!-- ❌ Does NOT work -->

<p class="font-sans text-base leading-none capsize truncate">
Text to be truncated to a single line
Text to be truncated to a single line
</p>
```

Expand All @@ -129,7 +129,7 @@ To solve this, a child element to the element with the `.capsize` class should w
<!-- ✅ Does work! -->

<p class="font-sans text-base leading-none capsize">
<span class="truncate">Text to be truncated to a single line</span>
<span class="truncate">Text to be truncated to a single line</span>
</p>
```

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3905d9b

Please sign in to comment.