Skip to content

Variant with responsive properties inheriting a variant with (different) responsive properties does not inherit all values of responsive properties #1497

@hmaracic

Description

@hmaracic

Describe the bug
If a variant has responsive properties and inherits a variant with responsive properties, only the first value of the responsive property will be inherited.

To Reproduce
Steps to reproduce the behavior:

For a bare example of the bug please go to https://codesandbox.io/s/theme-ui-starter-forked-4zv15 and check out theme.js and index.js

Slide the preview window size, until text underline becomes text overline and vice-versa.

Expected behavior
A variant with responsive properties inherits all values of inherited responsive properties.

Applied to the above sandbox example, the expected behavior would be for the text to change size, color and decoration (not just the underline/overline).

Additional context
Documentation states that if a responsive property is inherited thru a variant, it can't be overriden with a simple property. This might be related, but I think it's a different use case from the one mentioned in the Caveats section on the Responsive Typograhpy page .

If the variant inheriting the responsive variant does not have any responsive properties, it will normally inherit all responsive values https://codesandbox.io/s/theme-ui-starter-forked-jgk49 (the size changes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions