ucss

ucss is a cursor rule for Cursor from dcloudio/uni-app-x-ai-rules. It costs 0 tokens per session (544 once invoked), scanned A, original, Apache-2.0.

A set of CSS rules for Uni-App X, a framework for building apps that run on multiple platforms. It defines supported layout, selectors, units, text styling, and animation approaches.

In plain words
What is it for?
It is for writing compatible styles in CSS, UCSS, UVUE, and related stylesheet files.
Why use it?
It prevents using browser CSS features that Uni-App X does not support on its app platforms.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for writing compatible styles in CSS, UCSS, UVUE, and related stylesheet files.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/dcloudio/uni-app-x-ai-rules/ucss
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/dcloudio/uni-app-x-ai-rules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ucss

README.md
[![agentmods](https://agentmods.dev/badge/rules/dcloudio/uni-app-x-ai-rules/ucss/github.svg)](https://agentmods.dev/rules/dcloudio/uni-app-x-ai-rules/ucss)
Your own site
<a href="https://agentmods.dev/rules/dcloudio/uni-app-x-ai-rules/ucss"><img src="https://agentmods.dev/badge/rules/dcloudio/uni-app-x-ai-rules/ucss/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ucss

Your own site · 80×15
<a href="https://agentmods.dev/rules/dcloudio/uni-app-x-ai-rules/ucss"><img src="https://agentmods.dev/badge/rules/dcloudio/uni-app-x-ai-rules/ucss.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 544 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00544
Opus 5.5 $0.00000 $0.00218
Sonnet 5.5 $0.00000 $0.00109
Haiku 4.5 $0.00000 $0.00054

Measured 3mo ago against content hash b6e6d557eca8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ucss scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/ucss.mdc · 43 lines

What it actually says


description: Uni-App X implements a subset of Web CSS on the App platform globs: .css,.ucss,.uvue,.scss,.less,. sass alwaysApply: false

css rules

ucss是css的子集,但可以跨平台使用。除了浏览器之外,还支持App原生平台。

布局规范

  • 禁用浮动、网格等布局,仅使用flex布局或绝对定位。
  • flex布局默认方向为垂直(通过 flex-direction:column 实现)。

选择器规则

  • 仅支持基本的类选择器 (.class),禁止使用其他选择器。
  • 类名必须符合 [A-Za-z0-9_-]+ 规范,禁止使用特殊字符(例如 @class)。

文字样式规则

  • 文字内容需放置在组件 或 中。文字类样式(color、font-size)只能设置在 或 组件上。 其他组件(如)禁止设置文本相关样式。
  • 文字样式不继承。
  • 禁用继承相关关键字,例如 inherit 和 unset。

层级控制

  • z-index 仅对同级兄弟节点生效。
  • absolute 固定位与文档流分离,不支持分层覆盖。

长度单位

  • 仅支持px、rpx、百分比。字体的line-height支持em。不能使用其他单位,如vh。
  • 除非width需要根据屏幕宽度而变化才使用rpx单位。其他场景不使用rpx单位。
  • 除非长度单位需要根据父容器大小而变化才使用百分比单位。其他场景不使用rpx单位。

at-rules

  • 仅支持@font-face、@import,不使用其他at-rules。
  • 如需使用@media 适配不同屏幕,改用 uts 代码实现,先通过API uni.getWindowInfo获取屏幕宽度, 再通过代码进行适配。
  • 如需使用@media 适配暗黑模式, 改用 uts 代码 和 css变量 实现。
  • 如需使用@keyframes,改为通过UniElement对象的animate方法实现相同逻辑。

css function

  • 仅支持 url()、rgb()、rgba()、var()、env(),不使用其他css方法。

样式作用范围规则

  • 不使用css scoped。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 43 lines · 544 tokens per session scan A b6e6d557eca8

Subscribe to this mod's changes

ucss is a cursor rule published in the GitHub repository dcloudio/uni-app-x-ai-rules (33 stars, last pushed 6mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 544 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

ucss compared with cursor rules from other repositories

ucss next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ucssdcloudio/uni-app-x-ai-rulesCursor rule336mo agoApache-2.0A0Cursor
css-stylingConsensys/doc.lineaCursor rule48015d agoApache-2.0A0Cursor
shadcn-tailwind-guidedtyq/magicCursor rule5.1k1mo agononeA13Cursor
codex-premium-website-skillsTheGoat395/Codex-SkillsCursor rule1401mo agoMITA0Cursor
css-render-blocking-diagnosisadobecom/da-express-miloCursor rule6yesterdayApache-2.0A1,102Cursor
z-indexpubky/pubky-appCursor rule28todayMITA0Cursor
csssybrew/troyCursor rule551mo agoMITA0Cursor