Comments (5)
这个是字节小程序的代码片段:https://developer.open-douyin.com/ide/minicode/MCrg6Qq
然后我在抖开平台的小程序社区找到了反馈:https://developer.open-douyin.com/forum/mini-app/post/625655d3806b24d2e4dbe214
字节在生产模式下处理空格有问题
微信小程序是ok的,虽然字节小程序几乎和微信一个模板API啥的几乎一模一样,但是他们好像没有优化到这个点,咱们的tailwindcss插件没啥问题,转换正确
另外就是还有一种曲线救国的方案,当然这个是在taro工程里,使用Px或者PX,也就是space-y-[12PX],这样taro在编译的时候,taro内置的postCSS插件将不处理这个转换操作,达到效果
from weapp-tailwindcss.
理论上只要配置taro 的 css 压缩选项 csso ,不压缩空格即可
https://taro-docs.jd.com/docs/config-detail#cssminimizer
https://github.com/css/csso#minifysource-options
from weapp-tailwindcss.
我这边发现在小程序上, 也不好用了.
其他的class都正常, 就space的不行. 压根不生成
from weapp-tailwindcss.
考虑到小程序的组件(shadow root)实现方式,默认情况下 space
这一类带有子选择器的,只对 view
元素生效
推荐组件使用 <view>
标签包裹组件
还有图上你下面是2个组件的父元素上使用的 space class,要看是否生效可以看子项中第2个元素和后面元素:
from weapp-tailwindcss.
是的, 确实是因为我的children是自定义组件, 导致的这个问题
在自定义组件中添加
options: { virtualHost: true, }
即可解决此问题.
from weapp-tailwindcss.
Related Issues (20)
- taro3 + reactjs + weapp-tailwindcss css 语法转义不成功 HOT 2
- vite how to px 2 rpx HOT 2
- uniapp vue3环境下使用,有时候会出现类名未生成样式的情况 HOT 4
- 有单独的 JS API 么? HOT 3
- hbuilder原生创建的项目无法使用webpack5,如何升级? HOT 1
- v3 大版本改动与迁移 HOT 1
- TypeError: Cannot destructure property 'Compilation' of 'compiler.webpack' as it is undefined. HOT 2
- taro rn模式适配 HOT 1
- [postcss] text.replaceAll is not a function HOT 2
- tailwindcss v2 版本下开启 TAILWIND_MODE=watch 的环境变量会导致高版本 hbuilderx 重复差量编译 HOT 8
- 请问支持 app-nvue 吗? HOT 3
- 是否支持使用taro+weap-tailwindcss开发京东小程序, HOT 1
- 新创建的Taro项目按指南配置后,出现wxml文件编译错误 HOT 1
- htmlparser2 更新之后, 导致 wxml 编译失败, 缺少最后的引号 HOT 1
- 谁在使用 weapp-tailwindcss ? HOT 12
- @layer中自定义的类偶尔会失效 HOT 9
- 使用 daisyui 在小程序里面 wxss 编译错误 HOT 2
- 和腾讯的TDesign组件库一起使用时报错 HOT 2
- 类名转换错误 HOT 1
- [ROADMAP] 2024年, weapp-tailwindcss 发展规划 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weapp-tailwindcss.