Skip to content

Commit 7fe15a0

Browse files
authored
Update EditorPanel to honour font size changes (#1277)
In #1264 we added a `typography.style-1()` to the `.cm-scroller` class in the EditorPanel css, which unwittingly prevented font sizes from taking effect. This PR reverts that, but also tidies up the styling to use Design System typography styles instead, so line spacing etc goes with it. Also removes the `$space-0-5` var in favour of the Design System vars. e.g. Small: <img width="841" height="649" alt="image" src="https://github.com/user-attachments/assets/394b807d-a051-427c-b950-afbce7906a7c" /> Medium: <img width="857" height="596" alt="image" src="https://github.com/user-attachments/assets/ea3453ea-7f86-4bd1-a36e-6e7243706928" /> Large: <img width="861" height="496" alt="image" src="https://github.com/user-attachments/assets/3025bc83-eb31-429e-bff2-9c9eeebe1ea4" />
1 parent 9b6710b commit 7fe15a0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## Unreleased
88

9+
### Fixed
10+
- Font size selection now works in the web component (#1277)
11+
912
## [0.34.0] - 2025-11-17
1013

1114
### Added

src/assets/stylesheets/EditorPanel.scss

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
@use "./rpf_design_system/spacing" as *;
2-
@use "./rpf_design_system/font-size" as *;
3-
@use "../../../node_modules/@raspberrypifoundation/design-system-core/scss/mixins/typography";
1+
@forward '@raspberrypifoundation/design-system-core/scss/properties/spacing';
2+
@use '@raspberrypifoundation/design-system-core/scss/mixins/typography' as typography;
43

54
// Scrollbar-width is needed from scrollbar to show in Chrome
65
.editor-wrapper {
@@ -26,8 +25,6 @@
2625
}
2726

2827
.cm-scroller {
29-
@include typography.style-1();
30-
3128
// Needed here for horizontal scroll
3229
overflow: auto;
3330
scrollbar-width: thin;
@@ -37,22 +34,22 @@
3734

3835
.cm-content {
3936
flex: 1;
40-
padding-block-start: $space-0-5;
41-
margin-inline-end: $space-0-5;
37+
padding-block-start: var(--space-0-5);
38+
margin-inline-end: var(--space-0-5);
4239
}
4340
}
4441
}
4542

4643
&--small {
47-
@include font-size-1(regular);
44+
@include typography.style-1();
4845
}
4946

5047
&--medium {
51-
@include font-size-1-5(regular);
48+
@include typography.style-1-5();
5249
}
5350

5451
&--large {
55-
@include font-size-2(regular);
52+
@include typography.style-2();
5653
}
5754
}
5855

0 commit comments

Comments
 (0)