gpt4 book ai didi

html - CSS 链接标签有效但@import 无效

转载 作者:太空宇宙 更新时间:2023-11-04 06:03:16 25 4
gpt4 key购买 nike

有一个快速的问题,只是想知道为什么我的样式表引用有效,但使用 scss 的 @import 标记却无效。为什么当我在 header.php 标记中使用样式表引用时,它可以工作,但在通过 scss 导入时却不起作用。

文件:header.php

<link href="https://fonts.googleapis.com/css?family=Nanum+Gothic&display=swap&subset=korean" rel="stylesheet">

文件:_variables.scss

// Korean font family based on local team request
$korean: $whitney, 'Nanum Gothic', sans-serif;

结果:使用链接完美运行
enter image description here


文件:_variables.scss

@import url('https://fonts.googleapis.com/css?family=Nanum+Gothic&display=swap&subset=korean');

// Korean font family based on local team request
$korean: $whitney, 'Nanum Gothic', sans-serif;

结果:无效
enter image description here

有没有办法绕过@import?我真的很想使用 @import 或 unless 可以与 scss 一起使用。

感谢所有帮助。

最佳答案

尝试 PostCSS Import URL PluginSCSS Loader .它会将 scss 拉入您的代码中。 other-vice Scss 不从远程文件编译

关于html - CSS 链接标签有效但@import 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57101135/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com