Skip to content

Commit 4a70b83

Browse files
authored
Merge pull request #5545 from apostrophecms/a3-incident-postcss-bom
[a3] Fix styles wtih BOM ignored by browsers, leading to UI behavior change
2 parents f5f2a3e + ed0647c commit 4a70b83

6 files changed

Lines changed: 30 additions & 9 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
node-version: [18, 20]
21+
node-version: [22]
2222
mongodb-version: [4.4, 5.0, 6.0, 7.0]
2323

2424
# Steps represent a sequence of tasks that will be executed as part of the job

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## UNRELEASED
4+
5+
### Changes
6+
7+
* Dropped support for Node.js 18 and Node.js 20.
8+
9+
### Fixes
10+
11+
* Fixed incorrect sizing and spacing across the admin UI. A byte order mark preserved by PostCSS 8.5.24 invalidated the stylesheet rule setting `line-height` and `box-sizing` for `.apos-` elements. Sass is now compiled with `charset: false`, so the marker is never emitted.
12+
313
## 3.67.3 (2025-03-31)
414

515
### Fixes

‎modules/@apostrophecms/asset/lib/webpack/apos/webpack.scss.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module.exports = (options, apos) => {
4545
{
4646
loader: 'sass-loader',
4747
options: {
48+
sassOptions: {
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
52+
},
4853
sourceMap: false,
4954
// "use" rules must come first or sass throws an error
5055
additionalData: `

‎modules/@apostrophecms/asset/lib/webpack/src/webpack.scss.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,16 @@ module.exports = (options, apos, srcBuildNames) => {
3030
}
3131
},
3232
// Parses SASS imports
33-
'sass-loader'
33+
{
34+
loader: 'sass-loader',
35+
options: {
36+
sassOptions: {
37+
// Without this Sass emits a BOM, which postcss 8.5.24+ keeps.
38+
// A BOM in the middle of a stylesheet kills the rule after it.
39+
charset: false
40+
}
41+
}
42+
}
3443
],
3544
// https://stackoverflow.com/a/60482491/389684
3645
sideEffects: true

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"url": "git@github.com:apostrophecms/apostrophe.git"
1818
},
1919
"engines": {
20-
"node": ">=16.0.0"
20+
"node": ">=22.0.0"
2121
},
2222
"keywords": [
2323
"apostrophe",
@@ -154,7 +154,7 @@
154154
"nyc": "^15.1.0",
155155
"replace-in-file": "^6.1.0",
156156
"stylelint": "^14.6.1",
157-
"stylelint-declaration-strict-value": "^1.8.0",
157+
"stylelint-declaration-strict-value": "~1.10.11",
158158
"stylelint-order": "^5.0.0",
159159
"vue-eslint-parser": "^7.1.1"
160160
},

‎test/workspaces-project/app.js‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
module.exports = {
22
root: module,
33
shortName: 'workspaces-project',
4+
baseUrl: 'http://localhost:3000',
45
modules: {
56
'@apostrophecms/express': {
67
options: {
78
address: '127.0.0.1'
89
}
910
},
10-
'@apostrophecms/sitemap': {
11-
options: {
12-
baseUrl: 'http://localhost:3000'
13-
}
14-
}
11+
'@apostrophecms/sitemap': {}
1512
}
1613
};

0 commit comments

Comments
 (0)