惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog RSS Feed
W
WeLiveSecurity
I
InfoQ
L
Lohrmann on Cybersecurity
Simon Willison's Weblog
Simon Willison's Weblog
腾讯CDC
S
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
S
Securelist
T
Tailwind CSS Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
T
Tor Project blog
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
Apple Machine Learning Research
Apple Machine Learning Research
V
Visual Studio Blog
Know Your Adversary
Know Your Adversary
T
The Blog of Author Tim Ferriss
N
News and Events Feed by Topic
小众软件
小众软件
G
Google Developers Blog
F
Full Disclosure
O
OpenAI News
The Last Watchdog
The Last Watchdog
G
GRAHAM CLULEY
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
Jina AI
Jina AI
S
SegmentFault 最新的问题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
Y
Y Combinator Blog
N
News and Events Feed by Topic
K
Kaspersky official blog

Sass Blog

Sass: LibSass Has Reached End-Of-Life Sass: Request for Comments: Indented Syntax Improvements Sass color spaces & wide gamut colors Sass: Node Sass is end-of-life Sass: Announcing `pkg:` Importers
Sass: `@import` is Deprecated
Jennifer Tha · 2024-10-17 · via Sass Blog

Posted 17 October 2024 by Jennifer Thakar

Back in 2019, we released the Sass module system, adding new @use and @forward rules to the language that were designed to replace @import and make stylesheets more maintainable and less error-prone. We can now announce that @import is officially deprecated as of Dart Sass 1.80.0.

The module system ensures that it’s easy for both developers and tooling to determine where a given Sass member is defined, adds namespacing to prevent the need to manually add long, awkward namespaces to names, and allows library authors to ensure their private helpers can’t be accessed by downstream users. Additionally, since each module is only ever loaded once, depending on the same stylesheet multiple times no longer results in duplicated CSS.

With 4.5 years since we released the module system and more than a year since we passed the 80% Dart Sass usage share threshold we set for starting this deprecation, we feel comfortable making this move. However, we understand that this is a big change to the language and not all users have been able to fully migrate off of @import so far.

Controlling Deprecation WarningsControlling Deprecation Warnings permalink

While users should treat this deprecation as a signal to migrate sooner rather than later, for anyone who wishes to silence deprecation warnings for @import, we recently added a new --silence-deprecation command line option. Just pass --silence-deprecation=import to Sass and you won’t have to worry about the deprecation warnings while you complete the migration. Equivalent options exist in the JS and Dart APIs.

On the other hand, users who have already migrated to the module system and wish to prevent any backsliding can use the --fatal-deprecation=import to treat any Sass @import rules as errors.

TimelineTimeline permalink

As previously announced, given the size of this change, we expect to wait at least a two years after this deprecation before we remove @import from the language. While we plan to release Dart Sass 2.0.0 soon with other, smaller breaking changes, that release will not include any changes to @import. Instead, we expect @import to be removed in Dart Sass 3.0.0.

MigratorMigrator permalink

Users migrating off of @import can use the Sass migrator to move to the module system. Follow the instructions to install it, then run it on your application:

$ sass-migrator module --migrate-deps <path/to/style.scss>

Built-in FunctionsBuilt-in Functions permalink

Alongside this deprecation, we are also deprecating any uses of global built-in Sass functions that are now available in built-in modules. In the past, we’ve had a number of conflicts between these functions and new plain CSS function names, and moving to the module system will help us avoid further conflicts in the future.

The global-builtin ID can be passed to the --silence-deprecation or --fatal-deprecation flags on its own, or in combination with import. This deprecation will follow the same timeline as @import for removal. For users who want to migrate off of global functions but aren’t ready to complete the module system migration, we’ve also added a new --built-in-only flag to the module system migrator.