Skip to content

content alt text #1423

Closed
Closed
@clarfonthey

Description

@clarfonthey

What would you want to propose?

CSS content supports adding an alternative text after a slash, like so:

content: "string" / "alt text";

However, since some browsers don't support this, you can emit an extra version of the content property without the slash, as a backup:

content: "string" "alt text";
content: "string" / "alt text";

Suggested solution

A postcss-content-alt-text plugin could perform this transformation and it could be enabled by postcss-preset-env if any supported browsers don't have the feature.

Additional context

CIU page: https://caniuse.com/mdn-css_properties_content_alt_text
MDN page: https://developer.mozilla.org/en-US/docs/Web/CSS/content#browser_compatibility

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

  • I'm willing to open a PR

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