Skip to content

Commit 56b1c70

Browse files
committed
Fix styles wtih BOM ignored by browsers, leading to UI behavior change
1 parent 1bd5d0a commit 56b1c70

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apostrophe": patch
3+
---
4+
5+
Fixed incorrect sizing and spacing across the admin UI in webpack builds. A byte order mark preserved by PostCSS 8.5.24 invalidated the stylesheet rule setting `box-sizing` for `.apos-` elements. Sass is now compiled with `charset: false` in webpack builds, so the marker is never emitted. Vite builds were unaffected.

packages/apostrophe/modules/@apostrophecms/asset/lib/webpack/apos/webpack.scss.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ module.exports = (options, apos) => {
4141
loader: 'sass-loader',
4242
options: {
4343
sassOptions: {
44-
silenceDeprecations: [ 'import' ]
44+
silenceDeprecations: [ 'import' ],
45+
// Without this Sass emits a BOM, which postcss 8.5.24+ keeps.
46+
// A BOM in the middle of a stylesheet kills the rule after it.
47+
charset: false
4548
},
4649
sourceMap: false,
4750
// "use" rules must come first or sass throws an error

packages/apostrophe/modules/@apostrophecms/asset/lib/webpack/src/webpack.scss.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ module.exports = (options, apos, srcBuildNames) => {
4545
loader: 'sass-loader',
4646
options: {
4747
sassOptions: {
48-
silenceDeprecations: [ 'import' ]
48+
silenceDeprecations: [ 'import' ],
49+
// Without this Sass emits a BOM, which postcss 8.5.24+ keeps.
50+
// A BOM in the middle of a stylesheet kills the rule after it.
51+
charset: false
4952
}
5053
}
5154
}

0 commit comments

Comments
 (0)