Skip to content

Commit

Permalink
fix max-width
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeSimoes committed Jan 18, 2024
1 parent 3e5a9cf commit 31e65fa
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions blocks/theme/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ export default class Theme extends ComponentBase {
this.scapeDiv = document.createElement('div');
this.external = '/theme.json';
this.skip = ['tags'];
this.toTags = ['font-size', 'font-weight', 'font-family', 'line-height', 'font-style', 'font-margin-block'];
this.transform = {'font-margin-block': 'margin-block'};
this.toTags = [
'font-size',
'font-weight',
'font-family',
'line-height',
'font-style',
'font-margin-block',
];
this.transform = { 'font-margin-block': 'margin-block' };
this.tags = '';
this.fontFace = '';
this.atomic = '';
Expand Down Expand Up @@ -45,7 +52,12 @@ export default class Theme extends ComponentBase {
return k(values).map((value) => {
const val = values[value];
return `${tag} {${k(val)
.map((v) => `${this.transform[v] ? this.transform[v] : v}: ${val[v]};`)
.map(
(v) =>
`${this.transform[v] ? this.transform[v] : v}: var(--scope-${
this.transform[v] ? this.transform[v] : v
}, ${val[v]});`,
)
.join('')}}`;
});
}
Expand All @@ -62,7 +74,9 @@ export default class Theme extends ComponentBase {
if (key === 'font-face') {
this.fontFace += this.fontFaceTemplate(value);
} else {
variable = `\n--raqn-${key}-${row}: ${this.escapeHtml(value).trim()};\n`;
variable = `\n--raqn-${key}-${row}: ${this.escapeHtml(
value,
).trim()};\n`;
this.atomic += `\nbody .${key}-${row} {\n--scope-${key}: var(--raqn-${key}-${row});}\n`;
}
}
Expand Down

0 comments on commit 31e65fa

Please sign in to comment.