sass:@USE在输入文件中导入主表中的@USE时未修饰的变量
我有2个具有非常相似的样式的网站,唯一的区别是配色方案和其他一些小事情。
为了使事情井井有条,使用Sass我有1个主样式表,2个样式表,可容纳每个站点的变量,以及2个“入口点”文件,这些文件是被编译的基本文件,2个入口点文件因为每个站点1。
2个入口点包括1个主样式表 +网站的变量表,因此
我总共使用了5个文件,并且它一直在运行良好。 但是进口正在弃用。 我尝试使用 @使用和 @ forward,但没有运气 当我使用使用和向前时,它给了我“这个变量未定义”,
@import 'variablesheet'
@import 'masterstyles'
这是错误的 但是使用和向前毫不可及,
@use 'variablesheet' as *
@use 'masterstyles' as *
我如何在不进口的情况下做到这一点,因为那是不弃用的呢?
I have 2 websites that have very similar styling, only difference is color schemes and some other minor things.
To make things organized, using Sass I have 1 master style sheet , 2 style sheets that hold variables such as the different colors for each site, and also 2 "entry point" files which are the base files which get compiled, 2 entry point files because 1 for each site.
the 2 entry points include the 1 master style sheet + the site's variable sheet so 5 files in total
I have been using @import and it has been working well.
However import is being deprecated.
I tried to use @ use and @forward but with no luck
When I use USE and FORWARD it gives me "This variable is not defined" error
@import 'variablesheet'
@import 'masterstyles'
This works
But use and forward dont
@use 'variablesheet' as *
@use 'masterstyles' as *
How do I do this without import as that is being deprecated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用自己的名称空间使用每个样式表。然后,您应该能够使用每个SCSS文件中的变量。如果这不起作用,那么您需要在问题中提供更多详细信息。
You can try using each stylesheet with it's own namespace. Then you should be able to use the variables from each scss file. If this doesn't work, then you need to provide more details in your question.