mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
563 B
563 B
Basic
When n-config-provider
provides dark theme, it applies n-dark-theme
class on n-element
. When n-config-provider
provides light theme, it applies n-light-theme
class on it. If neither, it won't apply any additional class on it. Just like other themed Naive UI components.
It is very useful to create themed component.
<n-element as="span" class="myel">
My Element
</n-element>
.myel {
transition: color .3s cubic-bezier(.4, 0, .2, 1);
}
.myel.n-light-theme {
color: green;
}
.myel.n-dark-theme {
color: yellow;
}