Skip to content

feat(theme): consumer defined root font size#2284

Merged
spike-rabbit merged 1 commit into
mainfrom
feat/theme/rfs
Jul 8, 2026
Merged

feat(theme): consumer defined root font size#2284
spike-rabbit merged 1 commit into
mainfrom
feat/theme/rfs

Conversation

@dr-itz

@dr-itz dr-itz commented Jul 7, 2026

Copy link
Copy Markdown
Member

NOTE: The default root font size is now configurable when loading the Element theme. When loading the theme, the default value can be passed as $element-root-font-size. Set to none to use the browser default. The default value if nothing is provided is still at 16px so nothing will break and projects can opt-in once ready. It is recommended to set this to initial as soon as possible. Starting with Element v52, initial will be the default.

@use '@siemens/element-theme/src/theme' with (
  $element-root-font-size: initial
);

Furthermore, a series of helper classes are provided that can be applied to the <html> tag to change the root font size:

  • rfs-none: use the browser default, regardless of the configured default
  • rfs-16: use 16px
  • rfs-20: use 20px
  • rfs-24: use 24px

Any other value can be used by setting the CSS variable at the <html> tag or using a :root {} CSS block: --element-root-font-size.

Closes #2166


Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the root font size configuration in the element theme by introducing a dedicated _root-font-size.scss stylesheet with helper classes and removing Bootstrap-specific root font size overrides. The review feedback correctly points out that using none as a CSS font-size value is invalid, and suggests replacing it with the standard revert keyword across variables, helper classes, and comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread projects/element-theme/src/styles/_root-font-size.scss Outdated
Comment thread projects/element-theme/src/styles/_root-font-size.scss
Comment thread projects/element-theme/src/theme.scss
Comment thread src/styles.scss Outdated
@dr-itz dr-itz force-pushed the feat/theme/rfs branch 4 times, most recently from 95d2afe to 899c325 Compare July 7, 2026 14:00
@dr-itz

dr-itz commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@spike-rabbit I went with non-breaking as I think projects need to verify/fix their applications first. In the end it's one line to flip the default.

@dr-itz dr-itz marked this pull request as ready for review July 7, 2026 14:18
@dr-itz dr-itz requested review from a team as code owners July 7, 2026 14:18

@spike-rabbit spike-rabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it make sense, to also mention that setting it to none is the recommended way?

Do you think we should switch the default with 52? If yes I guess it makes sense to write this in the note as well.

Comment thread src/styles.scss
@dr-itz

dr-itz commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Wouldn't it make sense, to also mention that setting it to none is the recommended way?

Do you think we should switch the default with 52? If yes I guess it makes sense to write this in the note as well.

done

@dr-itz dr-itz requested a review from spike-rabbit July 8, 2026 09:24
NOTE: The default root font size is now configurable when loading the
Element theme. Pass the value via `$element-root-font-size`, or set it
to `none` to use the browser default.

If nothing is provided, the default remains `16px`, so nothing breaks
and projects can opt in when ready. We recommend switching to `none / initial`
as soon as possible. Starting with Element v52, `initial` will be the
default.

```scss
@use '@siemens/element-theme/src/theme' with (
  $element-root-font-size: initial
);
```

Furthermore, a series of helper classes are provided that can be applied
to the `<html>` tag to change the root font size:
- `rfs-none`: use the browser default, regardless of the configured default
- `rfs-16`: use 16px
- `rfs-20`: use 20px
- `rfs-24`: use 24px

Any other value can be used by setting the CSS variable at the `<html>`
tag or using a `:root {}` CSS block: `--element-root-font-size`.

Closes #2166

@spike-rabbit spike-rabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@spike-rabbit spike-rabbit enabled auto-merge July 8, 2026 11:13
@spike-rabbit spike-rabbit added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 656712e Jul 8, 2026
22 of 24 checks passed
@spike-rabbit spike-rabbit deleted the feat/theme/rfs branch July 8, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove 16px root font-size override

2 participants