Skip to content

[Bug]: _reset.scss breaks the vertical-alignment of sub, sup elements #17283

Open

Description

Package

@carbon/styles

Browser

Chrome, Safari, Firefox, Edge

Package version

v1.63.1

Description

💡 This was previously reported (#532) and fixed (#533) in Carbon v10, but has returned as a regression in Carbon v11.


packages/styles/scss/_reset.scss clears the vertical-alignment of sub and sup elements by setting it to 'baseline' (here), and then neglects to ever set it to what it should be—effectively leaving subscript and superscript to look the same as regular text.

In Carbon v10, this was fixed by explicitly restoring vertical-align to 'sub' (for sub elements) and 'super' (for sup elements) following the initial reset. Unfortunately, this fix didn't carry over into Carbon v11 and the bug is back.

image

Carbon v10 Carbon v11
image image

Reproduction/example

https://codesandbox.io/p/devbox/trusting-boyd-m4f5cc

Steps to reproduce

  • Run the CodeSandbox preview.
  • Observe that the subscript and superscript in the Original column are properly styled (per the default user agent stylesheet), whereas the subscript and superscript in the Carbon column are styled incorrectly and indistinguishable from regular text.

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    Projects

    • Status

      ⏱ Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions