Skip to content
Draft
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

### Added

- Font-family variables that can be used to customise the sans-serif and monospace fonts used in the editor (#1264)

### Changed

- Changed the horizontal scrollbar to show without needing to scroll to the bottom of the editor window (#1257)
Expand All @@ -14,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Styling design system components used in the web component (#1263)
- Sidebar panel overflow for plugins (#1266, #1269)
- Extra border around code output in the instructions panel (#1253)
- Line numbering alignment in code blocks in the instructions panel (#1259)

## [0.33.0] - 2025-10-15

Expand Down
8 changes: 2 additions & 6 deletions src/assets/stylesheets/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ button {
}

input {
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: var(--wc-font-family-sans-serif);
}

.--light {
Expand Down Expand Up @@ -60,9 +58,7 @@ input {
#app {
display: flex;
flex-flow: column;
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: var(--wc-font-family-sans-serif);
@include font-size-1(regular);
}

Expand Down
3 changes: 1 addition & 2 deletions src/assets/stylesheets/AstroPiModel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@
display: flex;
align-items: center;
justify-content: center;
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family: var(--wc-font-family-monospace);

&-timer {
margin-block-start: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/stylesheets/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
color: inherit;
cursor: pointer;
display: inline-flex;
font-family: sans-serif;
font-family: var(--wc-font-family-sans-serif);
font-size: inherit;
font-weight: $font-weight-bold;
gap: $space-0-5;
Expand Down
5 changes: 5 additions & 0 deletions src/assets/stylesheets/EditorPanel.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use "./rpf_design_system/spacing" as *;
@use "./rpf_design_system/font-size" as *;
@use "../../../node_modules/@raspberrypifoundation/design-system-core/scss/mixins/typography";

// Scrollbar-width is needed from scrollbar to show in Chrome
.editor-wrapper {
Expand All @@ -25,10 +26,14 @@
}

.cm-scroller {
@include typography.style-1();

// Needed here for horizontal scroll
overflow: auto;
scrollbar-width: thin;
overscroll-behavior-x: none;
font-family: var(--wc-font-family-monospace);


.cm-content {
flex: 1;
Expand Down
24 changes: 15 additions & 9 deletions src/assets/stylesheets/Instructions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
@use "../../../node_modules/@raspberrypifoundation/design-system-core/scss/mixins/typography";
@use "./rpf_design_system/colours" as *;
@use "./rpf_design_system/spacing" as *;
@use "./rpf_design_system/font-size" as *;
@use "./rpf_design_system/font-weight" as *;

.project-instructions {
block-size: 100%;

h2 {
@include font-size-1-25(bold);
@include typography.style-1-5(bold);
margin: 0;
}

p {
@include typography.style-1();
}

a {
color: var(--editor-color-theme-secondary);
}

strong {
font-weight: $font-weight-bold;
font-weight: var(--font-weight-bold);
}

img {
Expand Down Expand Up @@ -48,6 +50,8 @@
}

pre {
@include typography.style-1();

background-color: $rpf-grey-700;
border: 1px solid $rpf-grey-600;
border-radius: 8px;
Expand Down Expand Up @@ -76,7 +80,7 @@
}

.c-code-filename {
font-family: monospace;
font-family: var(--wc-font-family-monospace);
margin: 0;
padding: $space-0-5 $space-1;
color: $rpf-white;
Expand Down Expand Up @@ -239,9 +243,10 @@
margin: $space-1-5 0;

h3 {
@include typography.style-1(bold);

margin: 0;
padding-inline-start: $space-2;
@include font-size-1(bold);
background-repeat: no-repeat;
background-position: inline-start $space-0-5 center;
}
Expand Down Expand Up @@ -279,10 +284,11 @@
margin-block-end: $space-1-5;

pre {
padding: 0;
margin: 0;
inline-size: 100%;
background-color: $rpf-white;
border: none;
inline-size: 100%;
margin: 0;
padding: 0;
}

code {
Expand Down
15 changes: 10 additions & 5 deletions src/assets/stylesheets/InternalStyles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,21 @@
@use "./FilePanel" as *; // needs to be below Button
@use "./EmbeddedViewer" as *;

@use "./settings/fonts" as fonts;

:host {
font-size: 1.6rem;
}

#wc {
// Allow fonts to be overridden by the host application via
// --editor-font-family-*, falling back to the default sets in
// settings/fonts.scss
--wc-font-family-sans-serif: var(--editor-font-family-sans-serif, #{fonts.$font-family-sans-serif});
--wc-font-family-monospace: var(--editor-font-family-monospace, #{fonts.$font-family-monospace});

background: var(--editor-secondary-theme, transparent);
font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family: var(--wc-font-family-sans-serif);
font-size: 16px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down Expand Up @@ -83,8 +89,7 @@
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family: var(--wc-font-family-monospace);
}

button {
Expand Down
13 changes: 6 additions & 7 deletions src/assets/stylesheets/index.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
@use "./rpf_design_system/colours" as *;
@use './settings/fonts' as fonts;

html,
body {
margin: 0;
}

:host {
font-size: 16px;
:root {
--editor-font-family-sans-serif: fonts.$font-family-sans-serif;
--editor-font-family-monospace: fonts.$font-family-monospace;
}

body {
font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family: var(--editor-font-family-sans-serif);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family: var(--editor-font-family-monospace);
}

#app {
Expand Down
2 changes: 2 additions & 0 deletions src/assets/stylesheets/settings/_fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$font-family-sans-serif: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
$font-family-monospace: RobotoMono, source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern with this is that it might change the fonts we're using in places like within codemirror, as we were using different monospace fonts in different places - maybe that's okay though?

Loading