Skip to content

Commit

Permalink
parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Apr 24, 2024
1 parent 460a322 commit 0bfd369
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions __tests__/borders.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,14 @@ testRule({
endColumn: 25,
description: 'CSS > Errors on value not in spacer list',
},
{
code: '.x { padding-bottom: 0.25rem; }',
fixed: '.x { padding-bottom: var(--base-size-4); }',
message: messages.rejected('0.25rem', {name: '--base-size-4'}),
line: 1,
column: 22,
endColumn: 29,
description: "CSS > Replaces '0.25rem' with 'var(--base-size-4)'.",
},
],
})
2 changes: 1 addition & 1 deletion plugins/borders.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for (const variable of Object.keys(borderSizes)) {
// values.push(`${parseInt(value) - 1}px`)
// }
if (variable.includes('borderWidth')) {
const value = borderSizes[variable].replace(/\(\)/g)
const value = borderSizes[variable]['value'].replace(/max|\(|\)/g, '').split(',')[0]
sizes.push({
name: `--${variable}`,
values: [value],
Expand Down

0 comments on commit 0bfd369

Please sign in to comment.