Skip to content

Commit

Permalink
More formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
reinink committed Aug 25, 2023
1 parent 350b931 commit 8faca18
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
{
base: [
"[type='text']",
"input:where(:not([type]))",
'input:where(:not([type]))',
"[type='email']",
"[type='url']",
"[type='password']",
Expand Down Expand Up @@ -308,21 +308,19 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
base: [`[type='file']:focus`],
class: null,
styles: {
outline: [
`1px solid ButtonText`,
`1px auto -webkit-focus-ring-color`
],
outline: [`1px solid ButtonText`, `1px auto -webkit-focus-ring-color`],
},
},
]

const getStrategyRules = (strategy) => rules
.map((rule) => {
if (rule[strategy] === null) return null
const getStrategyRules = (strategy) =>
rules
.map((rule) => {
if (rule[strategy] === null) return null

return { [rule[strategy]]: rule.styles }
})
.filter(Boolean)
return { [rule[strategy]]: rule.styles }
})
.filter(Boolean)

if (strategy.includes('base')) {
addBase(getStrategyRules('base'))
Expand Down

0 comments on commit 8faca18

Please sign in to comment.