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

关于在unocss-preset-uni中新增修改前缀名 #12

Open
2 tasks done
LuoMingxiang opened this issue Feb 27, 2024 · 1 comment
Open
2 tasks done

关于在unocss-preset-uni中新增修改前缀名 #12

LuoMingxiang opened this issue Feb 27, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@LuoMingxiang
Copy link

对问题的清晰和简明的描述

想在使用unocss-preset-uni时使用更加简洁的写法实现效果,例如对一段文字使用 uni-h5:bg-red 能否简化为 my-bg-red ,其中将 'uni-h5:' 替换为my-或者其他任意自定义字段,其编译差异性由用户自行设置
_T{ZJY%CP5 I8($DR{29)I8

推荐的解决方案

在unocss中提供新的导出方法,用于自定义前缀类名和定义编译的平台

替代方案

No response

额外上下文

No response

检查

  • 遵循我们的 行为准则
  • 检查是否已经有一个要求相同功能的问题,以避免重复创建。
@ModyQyW ModyQyW added enhancement New feature or request help wanted Extra attention is needed labels Apr 15, 2024
@FliPPeDround
Copy link
Member

export default defineConfig({
  theme: {
    platforms: {
      'wechat': 'mp-weixin', // alias 到 mp-weixin
      'my-app': 'my-app', // 自定义平台
    }
  }
})
<div class='uni-wechat:mx-auto'></div>
<div class='uni-my-app:mx-auto'></div>

示例中有说明使用方法
但目前uni的前缀是必须的
欢迎pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants