Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stormwarning/tailwindcss-capsize
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.5
Choose a base ref
...
head repository: stormwarning/tailwindcss-capsize
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 1 commit
  • 11 files changed
  • 1 contributor

Commits on Jan 30, 2025

  1. Update formatting settings

    stormwarning committed Jan 30, 2025
    Copy the full SHA
    0ae2adf View commit details
Showing with 11,190 additions and 10,412 deletions.
  1. +11 −11 .changeset/config.json
  2. +0 −5 .editorconfig
  3. +9 −5 .eslintrc.cjs
  4. +2 −2 .github/renovate.json
  5. +36 −47 __tests__/plugin.test.ts
  6. +2 −1 __tests__/setup.ts
  7. +11,024 −10,230 package-lock.json
  8. +66 −66 package.json
  9. +6 −11 src/plugin.ts
  10. +8 −8 tsconfig.build.json
  11. +26 −26 tsconfig.json
22 changes: 11 additions & 11 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@zazen/changesets-changelog",
{ "repo": "stormwarning/tailwindcss-capsize" }
],
"commit": false,
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@zazen/changesets-changelog",
{ "repo": "stormwarning/tailwindcss-capsize" }
],
"commit": false,
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
}
5 changes: 0 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -4,14 +4,9 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{json,yml}]
indent_size = 2
indent_style = space
14 changes: 9 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -8,14 +8,17 @@ const config = {
env: {
node: true,
},
rules: {},
rules: {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/padding-line-between-statements': 'off',

'n/file-extension-in-import': ['error', 'always'],
},
overrides: [
{
// Jest config
files: [
'**/__tests__/**/*.{js,ts,tsx}',
'**/*.@(spec|test).{js,ts,tsx}',
],
files: ['**/__tests__/**/*.{js,ts,tsx}', '**/*.@(spec|test).{js,ts,tsx}'],
env: {
jest: true,
},
@@ -33,4 +36,5 @@ const config = {
],
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
module.exports = config
4 changes: 2 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>tidaltheory/renovate-config"]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>tidaltheory/renovate-config"]
}
83 changes: 36 additions & 47 deletions __tests__/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../types/vitest.d.ts" />

import { describe, it, expect } from 'vitest'
import { describe, expect, it } from 'vitest'

import capsizePlugin from '../src/index.js'
import { css, html, run } from './run.js'
@@ -85,16 +85,14 @@ describe('Plugin', () => {
.leading-md {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) / var(--font-size-px)
);
line-height: 2.5rem;
}
.leading-sm {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
);
line-height: 20px;
}
@@ -104,23 +102,20 @@ describe('Plugin', () => {
content: '';
margin-bottom: calc(
(
(
var(--ascent-scale) - var(--cap-height-scale) +
var(--line-gap-scale) / 2
) - var(--line-height-offset)
) * -1em
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) *
-1em
);
}
.capsize::after {
display: table;
content: '';
margin-top: calc(
(
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) * -1em
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
-1em
);
}
@@ -146,16 +141,14 @@ describe('Plugin', () => {
.sm\\:leading-md {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) / var(--font-size-px)
);
line-height: 2.5rem;
}
.sm\\:leading-sm {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
);
line-height: 20px;
}
@@ -202,16 +195,14 @@ describe('Plugin', () => {
.leading-md {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 30) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 30) / 2) / var(--font-size-px)
);
line-height: 2.5rem;
}
.leading-sm {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
);
line-height: 20px;
}
@@ -221,23 +212,20 @@ describe('Plugin', () => {
content: '';
margin-bottom: calc(
(
(
var(--ascent-scale) - var(--cap-height-scale) +
var(--line-gap-scale) / 2
) - var(--line-height-offset)
) * -1em
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) *
-1em
);
}
.capsize::after {
display: table;
content: '';
margin-top: calc(
(
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) * -1em
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
-1em
);
}
`),
@@ -281,8 +269,10 @@ describe('Plugin', () => {
(var(--line-height-scale) * var(--font-size-px)) - calc(
1.5 * var(--font-size-px)
)
) / 2
) / var(--font-size-px)
) /
2
) /
var(--font-size-px)
);
line-height: 1.5;
}
@@ -294,8 +284,10 @@ describe('Plugin', () => {
(var(--line-height-scale) * var(--font-size-px)) - calc(
1 * var(--font-size-px)
)
) / 2
) / var(--font-size-px)
) /
2
) /
var(--font-size-px)
);
line-height: 100%;
}
@@ -305,23 +297,20 @@ describe('Plugin', () => {
content: '';
margin-bottom: calc(
(
(
var(--ascent-scale) - var(--cap-height-scale) +
var(--line-gap-scale) / 2
) - var(--line-height-offset)
) * -1em
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) *
-1em
);
}
.capsize::after {
display: table;
content: '';
margin-top: calc(
(
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) * -1em
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
-1em
);
}
`),
3 changes: 2 additions & 1 deletion __tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
*/

import { diff } from 'jest-diff'
// eslint-disable-next-line import/default
import prettier from 'prettier'
import { expect } from 'vitest'

@@ -51,7 +52,7 @@ expect.extend({
return (
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
'\n\n' +
(diffString && diffString.includes('- Expect')
(diffString?.includes('- Expect')
? `Difference:\n\n${diffString}`
: `Expected: ${this.utils.printExpected(expected)}\n` +
`Received: ${this.utils.printReceived(actual)}`)
Loading