brand-yml by posit-dev/skills
npx skills add https://github.com/posit-dev/skills --skill brand-yml为 Shiny 应用程序和 Quarto 文档创建和使用 _brand.yml 文件,以实现一致的品牌形象。
brand.yml 是一种基于 YAML 的格式,可将品牌指南转换为可在 Shiny 和 Quarto 中使用的机器可读文件。单个 _brand.yml 文件定义了:
_brand.yml(由 Shiny 和 Quarto 自动发现)company-brand.yml(需要显式路径)_brand/ 或 brand/ 子目录中广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
确定用户目标并遵循相应的工作流程:
references/shiny-r.mdreferences/shiny-python.mdreferences/quarto.mdreferences/brand-yml-in-r.md(R Markdown、主题函数、编程访问)根据品牌指南创建 _brand.yml 文件时:
收集品牌信息:
加载 references/brand-yml-spec.md 以了解完整的 brand.yml 结构、字段选项和语法。
从基本部分开始,然后添加可选元素:
最小可行的 _brand.yml:
color:
palette:
brand-blue: "#0066cc"
primary: brand-blue
background: "#ffffff"
typography:
fonts:
- family: Inter
source: google
weight: [400, 600]
base: Inter
根据需要添加颜色:
color:
palette:
brand-blue: "#0066cc"
brand-orange: "#ff6600"
brand-gray: "#666666"
primary: brand-blue
secondary: brand-gray
warning: brand-orange
foreground: "#333333"
background: "#ffffff"
添加排版细节:
typography:
fonts:
- family: Inter
source: google
weight: [400, 600, 700]
style: [normal, italic]
- family: Fira Code
source: google
weight: [400, 500]
base:
family: Inter
size: 16px
line-height: 1.5
headings:
family: Inter
weight: 600
monospace: Fira Code
添加徽标:
logo:
small: logos/icon.png
medium: logos/header.png
large: logos/full.svg
添加元信息:
meta:
name: Company Name
link: https://example.com
遵循 references/brand-yml-spec.md 中的这些规则:
"#0066cc"brand-blue、success-greenhttps://检查:
_brand.yml 的位置https://)修改现有 _brand.yml 文件时:
常见修改:
color.palette,然后在语义颜色中引用typography.fonts 中更新,确保权重/样式可用light/dark 结构处理多个变体light 和 dark 变体当用户想要将 brand.yml 应用到 Shiny for R 应用时:
references/shiny-r.md 获取完整的集成指南bs_theme(brand = TRUE) 或 bs_theme(brand = "path")_brand.yml 放在应用根目录page_fluid()、page_sidebar() 等快速示例:
library(shiny)
library(bslib)
ui <- page_fluid(
theme = bs_theme(brand = TRUE),
# ... UI 元素
)
当用户想要将 brand.yml 应用到 Shiny for Python 应用时:
references/shiny-python.md 获取完整的集成指南ui.Theme.from_brand(__file__)_brand.yml 放在应用根目录pip install "shiny[theme]"快速示例(Shiny Express):
from shiny.express import ui
ui.page_opts(theme=ui.Theme.from_brand(__file__))
快速示例(Shiny Core):
from shiny import App, ui
app_ui = ui.page_fluid(
theme=ui.Theme.from_brand(__file__),
# ... UI 元素
)
当用户想要将 brand.yml 应用到 Quarto 文档时:
references/quarto.md 获取完整的集成指南_brand.yml 与 _quarto.yml 一起放在项目根目录brand 关键字控制优先级快速示例(文档):
---
title: "My Document"
format:
html:
brand: _brand.yml
---
快速示例(项目中的 _quarto.yml):
project:
brand: _brand.yml
format:
html:
theme: default
Shiny:
_brand.yml(带下划线)bs_theme(brand = "path/to/_brand.yml") 或 ui.Theme.from_brand("path")libsassQuarto:
_brand.yml 是否位于项目根目录_quarto.yml 存在以进行项目级品牌设置"#0066cc" 而不是 #0066ccsource: google 或 source: bunnyquarto typst fonts 检查字体缓存"#447099"primary: blue- family: Inter根据需要加载这些以获取详细信息:
references/brand-yml-spec.md:完整的 brand.yml 规范,包含所有部分、字段、示例和验证规则references/shiny-r.md:通过 bslib 在 Shiny for R 中使用 brand.yml(bs_theme、自动发现、Shiny 特定集成)references/shiny-python.md:通过 ui.Theme 在 Shiny for Python 中使用 brand.yml(from_brand()、安装、性能)references/quarto.md:在 Quarto 中使用 brand.yml(格式、亮色/暗色模式、分层、扩展、Typst)references/brand-yml-in-r.md:通用 R 用法,包括 R Markdown 集成、主题函数(ggplot2、gt、flextable、plotly、thematic)和编程品牌访问_brand.yml 以便自动检测_brand.yml 包含在 git 仓库中color:
primary:
light: "#0066cc"
dark: "#3399ff"
background:
light: "#ffffff"
dark: "#1a1a1a"
foreground:
light: "#333333"
dark: "#e0e0e0"
亮色/暗色颜色模式在 Quarto 1.8 版本中添加,目前 R 或 Python 的 brand.yml 包不支持。
logo:
images:
logo-dark: logos/logo-dark.svg
logo-white: logos/logo-white.svg
icon: logos/icon.png
small: icon
medium:
light: logo-dark
dark: logo-white
typography:
fonts:
- family: Inter
source: google
weight: [300, 400, 500, 600, 700]
style: [normal, italic]
base:
family: Inter
weight: 400
headings:
family: Inter
weight: 600
color:
palette:
navy: "#003366"
ocean-blue: "#0066cc"
sky-blue: "#3399ff"
primary-color: ocean-blue # 别名
brand-blue: ocean-blue # 别名
blue: sky-blue # 主色别名
primary: brand-blue
尽可能包含 Bootstrap 颜色名称,可以直接定义或作为别名:blue、indigo、purple、pink、red、orange、yellow、green、teal、cyan、white、black。这对于保持一致性很有用,并且这些颜色会被使用 brand.yml 的工具自动拾取。
brand-yml-spec.md_brand.yml 进行自动发现每周安装次数
109
仓库
GitHub 星标数
207
首次出现
2026 年 2 月 10 日
安全审计
安装于
opencode97
github-copilot96
codex96
gemini-cli94
cursor93
amp93
Create and use _brand.yml files for consistent branding across Shiny applications and Quarto documents.
brand.yml is a YAML-based format that translates brand guidelines into a machine-readable file usable across Shiny and Quarto. A single _brand.yml file defines:
_brand.yml (auto-discovered by Shiny and Quarto)company-brand.yml (requires explicit paths)_brand/ or brand/ subdirectoriesDetermine the user's goal and follow the appropriate workflow:
references/shiny-r.mdreferences/shiny-python.mdreferences/quarto.mdreferences/brand-yml-in-r.md (R Markdown, theming functions, programmatic access)When creating _brand.yml files from brand guidelines:
Collect brand information:
Load references/brand-yml-spec.md to understand the complete brand.yml structure, field options, and syntax.
Start with the essential sections and add optional elements:
Minimum viable _brand.yml:
color:
palette:
brand-blue: "#0066cc"
primary: brand-blue
background: "#ffffff"
typography:
fonts:
- family: Inter
source: google
weight: [400, 600]
base: Inter
Add colors as needed:
color:
palette:
brand-blue: "#0066cc"
brand-orange: "#ff6600"
brand-gray: "#666666"
primary: brand-blue
secondary: brand-gray
warning: brand-orange
foreground: "#333333"
background: "#ffffff"
Add typography details:
typography:
fonts:
- family: Inter
source: google
weight: [400, 600, 700]
style: [normal, italic]
- family: Fira Code
source: google
weight: [400, 500]
base:
family: Inter
size: 16px
line-height: 1.5
headings:
family: Inter
weight: 600
monospace: Fira Code
Add logos:
logo:
small: logos/icon.png
medium: logos/header.png
large: logos/full.svg
Add meta information:
meta:
name: Company Name
link: https://example.com
Follow these rules from references/brand-yml-spec.md:
"#0066cc"brand-blue, success-greenhttps:// in all URLsCheck that:
_brand.yml locationhttps://)When modifying existing _brand.yml files:
Common modifications:
color.palette, then reference in semantic colorstypography.fonts, ensure weights/styles are availablelight/dark structure for multiple variantslight and dark variants to colorsWhen the user wants to apply brand.yml to a Shiny for R app:
references/shiny-r.md for complete integration guidebs_theme(brand = TRUE) or bs_theme(brand = "path")_brand.yml at app rootpage_fluid(), page_sidebar(), etc.Quick example:
library(shiny)
library(bslib)
ui <- page_fluid(
theme = bs_theme(brand = TRUE),
# ... UI elements
)
When the user wants to apply brand.yml to a Shiny for Python app:
references/shiny-python.md for complete integration guideui.Theme.from_brand(__file__)_brand.yml at app rootpip install "shiny[theme]"Quick example (Shiny Express):
from shiny.express import ui
ui.page_opts(theme=ui.Theme.from_brand(__file__))
Quick example (Shiny Core):
from shiny import App, ui
app_ui = ui.page_fluid(
theme=ui.Theme.from_brand(__file__),
# ... UI elements
)
When the user wants to apply brand.yml to Quarto documents:
references/quarto.md for complete integration guide_brand.yml at project root with _quarto.ymlbrand keyword to control precedenceQuick example (document):
---
title: "My Document"
format:
html:
brand: _brand.yml
---
Quick example (project in _quarto.yml):
project:
brand: _brand.yml
format:
html:
theme: default
Shiny:
_brand.yml (with underscore)bs_theme(brand = "path/to/_brand.yml") or ui.Theme.from_brand("path")libsass is installedQuarto:
_brand.yml is at project root_quarto.yml exists for project-level branding"#0066cc" not #0066ccsource: google or source: bunny is specifiedquarto typst fonts"#447099"primary: blue- family: InterLoad these as needed for detailed information:
references/brand-yml-spec.md : Complete brand.yml specification with all sections, fields, examples, and validation rulesreferences/shiny-r.md : Using brand.yml with Shiny for R via bslib (bs_theme, automatic discovery, Shiny-specific integration)references/shiny-python.md : Using brand.yml with Shiny for Python via ui.Theme (from_brand(), installation, performance)references/quarto.md : Using brand.yml with Quarto (formats, light/dark mode, layering, extensions, Typst)references/brand-yml-in-r.md : General R usage including R Markdown integration, theming functions (ggplot2, gt, flextable, plotly, thematic), and programmatic brand access_brand.yml for auto-detection_brand.yml in git repositorycolor:
primary:
light: "#0066cc"
dark: "#3399ff"
background:
light: "#ffffff"
dark: "#1a1a1a"
foreground:
light: "#333333"
dark: "#e0e0e0"
Light/dark color modes were added in Quarto version 1.8 and currently are not supported in the R or Python brand.yml packages.
logo:
images:
logo-dark: logos/logo-dark.svg
logo-white: logos/logo-white.svg
icon: logos/icon.png
small: icon
medium:
light: logo-dark
dark: logo-white
typography:
fonts:
- family: Inter
source: google
weight: [300, 400, 500, 600, 700]
style: [normal, italic]
base:
family: Inter
weight: 400
headings:
family: Inter
weight: 600
color:
palette:
navy: "#003366"
ocean-blue: "#0066cc"
sky-blue: "#3399ff"
primary-color: ocean-blue # Alias
brand-blue: ocean-blue # Alias
blue: sky-blue # Alias for primary colors
primary: brand-blue
Include Bootstrap color names when possible, either defined directly or as aliases: blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, white, black. This is useful for consistency and these colors are picked up automatically by tools that use brand.yml.
brand-yml-spec.md when creating or modifying files_brand.yml for automatic discoveryWeekly Installs
109
Repository
GitHub Stars
207
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode97
github-copilot96
codex96
gemini-cli94
cursor93
amp93
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
120,000 周安装
项目文件夹结构蓝图生成器 - 自动生成多技术栈项目结构文档,提升代码组织一致性
7,800 周安装
Fluent UI Blazor 使用指南:Microsoft.FluentUI.AspNetCore.Components 4 版本完整教程
7,800 周安装
finalize-agent-prompt:AI智能体提示词优化工具,提升GitHub Copilot提示词质量与效率
7,800 周安装
Debian Linux 问题排查指南:使用 systemctl、journalctl、apt 诊断与修复系统故障
7,800 周安装
AI测试规划与质量保障提示:基于ISTQB与ISO 25010的全面测试策略生成
7,900 周安装
Epic架构规范提示:AI辅助软件架构设计,生成领域驱动技术方案
7,800 周安装