FCSS 2: Utility CSS that reads like CSS
Recorded: Oct. 14, 2026, 12:10 p.m.
| Original | Summarized |
GitHub - meerita/FCSS2: Functional CSS: utility classes named after real CSS properties. One class, one declaration, zero runtime. Works with Vite, Next.js, Astro and Angular. · GitHub Skip to content Navigation MenuSign inAppearance settingsPlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesCode QualityEnforce quality at mergeAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricingSearch/Sign inSign upAppearance settings You signed in with another tab or window. Reload to refresh your session. Dismiss alert meeritaFCSS2Repository navigationCodeIssuesPull requestsActionsProjectsSecurity and qualityInsightsMore items FCSS2PublicNotificationsYou must be signed in to change notification settingsFork0 (0)Star0 (0)You must be signed in to star a repositoryAboutFunctional CSS: utility classes named after real CSS properties. One class, one declaration, zero runtime. Works with Vite, Next.js, Astro and Angular.www.npmjs.com/org/functionalcssTopicsangularastroatomic-csscsscss-frameworkfunctional-cssnextjspostcsspostcss-plugintypescriptutility-cssvite-pluginResourcesReadmeMIT licenseCode of conductCode of conductContributingContributingSecurity policySecurity policyActivityStars0 starsWatchers0 watchingForks0 forksReport repositorydevBranchesTagsGo to fileCodeOpen more actions menuLatest commit History21 Commits21 CommitsFolders and filesNameNameLast commit messageLast commit date.changeset.changeset .github/workflows.github/workflows docsdocs examplesexamples packagespackages .gitignore.gitignore .npmrc.npmrc .prettierignore.prettierignore CHANGELOG.mdCHANGELOG.md CODE_OF_CONDUCT.mdCODE_OF_CONDUCT.md CONTRIBUTING.mdCONTRIBUTING.md GOVERNANCE.mdGOVERNANCE.md LICENSELICENSE README.mdREADME.md SECURITY.mdSECURITY.md eslint.config.mjseslint.config.mjs package.jsonpackage.json pnpm-lock.yamlpnpm-lock.yaml pnpm-workspace.yamlpnpm-workspace.yaml prettier.config.mjsprettier.config.mjs tsconfig.base.jsontsconfig.base.json vitest.config.tsvitest.config.ts vitest.workspace.tsvitest.workspace.ts View all filesRepository files navigationREADMECode of conductContributingMIT licenseSecurityMore items FCSS Install · Usage · Docs · npm FCSS is a utility CSS library where every class name is a CSS property and a value. If you know Requirements Requirements You need Node.js 20.19+ or Bun A package manager: npm, pnpm, yarn or bun A bundler or build step (recommended) Supported frameworks: Vite 5 – 8, Next.js 14 – 16, Astro 7, Angular 17 – 22. npm npm install <pkg> npm install -D <pkg> npx fcss <command> npm run build Installation Platform Vite (React, Preact, Solid, vanilla JS/TS) Next.js Astro Angular Other bundlers (PostCSS) Plain HTML / CDN Vite (React, Preact, Solid, vanilla JS) # or with bun export default defineConfig({ export default withFcss({ Next.js 16 builds with Turbopack by default; FCSS purges through webpack. Use Guide: Next.js · package README. export default defineConfig({ # or with bun const require = createRequire(import.meta.url); export default { # same with bun Pattern property--value property--value:pseudo property--value:aria-attr:value breakpoint-property--value breakpoint-property--value:pseudo <button class="padding--16 background-color--blue color--white border-radius--8 color--red:hover"> <nav class="display--none md-display--flex justify-content--space-between">…</nav> Prefix Min Colors are custom properties (--fcss-color-blue, …) defined in root.css, so you can re-theme // ❌ assembled at runtime, so it gets purged export default defineConfig({ Command fcss init [-f <framework>] fcss purge -i <in.css> -o <out.css> fcss audit fcss explain <class> fcss list [-p <property>] fcss build fcss doctor fcss migrate Packages Package @functionalcss/core @functionalcss/vite @functionalcss/next @functionalcss/astro @functionalcss/angular @functionalcss/postcss @functionalcss/cli @functionalcss/scanner @functionalcss/spec @functionalcss/generator All published on npm under @functionalcss. Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
Functional CSS is a utility CSS library founded on the principle of assigning class names directly after actual CSS properties and values, aiming to achieve a paradigm of one class per declaration and zero runtime cost. The core philosophy centers on making the naming convention intuitive for developers familiar with standard CSS, allowing classes to incorporate values and states directly, such as padding--24 representing padding: 24px, rather than employing conventional class prefixes. This approach enables complex styling to be expressed concisely, permitting the inclusion of pseudo-classes like color--red:hover or breakpoint-property--value notations, simplifying the management of responsive design states within the class names themselves. The mechanism powering this zero runtime assertion relies heavily on a build process for purging unused styles. The library scans source files, including HTML, JavaScript, TypeScript, JSX, and Astro files, to identify precisely which utility classes are being utilized in the application. This scanning process allows the build step to dynamically remove any CSS classes that are defined but not referenced in the source code, thereby ensuring that the final output contains only the necessary declarations. Installation and usage are facilitated through various integrations tailored for different modern JavaScript tooling ecosystems. The library is designed to be compatible with bundlers like Vite, Next.js, Astro, and Angular, supported alongside PostCSS, allowing it to be integrated into existing development workflows. For bundlers, the integration involves plugins that hook into the build process to manage the class purging. For instance, in a Vite setup, the process involves importing the core CSS and utilizing a corresponding Vite plugin to coordinate the scanning and purging of classes based on file content. Framework-specific implementations provide tailored integration methods. For Next.js, the implementation involves utility plugins that integrate with webpack to manage the purging process during compilation. Astro integrates the library by using a specific integration within the configuration file, which scans layout files and static content for class usage. Angular provides an integration schematic that handles the installation of necessary packages and orchestrates the necessary steps within the Angular build process to ensure proper purging. The library is accompanied by a command-line interface (CLI) tool that offers several functions for developers, including initialization, purging, explanation, listing, and building, providing granular control over the utility classes. The CLI aids in the deployment process, allowing developers to manage the manifest of classes, purge unused styles from the full CSS manifest, and audit potential dynamic class fragments. Furthermore, the library exposes various npm packages, including the core CSS library, framework-specific plugins, and tooling components, all published under the @functionalcss namespace. The system is designed to mitigate common issues associated with large stylesheets and dynamic class management by enforcing static class names where possible, although safelisting mechanisms are provided for dynamically generated classes that cannot be statically determined by the scanner. Customization is also supported, allowing developers to define project-specific rules or multi-declaration properties using prefixes like c- within their own CSS files, providing an escape hatch for complex, project-scoped styling rules alongside the utility-first approach. The architecture emphasizes a clear separation between the full CSS manifest and the purged, application-specific output, ensuring that while the full set of potential utilities exists, the deployed application remains lean and efficient. |