html-css-style-color-guide — правило для GitHub Copilot
Правило задаёт ограничения и рекомендации для цветового оформления HTML и CSS. Помогает выбирать фоны, текстовые цвета и градиенты с учётом контраста.
.github/instructions/html-css-style-color-guide.instructions.mdЧто делает html-css-style-color-guide
Правило применяется к файлам **/*.html, **/*.css и **/*.js при создании или изменении стилей. Оно предлагает распределять цвета по схеме 60-30-10: основной цвет, дополнительный и акцентный. Для фонов рекомендуются светлые холодные оттенки и нейтральные тона, а переходы градиентов — внутри одной цветовой гаммы.
Для текста правило советует сочетать светлый фон с тёмными нейтральными цветами, а тёмный — с почти белыми. Жёлтый текст и светлый текст на светлом фоне запрещены; сочетания с низким контрастом тоже следует избегать. Красный, оранжевый и жёлтый на больших фоновых областях не подходят: правило оставляет горячие цвета для небольших акцентов и предупреждений.
Какие задачи решает
- подобрать цвет фона для HTML-страницы
- разнести цвета интерфейса по схеме 60-30-10
- избежать нечитаемого текста на фоне
- оформить градиент в одной цветовой гамме
Примеры запросов агенту
- Обнови цвета фона и текста в
index.htmlпо этому правилу. - Проверь стили кнопок и карточек на соответствие схеме 60-30-10.
- Сделай градиент для шапки страницы с учётом рекомендаций правила.
Как установить html-css-style-color-guide
Вручную: положить файлы
.github/instructions/html-css-style-color-guide.instructions.mdПоле applyTo задаёт, к каким файлам применять
Вручную: положить файлы
.claude/rules/html-css-style-color-guide.mdПоле paths во frontmatter ограничивает файлы: applyTo из источника → paths
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.cursor/rules/html-css-style-color-guide.mdcВо frontmatter: description, globs, alwaysApply. applyTo из источника → globs, иначе правило само не подключится
Вручную: положить файлы
.devin/rules/html-css-style-color-guide.mdВручную: положить файлы
.clinerules/html-css-style-color-guide.mdПо шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать
Вопросы о html-css-style-color-guide
Как установить html-css-style-color-guide в GitHub Copilot?
Добавьте файл правила в проект по пути .github/instructions/html-css-style-color-guide.instructions.md.
Что делает html-css-style-color-guide?
Задаёт правила для цветов в HTML и CSS: как выбирать фон и текст, распределять оттенки и применять градиенты.
Какие цвета правило запрещает для фона?
Не используйте для фона горячие цвета, включая красный, оранжевый и жёлтый, а также розовый, пурпурный и мадженту. Для фона рекомендованы светлые холодные и нейтральные оттенки.
Исходный текст
html-css-style-color-guide.instructions.md · MIT
--- description: 'Color usage guidelines and styling rules for HTML elements to ensure accessible, professional designs.' applyTo: '**/*.html, **/*.css, **/*.js' --- # HTML CSS Style Color Guide Follow these guidelines when updating or creating HTML/CSS styles for browser rendering. Color names represent the full spectrum of their respective hue ranges (e.g., "blue" includes navy, sky blue, etc.). ## Color Definitions - **Hot Colors**: Oranges, reds, and yellows - **Cool Colors**: Blues, greens, and purples - **Neutral Colors**: Grays and grayscale variations - **Binary Colors**: Black and white - **60-30-10 Rule** - **Primary Color**: Use 60% of the time (*cool or light color*) - **Secondary Color**: Use 30% of the time (*cool or light color*) - **Accent**: Use 10% of the time (*complementary hot color*) ## Color Usage Guidelines Balance the colors used by applying the **60-30-10 rule** to graphic design elements like backgrounds, buttons, cards, etc... ### Background Colors **Never Use:** - Purple or magenta - Red, orange, or yellow - Pink - Any hot color **Recommended:** - White or off-white - Light cool colors (e.g., light blues, light greens) - Subtle neutral tones - Light gradients with minimal color shift ### Text Colors **Never Use:** - Yellow (poor contrast and readability) - Pink - Pure white or light text on light backgrounds - Pure black or dark text on dark backgrounds **Recommended:** - Dark neutral colors (e.g., #1f2328, #24292f) - Near-black variations (#000000 to #333333) - Ensure background is a light color - Dark grays (#4d4d4d, #6c757d) - High-contrast combinations for accessibility - Near-white variations (#ffffff to #f0f2f3) - Ensure background is a dark color ### Colors to Avoid Unless explicitly required by design specifications or user request, avoid: - Bright purples and magentas - Bright pinks and neon colors - Highly saturated hot colors - Colors with low contrast ratios (fails WCAG accessibility standards) ### Colors to Use Sparingly **Hot Colors** (red, orange, yellow): - Reserve for critical alerts, warnings, or error messages - Use only when conveying urgency or importance - Limit to small accent areas rather than large sections - Consider alternatives like icons or bold text before using hot colors ## Gradients Apply gradients with subtle color transitions to maintain professional aesthetics. ### Best Practices - Keep color shifts minimal (e.g., #E6F2FF to #F5F7FA) - Use gradients within the same color family - Avoid combining hot and cool colors in a single gradient - Prefer linear gradients over radial for backgrounds ### Appropriate Use Cases - Background containers and sections - Button hover states and interactive elements - Drop shadows and depth effects - Header and navigation bars - Card components and panels ## Additional Resources - [Color Tool](https://civicactions.github.io/uswds-color-tool/) - [Government or Professional Color Standards](https://designsystem.digital.gov/design-tokens/color/overview/) - [UI Color Palette Best Practices](https://www.interaction-design.org/literature/article/ui-color-palette) - [Color Combination Resource](https://www.figma.com/resource-library/color-combinations/)
© github · MIT · github/awesome-copilot