Skip to content

SCSS: migrate @import to @use #2732

Description

@chalin

Docsy's Sass sources still use @import, which Dart Sass has deprecated and will remove in 3.0 (https://sass-lang.com/d/import). With #2731 zeroing Docsy's function-class deprecations, the import class is the theme's last Sass debt: silenced in builds (silenceDependencyDeprecations, see head-css.html) but reported by a direct compile.

Blocked upstream: Docsy's partials consume Bootstrap variables, mixins, and functions throughout, so the vendor @imports can only migrate once Bootstrap ships its Sass sources as modules. The Font Awesome imports have the same dependency on upstream (see also #2314).

Scope notes for the eventual migration:

  • Breaking for consumers: the _variables_project.scss override mechanism relies on @import's positional global scope (site variables load ahead of Bootstrap's defaults). Under @use, overrides flow through with (...) configuration; every site with custom variables is affected, so the change needs prominent release comms.
  • Tests: tests/sass-deprecations.test.mjs currently asserts that Docsy's only remaining deprecation warnings are import-class; its sanity canary goes red when this migration lands, prompting the tighten to "no Docsy warnings at all".
  • Prior art:

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions