查看“︁编程语言/tailwindcss”︁的源代码
来自康健生活
←
编程语言/tailwindcss
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 标题文本 == [https://tailwindcss.com/docs/detecting-classes-in-source-files#class-detection-in-depth 检测源文件中的类] == 主题 == [https://tailwindcss.com/docs/theme theme] 默认情况下在当前文件的文本域中,一定要在顶层引用 tailwindcss 之后主题才会生效,在文档中此处被称之为“<code>最终 CSS 输出中将仅生成使用的 CSS 变量</code>”,那么什么是<code>将仅生成使用</code>呢,很有歧义 {{hc|head=assets/module/theme.css|output=<syntaxhighlight lang="bash"> /* 生效 */ @import 'tailwindcss'; @theme { --ci-dark-bg: #121212; } </syntaxhighlight>}} {{Leftrightflex|{{hc|head=assets/module/theme.css|output=<syntaxhighlight lang="bash"> /* 不生效 */ @theme { --ci-dark-bg: #121212; } </syntaxhighlight>}}|{{hc|head=assets/index.css|output=<syntaxhighlight lang="bash"> /* 生效 */ @import 'tailwindcss'; @import './module/theme.css'; </syntaxhighlight>}}}} == preflight == 在构建过程中去掉 <code>layer(base)</code> 以便添加自定义的基础样式。tailwindcss 的 [https://tailwindcss.com/docs/preflight preflight] 基础样式是基于 [https://github.com/sindresorhus/modern-normalize modern-normalize],而我常用的是 [https://github.com/necolas/normalize.css normalize.css],两者之间仍有差别。 <syntaxhighlight lang="css"> @layer theme, base, components, utilities; @import 'tailwindcss/theme.css' layer(theme); @import 'tailwindcss/utilities.css' layer(utilities);</syntaxhighlight> == 暗黑模式 == [https://tailwindcss.com/docs/dark-mode 暗黑模式]如果只是页面中元素的样式改变,直接参阅 tailwindcss 文档就可以。但如果关联了第三方应用(eq: codemirror)就需要借助一些持久化函数 <syntaxhighlight lang="css"> @custom-variant dark (&:where(.dark, .dark *)); /* @custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *)); */ </syntaxhighlight>
此页面嵌入的页面:
模板:Double-columns
(
查看源代码
)
模板:Double-columns/style.css
(
查看源代码
)
模板:Hc
(
查看源代码
)
模板:Hc/style.css
(
查看源代码
)
返回
编程语言/tailwindcss
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。