为什么这个 daiyui 的代码显示不出图标呢

35 天前
 qwertyzzz

其他的都可以 就这个不行

1474 次点击
所在节点    程序员
7 条回复
Iamadog
35 天前
这个就是啊,图标嵌在里面了
LavaC
35 天前
外面多套层 flex ,原因是图标偏离了
jifengg
35 天前
"*** with icons inside"
iblessyou
35 天前
有没有可能,人家图标就长这样,那是个黑底里面是太阳?
NoManPlay
35 天前
label 上加一个 justify-center 类名就可以
```
<label class="cursor-pointer grid place-items-center justify-center">
<input type="checkbox" value="synthwave" class="toggle theme-controller bg-base-content row-start-1 col-start-1 col-span-2"/>
<svg class="col-start-1 row-start-1 stroke-base-100 fill-base-100" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4"/></svg>
<svg class="col-start-2 row-start-1 stroke-base-100 fill-base-100" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
</label>
```
summerwar
35 天前
你看到的那个就是图标,是个太阳,你再点下就是个右侧的月亮了,只是图标和其他的不太一样而已

主要是 icon 和 toggle 的背景重叠导致的看起来不太一样
qwertyzzz
35 天前

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1039661

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX