components-preview.css font-family overrides base styles in theme

Created on 24 October 2024, 5 months ago

Problem/Motivation

The font-family declaration on .components-preview overrides the font-family set on the body tag in our theme.

Steps to reproduce

  1. Create a custom theme and assign a font-family to the body tag like so:
          body {
            font-family: "Comic Sans MS", "Comic Sans", cursive;
          }
        
      
  2. Create an SDC component with a .story.twig file so it shows up on the /components page.
  3. Visit /components page
  4. Oh no! My component is styled with a beautiful comic sans font and instead uses Arial which isn't as fun!

Proposed resolution

Remove the font-family: Arial, sans-serif; line from the components-preview.css on line 37.

Remaining tasks

Review my branch and MR.

User interface changes

/components route will now use browser default font unless custom theme declares an alternative and it almost certainly, always will!

API changes

None.

Data model changes

None.
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom darren.fisher

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024