Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Mar 17, 2024
1 parent 794dc6c commit 592b7a7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/postcss-minify-font-values/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ function transform(prop, value, opts) {
let lowerCasedProp = prop.toLowerCase();
let variableType = '';

if (lowerCasedProp.startsWith('--')) {
if (typeof opts.removeQuotes === 'function') {
variableType = opts.removeQuotes(prop);
opts.removeQuotes = true;
}
if (typeof opts.removeQuotes === 'function') {
variableType = opts.removeQuotes(prop);
opts.removeQuotes = true;
}
if ((lowerCasedProp === 'font-weight' && !hasVariableFunction(value)) || variableType === 'font-weight') {
if ((lowerCasedProp === 'font-weight' || variableType === 'font-weight') && !hasVariableFunction(value)) {
return minifyWeight(value);
} else if ((lowerCasedProp === 'font-family' && !hasVariableFunction(value)) || variableType === 'font-family') {
} else if ((lowerCasedProp === 'font-family' || variableType === 'font-family') && !hasVariableFunction(value)) {
const tree = valueParser(value);

tree.nodes = minifyFamily(tree.nodes, opts);
Expand Down

0 comments on commit 592b7a7

Please sign in to comment.