Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
13b072a
sv
cn0809 Mar 31, 2026
5f1336f
disable tailwind preflight
cn0809 Mar 31, 2026
f4776a4
fix: theme leading/text variables & tailwind utilities confliction w…
cn0809 Mar 31, 2026
a29a896
batch migration task 1
cn0809 Mar 31, 2026
187b3b5
batch migration task 2 - asset
cn0809 Apr 1, 2026
02fc528
copilot
cn0809 Apr 1, 2026
45de467
editor - wip
cn0809 Apr 1, 2026
3162053
almost done
cn0809 Apr 2, 2026
e9147cd
details
cn0809 Apr 2, 2026
c805022
move UI component base styles into Tailwind component layer
cn0809 Apr 7, 2026
6186c06
move template root comment outside
cn0809 Apr 7, 2026
91a979e
fix incompatible css nesting & some details
cn0809 Apr 7, 2026
2dcea76
update doc
cn0809 Apr 7, 2026
4de24d9
refine tailwind flex utility usage and styling guidelines
cn0809 Apr 7, 2026
f66966c
fix: missing navbar background image
cn0809 Apr 8, 2026
296ad01
fix: css layer order messed up in split css chunk
cn0809 Apr 8, 2026
4be17fd
fix: utilities not work for UITextInput/UIDivider/UIRadioGroup
cn0809 Apr 8, 2026
4211331
draft: vue 3+ tailwind 4 component guildelines
cn0809 Apr 9, 2026
839a15f
migrate UIButton to recipe-based tailwind styling
cn0809 Apr 9, 2026
f5b456d
fix: unexpected twMerge result due to non-standard tailwind tokens
cn0809 Apr 9, 2026
3c53ec0
migrate UI components to tailwind v4 & remove scss deps
cn0809 Apr 10, 2026
3bbc569
support custom text-size utilities in twMerge
cn0809 Apr 10, 2026
da499a5
move input layout classes to native wrappers & update docs
cn0809 Apr 10, 2026
fe74845
Use naive-ui with layer support (#2)
nighca Apr 10, 2026
bd9c494
text-body -> text-base & remove redundant descriptions in docs
cn0809 Apr 10, 2026
166d8ad
simplify root class merging in UI components
cn0809 Apr 10, 2026
1e85dc5
remove redundant layer order declarations
cn0809 Apr 10, 2026
3b5b7f0
fix: restore loading compatibility hooks for project runner
cn0809 Apr 10, 2026
76f1026
align component styles with css layers and root class merging
cn0809 Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions spx-gui/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"recommendations": [
"Vue.volar",
"vue.volar",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss"
]
}
49 changes: 49 additions & 0 deletions spx-gui/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,55 @@ When working with backend unique string identifiers such as `username`, project

* Generate accessibility info for interactive elements using `v-radar` directive.

## Styling Preferences

### Defaults

* Use Tailwind as the default for local layout and surface styling.
* Keep styles local to the page/feature/component. Do not move local styles into `src/app.css`.
* Prefer readable template utilities and remove redundant local style blocks when they no longer improve clarity.
* Prefer direct template utilities over local `@apply` blocks when the styles are only used by one or two template nodes.
* If local authored styles are still needed, use plain CSS.

### Boundaries and Source of Truth

* Keep `src/app.css` limited to Tailwind entry setup, theme bridge, and rare project-wide utilities.
* Keep `src/components/ui/global.css` and `src/components/ui/reset.css` as the base reset/foundation layer (Tailwind preflight stays disabled).
* Keep `--ui-*` tokens as the source of truth.
* In Tailwind classes, prefer bridged semantic tokens (for example `text-text`, `text-title`, `bg-primary-100`).
* In local CSS, prefer direct `--ui-*` variables instead of bridged Tailwind variables.

### Responsive and Theme Rules

* Keep breakpoints in `src/app.css` aligned with `src/components/ui/responsive.ts`.
* Use only `tablet`, `desktop`, and `desktop-large` responsive names.
* Prefer responsive CSS/Tailwind variants over `useResponsive()`; keep `useResponsive()` for non-style runtime logic.
* Keep Tailwind theme namespaces reset to project tokens only (color, shadow, font, text, radius, etc.).

Comment thread
cn0809 marked this conversation as resolved.
### When Local CSS Is Better

* Keep local CSS for `:deep(...)`, generated content, third-party DOM overrides, and complex stateful widgets.
* Keep a small local CSS rule for structural selectors that are awkward in template logic (for example nested `:last-child` rules) instead of encoding them with hard-to-read dynamic class expressions.
* Prefer plain local CSS over complex Tailwind descendant/arbitrary selectors for cross-component or slot-content styling.
* Preserve semantic hook classes used by parent selectors or slots (for example `.corner-menu`, `.course-item-mini`).
* For newly added components, avoid introducing `:deep(...)` selectors and cross-file hook classes when possible, since they increase maintenance cost.
* Do not force full Tailwind conversion when a small local style block is clearer.

### Practical Styling Notes

* Prefer standard Tailwind utility names when practical. For example, use `rounded-md` instead of a project-local alias like `rounded-2`; this keeps overrides more predictable because `tailwind-merge` understands standard utility groups better.
Comment thread
nighca marked this conversation as resolved.
Outdated
* For root-class overrides and utility conflicts:
- For business components, external root `class` overrides are allowed by default. If utility conflicts need an explicit winner, prefer adding Tailwind's important modifier at the usage site (for example `rounded-md!`, `w-32!`) instead of expanding the component API. This keeps intent explicit, usage concise, and matches the fact that business components rarely need nested override chains.
- For most UI components, `twMerge` and `@layer components` are set up so external utilities or custom classes can override root classes in the common case without special handling, though edge cases can still exist.
- For the Naive UI-root components listed in `src/components/ui/README.md`, avoid relying on external `class` for styling-critical overrides when possible; the final result is often hard to predict.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

root class 覆盖规则更新到这里了

* Avoid non-equivalent Tailwind simplifications for flex values. In particular, `flex: 1 1 0` is not equivalent to Tailwind `flex-1` (`flex: 1 1 0%`), so do not simplify between them unless the layout behavior has been verified. Likewise, do not simplify `flex: 0 0 auto` to `shrink-0`; use the equivalent `flex-none` when that shorthand is desired.
* Prefer `style` / `:style` for one-off values when clearer than Tailwind arbitrary utilities. For example, prefer `style="box-shadow: 0 24px 32px -16px rgba(0, 0, 0, 0.1)"` over a long arbitrary utility such as `shadow-[0_24px_32px_-16px_rgba(0,0,0,0.1)]`.
* For important/non-obvious background assets, prefer TS imports and inline `backgroundImage` binding.
* Keep fixed utility classes in `class`; reserve `:class` for stateful/dynamic parts only.
* In plain `<style scoped>`, flatten `:deep(...)` selectors (for example `.preview :deep(svg)`) so the final selector structure and specificity stay obvious.
* Do not use native CSS nesting in plain `<style>` / `<style scoped>` blocks; use flat selectors to avoid browser compatibility issues.
* Keep single-use values local; only add setup variables when reused/computed or clearly improving readability.

### Menu Item Text Guidelines

When creating or modifying menu items, follow these UI guidelines for ellipses:
Expand Down
Loading