{"id":2877,"date":"2025-09-24T17:31:16","date_gmt":"2025-09-24T09:31:16","guid":{"rendered":"https:\/\/www.xfan.top\/?p=2877"},"modified":"2026-04-30T22:45:41","modified_gmt":"2026-04-30T14:45:41","slug":"scss-deprecation-warning-mixed-decls-sasss-behavior-for-declarations-that-appear-after-nested","status":"publish","type":"post","link":"https:\/\/www.xfan.top\/index.php\/2025\/09\/24\/2877\/","title":{"rendered":"scss Deprecation Warning [mixed-decls]: Sass&#8217;s behavior for declarations that appear after nested"},"content":{"rendered":"<pre><code>Deprecation Warning [mixed-decls]: Sass&#039;s behavior for declarations that appear after nested\nrules will be changing to match the behavior specified by CSS in an upcoming\nversion. To keep the existing behavior, move the declaration above the nested\nrule. To opt into the new behavior, wrap the declaration in `&amp; {}`.\n\nMore info: https:\/\/sass-lang.com\/d\/mixed-decls<\/code><\/pre>\n<p>\u539f\u56e0\u662f\u4f60\u5199\u4e86\u5982\u4e0b\u7ed3\u6784\u7684scss\uff1a<\/p>\n<pre><code>.example {\n  color: red;\n\n  &amp;--serious {\n    font-weight: bold;\n  }\n\n  font-weight: normal;\n}<\/code><\/pre>\n<p>\u8fd9\u6837\u5728Dart Sass &lt; 1.77.7\u548c Dart Sass \u2265 1.77.7 \u7248\u672c\u4f1a\u7f16\u8bd1\u51fa\u4e0d\u540c\u7684css\u3002<\/p>\n<p>\u65e7\u7248\u672c\uff1a<\/p>\n<pre><code>.example {\n  color: red;\n  font-weight: normal;\n}\n\n.example--serious {\n  font-weight: bold;\n}<\/code><\/pre>\n<p>\u65b0\u7248\u672c\uff1a<\/p>\n<pre><code>.example {\n  color: red;\n}\n\n.example--serious {\n  font-weight: bold;\n}\n\n.example {\n  font-weight: normal;\n}<\/code><\/pre>\n<p>\u505a\u8fd9\u4e2a\u6539\u53d8\u7684\u7406\u7531\u662f\u4e0eCSS\u7684\u5d4c\u5957\u89c4\u5219\u884c\u4e3a\u4fdd\u6301\u4e00\u81f4\uff0c\u6240\u4ee5\u8bf7\u4fee\u6539\u4f60\u7684\u4ee3\u7801\u3002<br \/>\n\u4f7f\u7528<code>mixin<\/code>\u7b49\u529f\u80fd\u65f6\u5c24\u5176\u5bb9\u6613\u4ea7\u751f\u8be5\u95ee\u9898\uff0c\u8bf7\u8c28\u614e\u8003\u8651<code>@include your-mixin<\/code>\u5728\u4ee3\u7801\u5757\u4e2d\u7684\u4f4d\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deprecation Warning [mixed-decls]: Sass&#039;s behavior [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-2877","post","type-post","status-publish","format-standard","hentry","category-webappdev"],"_links":{"self":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/2877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/comments?post=2877"}],"version-history":[{"count":4,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/2877\/revisions"}],"predecessor-version":[{"id":2883,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/2877\/revisions\/2883"}],"wp:attachment":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/media?parent=2877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/categories?post=2877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/tags?post=2877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}