Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 能否支持转换@apply内的css #23

Closed
Mr-xue opened this issue May 21, 2024 · 4 comments · Fixed by #24
Closed

[Feature] 能否支持转换@apply内的css #23

Mr-xue opened this issue May 21, 2024 · 4 comments · Fixed by #24

Comments

@Mr-xue
Copy link

Mr-xue commented May 21, 2024

如题,能否支持转换style内@apply书写的的css

@Simon-He95
Copy link
Owner

需要你更细节的描述,比如 @apply是什么语法,他是怎么用的,你希望的代码片段和转换后的结果,再考虑是否支持

@Mr-xue
Copy link
Author

Mr-xue commented May 21, 2024

需要你更细节的描述,比如 @apply是什么语法,他是怎么用的,你希望的代码片段和转换后的结果,再考虑是否支持

就是unocss官方支持的指令转换器:https://unocss.nodejs.cn/transformers/directives

eg:

<style lang="less">
.visitor-show {
  .custom-date {
    @apply w-292 h-40 rounded-8;
    .el-range-separator {
      @apply text-[#666];
    }
  }
}
</style>

@Simon-He95
Copy link
Owner

需要你更细节的描述,比如 @apply是什么语法,他是怎么用的,你希望的代码片段和转换后的结果,再考虑是否支持

就是unocss官方支持的指令转换器:https://unocss.nodejs.cn/transformers/directives

eg:

<style lang="less">
.visitor-show {
  .custom-date {
    @apply w-292 h-40 rounded-8;
    .el-range-separator {
      @apply text-[#666];
    }
  }
}
</style>

然后你期望的是什么,@apply 中的元素具有保存转换 like text#fff -> text-[#fff],你需要将你的期望更好的表达出来:)

@Mr-xue
Copy link
Author

Mr-xue commented May 21, 2024

需要你更细节的描述,比如 @apply是什么语法,他是怎么用的,你希望的代码片段和转换后的结果,再考虑是否支持

就是unocss官方支持的指令转换器:https://unocss.nodejs.cn/transformers/directives
eg:

<style lang="less">
.visitor-show {
  .custom-date {
    @apply w-292 h-40 rounded-8;
    .el-range-separator {
      @apply text-[#666];
    }
  }
}
</style>

然后你期望的是什么,@apply 中的元素具有保存转换 like text#fff -> text-[#fff],你需要将你的期望更好的表达出来:)

对,就是启用了uno-magic的转换效果可以应用到apply内部.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants