griffel
Copilot instructions1.3k starsChanged 8 months agoMITView on GitHub
Griffel is a CSS-in-JS library with near-zero runtime, SSR support, and ahead-of-time compilation. It's organized as a monorepo using Nx with 16+ packages and applications including React bindings, build-time transforms, and DevTools. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. CRITICAL: NEVER CANCEL long-running commands. Set timeouts appropriately. When using Nx affected commands in a repository that may not have a main branch…
Trending
Less talk lately.about the whole repository
Who's talking about microsoft/griffel
- wyw-in-js/wyw-in-js“☂️ Roadmap for a Rust-based compiler”GitHub · Nov 29, 2024 · 21 reactions
- microsoft/fluentui-system-icons“Upgrade react 18 peer dependency ”GitHub · Nov 7, 2022 · 6 reactions
- microsoft/fluentui“[Feature]: add nonce to generated style elements (CSP)”GitHub · Nov 9, 2022 · 4 reactions
- microsoft/fluentui“[Feature]: support rendering in Shadow DOM [Fluent UI React v9]”GitHub · May 4, 2023 · 3 reactions
- microsoft/fluentui“chore: Update Griffel to latest version”GitHub · May 9, 2022 · 2 reactions
The biggest 5 of 35 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 35
Talked about on GitHub and Hacker News (35 times).
On GitHub · 34
- Nov 29, 2024☂️ Roadmap for a Rust-based compiler — wyw-in-js/wyw-in-js21 reactions · 11 comments
- Nov 7, 2022Upgrade react 18 peer dependency — microsoft/fluentui-system-icons6 reactions · 1 comment
- Nov 9, 2022[Feature]: add nonce to generated style elements (CSP) — microsoft/fluentui4 reactions · 2 comments
- May 4, 2023[Feature]: support rendering in Shadow DOM [Fluent UI React v9] — microsoft/fluentui3 reactions · 1 comment
- May 9, 2022chore: Update Griffel to latest version — microsoft/fluentui2 reactions · 7 comments
29 more on GitHub
- Mar 7, 2024CSS Extraction at build-time — davesnx/styled-ppx1 reaction · 3 comments
- Mar 16, 2023[Bug]: Incorrect media query order in Fluent v9 — microsoft/fluentui1 reaction · 1 comment
- Oct 4, 2022chore: Update Griffel to latest version — microsoft/fluentui1 reaction · 8 comments
- May 24, 2022fix(react-spinner): fix Firefox rendering by adding px units to r — microsoft/fluentui1 reaction · 4 comments
- May 17, 2022chore: Update Griffel to latest version — microsoft/fluentui1 reaction · 9 comments
- May 12, 2022chore: enable ESLint plugin for Griffel — microsoft/fluentui1 reaction · 6 comments
- Oct 2, 2026chore(deps-dev): bump the development-dependencies group across 1 directory with 27 updates — microsoft/fluentui-system-icons0 reactions
- Sep 28, 2026build(deps-dev): bump @griffel/vite-plugin from 1.0.0 to 1.0.1 — Quintisimo/insta-funcs0 reactions
- Sep 25, 2026chore(deps-dev): bump the development-dependencies group across 1 directory with 26 updates — microsoft/fluentui-system-icons0 reactions · 3 comments
- Sep 23, 2026chore(deps-dev): bump the development-dependencies group with 24 updates — microsoft/fluentui-system-icons0 reactions · 3 comments
- Sep 18, 2026chore(deps): bump the production-dependencies group across 1 directory with 6 updates — microsoft/fluentui-system-icons0 reactions · 1 comment
- Aug 26, 2026Add `publishRoot` option — microsoft/beachball0 reactions
- Aug 25, 2026chore(deps): bump the dependencies group across 1 directory with 3 updates — AxisCommunications/fluent-components0 reactions · 1 comment
- Aug 24, 2026build(deps): bump the app group across 1 directory with 5 updates — XFox111/sstatic0 reactions · 3 comments
- Aug 12, 2026chore(deps): bump the dependencies group across 1 directory with 2 updates — AxisCommunications/fluent-components0 reactions · 3 comments
- Aug 10, 2026build(deps-dev): bump @griffel/vite-plugin from 0.1.16 to 1.0.0 — Quintisimo/insta-funcs0 reactions
- Jul 27, 2026chore(deps): bump @griffel/core from 1.19.2 to 1.21.3 — radium-v/fluentui0 reactions
- Mar 29, 2026chore(deps): bump happy-dom and @griffel/vite-plugin — dmytrokirpa/fluentui-react-router-ssr0 reactions
- Mar 16, 2026build(deps-dev): bump @griffel/vite-plugin from 0.1.14 to 0.1.16 — Quintisimo/insta-funcs0 reactions
- Mar 12, 2026feat(react-icons): enable griffel `makeStaticStyles` AOT for font icons — microsoft/fluentui-system-icons0 reactions
- Mar 9, 2026build(deps-dev): bump @griffel/tag-processor from 1.0.14 to 1.0.16 — Quintisimo/insta-funcs0 reactions
- Aug 4, 2025chore(deps-dev): bump @griffel/babel-preset from 1.5.8 to 1.6.8 — sopranopillow/fluentui0 reactions
- Jul 23, 2025chore(react-icons): migrate to ts 4.9.5 — microsoft/fluentui-system-icons0 reactions
- May 12, 2025chore(deps-dev): bump @griffel/shadow-dom from 0.2.2 to 0.2.10 — adamsamec/fluentui0 reactions
- Apr 28, 2025chore(deps-dev): bump @griffel/jest-serializer from 1.1.24 to 1.1.34 — mshoho/fluentui0 reactions
- Apr 28, 2025chore(deps-dev): bump @griffel/shadow-dom from 0.2.2 to 0.2.10 — AtishayMsft/fluentui0 reactions
- Jul 29, 2024Bump @griffel/react from 1.0.3 to 1.5.25 — SkyN9ne/fluentui-system-icons0 reactions · 1 comment
- Jul 29, 2024Bump @griffel/babel-preset from 1.2.0 to 1.6.2 — SkyN9ne/fluentui-system-icons0 reactions · 1 comment
- Aug 23, 2022Unable to use icons with strict Content Security Policies — microsoft/fluentui-system-icons0 reactions · 3 comments
On Hacker News · 1
- Feb 7, 2022Griffel: CSS-in-JS with ahead-of-time compilation2 points
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …
- Distinctive: line 52
When using Nx affected commands in a repository that may not have a main branch locally:
- Distinctive: line 67
Core Library Changes: Test makeStyles functionality
- Distinctive: line 76
Build Tool Changes: Test with actual build scenarios
- Distinctive: line 86
Website Changes: Verify documentation builds and renders
- Very specific: line 109
Manual Change Files: Create JSON files manually in change/ directory using this template:
- Distinctive: line 147
Add/update tests in the same package
- Distinctive: line 148
Run affected builds and tests to ensure nothing breaks
- Very specific: line 149
Create changelog entry: yarn change
- Very specific: line 150
Update documentation in apps/website/docs/ if needed
- Very specific: line 154
Check package.json dependencies are correctly configured
- Very specific: line 155
Use yarn nx graph to visualize project dependencies
- Distinctive: line 161
Test changes using the interactive playground at /try-it-out
- Distinctive: line 163
Check atomic CSS generation is working correctly
- Distinctive: line 164
Test SSR scenarios don't break hydration
- Distinctive: line 177
Use the website's /try-it-out page for interactive testing instead
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Griffel - CSS-in-JS with Ahead-of-time Compilation
Griffel is a CSS-in-JS library with near-zero runtime, SSR support, and ahead-of-time compilation. It's organized as a monorepo using Nx with 16+ packages and applications including React bindings, build-time transforms, and DevTools.
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
Working Effectively
Prerequisites and Setup
- Node.js version 20+ is required (
node --versionshould show v20.x.x) - Yarn 4.3.1 is the package manager (
yarn --versionshould show 4.3.1) - Uses Nx monorepo for task orchestration
Bootstrap, Build, and Test
CRITICAL: NEVER CANCEL long-running commands. Set timeouts appropriately.
# Install dependencies - takes ~2 minutes
yarn install --immutable
# NEVER CANCEL: May take up to 3 minutes. Set timeout to 300+ seconds.
# Build all packages - takes ~1 minute 15 seconds
yarn nx run-many --target=build --all
# NEVER CANCEL: Build takes 1-2 minutes. Set timeout to 180+ seconds.
# Run all tests - takes ~3 minutes
yarn nx run-many --target=test --all
# NEVER CANCEL: Tests take 3-4 minutes. Set timeout to 300+ seconds.
# Type check all projects - takes ~1 minute 30 seconds
yarn nx run-many --target=type-check --all
# NEVER CANCEL: Type checking takes 1-2 minutes. Set timeout to 180+ seconds.
# Lint all projects - takes ~17 seconds
yarn nx run-many --target=lint --all
# NEVER CANCEL: Linting takes 15-30 seconds. Set timeout to 60+ seconds.Development Servers
# Start documentation website (Docusaurus)
yarn start
# Serves on http://localhost:3000
# NEVER CANCEL: Initial build takes 30-60 seconds. Set timeout to 120+ seconds.Working with Affected Changes (Nx)
When using Nx affected commands in a repository that may not have a main branch locally:
# Use run-many instead of affected if git comparison fails
yarn nx run-many --target=build --all # Instead of yarn build
yarn nx run-many --target=test --all # Instead of yarn test
yarn nx run-many --target=lint --all # Instead of yarn lintValidation
Manual Testing Requirements
ALWAYS test changes by running through complete scenarios:
Core Library Changes: Test makeStyles functionality
# Start website to test interactive examples yarn start # Navigate to http://localhost:3000/try-it-out # Test basic makeStyles examples work correctly in the interactive playgroundBuild Tool Changes: Test with actual build scenarios
# Test TypeScript compatibility across versions yarn nx run @griffel/e2e-typescript:test # Test Rspack bundler integration yarn nx run @griffel/e2e-rspack:test- Website Changes: Verify documentation builds and renders
yarn nx run @griffel/website:build # Check build succeeds without errors (warnings about broken anchors are acceptable)
Code Quality Requirements
ALWAYS run these before submitting changes:
# Format code - required for CI
yarn prettier --write .
# Lint with automatic fixes where possible
yarn nx run-many --target=lint --all
# Type check everything
yarn nx run-many --target=type-check --allChange Management
Manual Change Files: Create JSON files manually in change/ directory using this template:
{
"type": "patch", // "none", "patch", "minor", "major"
"comment": "final adjustments",
"packageName": "@griffel/webpack-plugin", // name of affected package
"email": "YOUR_EMAIL",
"dependentChangeType": "patch" // "none", "patch", "minor", "major"
}Repository Structure
Key Packages (packages/ directory)
@griffel/core- Core runtime and compilation logic@griffel/react- React bindings and hooks@griffel/webpack-loader- Webpack build-time transforms@griffel/devtools- Browser extension for debugging@griffel/eslint-plugin- ESLint rules for Griffel usage
Applications (apps/ directory)
website- Documentation site (Docusaurus) at griffel.js.org
Testing Infrastructure (e2e/ directory)
nextjs- Next.js integration teststypescript- TypeScript compilation testsrspack- Rspack bundler testsutils- Common E2E testing utilities
Common Tasks
Adding New Features
- Make changes to relevant packages
- Add/update tests in the same package
- Run affected builds and tests to ensure nothing breaks
- Create changelog entry:
yarn change - Update documentation in
apps/website/docs/if needed
Debugging Build Issues
- Check package.json dependencies are correctly configured
- Use
yarn nx graphto visualize project dependencies - Individual package builds:
yarn nx run @griffel/[package]:build - Clear Nx cache if needed:
yarn nx reset
Working with Styles
- Test changes using the interactive playground at /try-it-out
- Validate CSS output using browser DevTools
- Check atomic CSS generation is working correctly
- Test SSR scenarios don't break hydration
Known Issues and Workarounds
Build Warnings (Acceptable)
- Some packages show rollup-plugin-typescript2 deprecation warnings - this is expected
- Linting may show 1-2 warnings in core packages - this is acceptable
- Prettier may flag some generated files in apps/website/.docusaurus/ - these can be ignored
Storybook Issues
- React Storybook may have configuration issues with webpack5 dependencies
- Use the website's /try-it-out page for interactive testing instead
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

