Skip to content

Deprecate stylable usage of native @namespace #2648

@idoros

Description

@idoros

Currently Stylable uses CSS @namespace at-rule definition as a build time requested namespace value config (overrides the filename as namespace default).

We moved to @st-namespace for the purpose of not conflicting with CSS in #2624 , but for backwards compatibility, Stylable still pickup the value and remove the definition at build,

This behavior should stop at version 6

If you use @namespace

To config Stylable:

  • Make sure it is actually necessary - in most cases the default filename should suffice
  • If you get filename namespace conflicts - use namespaceResolver config to control a project namespace strategy
  • For future v6 compatibility, replace with @st-namespace (there is a codemod for that)

As it's native intent (namespace a stylesheet rules at runtime)

  • use a namespace containing ascii characters that don't match [a-zA-Z-_], like "http://www.w3.org/1999/xhtml"
  • use a prefix: @namespace prefix "value"

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecatedRemoved feature or APInext-majorIssues or PR related to the next major version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions