jdan / 98.css

A design system for building faithful recreations of old UIs
https://jdan.github.io/98.css
MIT License
9k stars 296 forks source link

Font styling applied to `<legend>` #188

Closed vtlanglois closed 7 months ago

vtlanglois commented 7 months ago

In this PR:

Added <legend> to the grouped font-styling selector.

πŸ’­ Reasoning

When used as a child of a .window element, <legend> gets the appropriate font styling applied to it to resemble Windows 98 font styling for group boxes.[^1]

However, when <legend> is not a child of a .window element, it will have font-family: Arial applied to it, inherited from <body>. This issue is most prominent in the documentation, where it appears that <legend> is exempt from the universal font styling of .window elements.

Screenshot 2024-01-20 at 9 06 07β€―PM

With this proposed fix, <legend> will have the appropriate font styling regardless of being a child of a .window element.

Screenshot 2024-01-20 at 9 08 13β€―PM

πŸ“ˆ Impact

This change should make it clear to first-time readers of the documentation what the intended styling for <legend> is, instead of relying users of 98.css to try out the example code or use <legend> in their code.

πŸ“” Dev Note

Seems like a similar issue is happening with the .field-row class when used with text content in <fieldset>. However, I'm not certain about applying font-styling to an element that doesn't necessarily have to do with any text, or if the real issue was the documentation itself using a <div> for that text content over <p> or another element. Because of this, I chose not to fix that in this PR. I figured scoping down to just focus on <legend> would be enough for a PR to this neat open-source project!

[^1]: drawing from examples from this link: https://guidebookgallery.org/screenshots/win98

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
98css βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jan 21, 2024 2:18am
vtlanglois commented 7 months ago

@jdan Thank you so much! Really liking this styling so far, happy to contribute!