Skip to content

Use naive-ui with layer support#2

Merged
cn0809 merged 1 commit intocn0809:twfrom
nighca:tw
Apr 10, 2026
Merged

Use naive-ui with layer support#2
cn0809 merged 1 commit intocn0809:twfrom
nighca:tw

Conversation

@nighca
Copy link
Copy Markdown

@nighca nighca commented Apr 10, 2026

This PR switches the app to a layer-enabled Naive UI build so it works correctly with Tailwind CSS v4 in the real project.

  • replace naive-ui with the published alias @nighca/naive-ui@^2.38.1-layer.0
  • declare the CSS layer order in index.html
  • add style insertion anchors for Naive UI and VueUC

Related package change: nighca/naive-ui#1

This avoids generated Naive UI styles overriding Tailwind utility classes unexpectedly.

height: 100%;
}

@layer theme, base, naive-ui, components, utilities;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果这里加了的话,是不是 app.css 那里的可以干掉了?其实加在 app.css 那里更好一些,但是我暂时没想到好的做法可以既把顺序声明保留在 app.css 中又让它对 naive-ui 的 layer 生效

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我正准备去掉,放这里好处就是不用担心 css 拆包了

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@cn0809 cn0809 merged commit fe74845 into cn0809:tw Apr 10, 2026
cn0809 added a commit that referenced this pull request Apr 13, 2026
…oplus#3002)

* sv

* disable tailwind preflight

* fix:  theme leading/text variables & tailwind utilities confliction with existing classes

* batch migration task 1

* batch migration task 2 - asset

* copilot

* editor - wip

* almost done

* details

* move UI component base styles into Tailwind component layer

* move template root comment outside

* fix incompatible css nesting & some details

* update doc

* refine tailwind flex utility usage and styling guidelines

* fix: missing navbar background image

* fix: css layer order messed up in split css chunk

* fix: utilities not work for UITextInput/UIDivider/UIRadioGroup

* draft: vue 3+ tailwind 4 component guildelines

* migrate UIButton to recipe-based tailwind styling

* fix: unexpected twMerge result due to non-standard tailwind tokens

* migrate UI components to tailwind v4 & remove scss deps

* support custom text-size utilities in twMerge

* move input layout classes to native wrappers & update docs

* Use naive-ui with layer support (#2)

* text-body -> text-base & remove redundant descriptions in docs

* simplify root class merging in UI components

* remove redundant layer order declarations

* fix: restore loading compatibility hooks for project runner

* align component styles with css layers and root class merging

---------

Co-authored-by: Hanxing Yang <nighca@live.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants