{"id":15423185,"url":"https://github.com/5t3ph/supportscss","last_synced_at":"2025-04-08T13:10:14.386Z","repository":{"id":159840357,"uuid":"633063327","full_name":"5t3ph/SupportsCSS","owner":"5t3ph","description":"Live, in-browser detection of modern CSS support for selectors, features, and at-rules. Applies support-based classes, exposes a results object, and allows custom tests.","archived":false,"fork":false,"pushed_at":"2024-10-03T22:49:39.000Z","size":136,"stargazers_count":273,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T11:07:24.424Z","etag":null,"topics":["browser-support","css","css-support","feature-detection","modern-css","styles","testing"],"latest_commit_sha":null,"homepage":"https://SupportsCSS.dev","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5t3ph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["5t3ph"],"custom":["https://www.buymeacoffee.com/moderncss/"]}},"created_at":"2023-04-26T17:46:12.000Z","updated_at":"2024-12-29T22:02:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"704cf973-7b72-4a74-8012-bc5c17b9787d","html_url":"https://github.com/5t3ph/SupportsCSS","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"44f97836eda1a071871d5c99e63d1e02a4eba632"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5t3ph%2FSupportsCSS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5t3ph%2FSupportsCSS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5t3ph%2FSupportsCSS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5t3ph%2FSupportsCSS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5t3ph","download_url":"https://codeload.github.com/5t3ph/SupportsCSS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247847611,"owners_count":21006100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-support","css","css-support","feature-detection","modern-css","styles","testing"],"created_at":"2024-10-01T17:40:43.805Z","updated_at":"2025-04-08T13:10:14.359Z","avatar_url":"https://github.com/5t3ph.png","language":"JavaScript","funding_links":["https://github.com/sponsors/5t3ph","https://www.buymeacoffee.com/moderncss/"],"categories":[],"sub_categories":[],"readme":"# SupportsCSS\n\n\u003e Live, in-browser detection of modern CSS support for selectors, features, and at-rules. Applies support-based classes, exposes a results object, and allows custom tests.\n\nInspired by the legacy of [Modernizr](https://modernizr.com/), this script evaluates a user's browser for cutting-edge modern CSS support beyond the capabilities of `@supports`.\n\n- Classes are added to `\u003chtml\u003e` as either `supports-[feature]` or `no-[feature]`, allowing easier progressive enhancement and build strategies\n- Checks for selectors like `:has()`, properties like `text-box-trim`, features like relative color syntax, and at-rules like `@layer` - [see full test suite](#test-suite)\n- Allows adding custom tests\n- Exposes a results object to iterate over detected support, as well as individual results for quick conditional checks in JS\n\n\u003e SupportsCSS is _not_ a polyfill, it is only feature detection. Continue using tools like [PostCSS](https://postcss.org/) or [LightningCSS](https://lightningcss.dev/) for prefixing and other features like syntax lowering. SupportsCSS is a layer on top of those tools.\n\n## Installation \u0026 Usage\n\nReview the full docs at [SupportsCSS.dev](https://supportscss.dev).\n\n## Test Suite\n\n| Feature Class | Global Name | Test Condition |\n|---|---|---|\n| at-container | AtContainer | `window.CSSContainerRule` |\n| at-container-style-properties | AtContainerStyleProperties | * [See explanation](#atcontainerstyleproperties-test) |\n| at-counter-style | AtCounterStyle | `window.CSSCounterStyleRule` |\n| at-layer | AtLayer | `window.CSSLayerBlockRule` |\n| at-property | AtProperty | `window.CSSPropertyRule` |\n| at-scope | AtScope | `window.CSSScopeRule` |\n| at-starting-style | AtStartingStyle | `window.CSSStartingStyleRule` |\n| anchor-positioning | AnchorPositioning | `CSS.supports('anchor-name: --a')` |\n| color-function | ColorFunction | `CSS.supports('color: color(srgb 0 0 1)')` |\n| color-mix | ColorMix | `CSS.supports('color: color-mix(in lch, white, black)')` |\n| container-units | ContainerUnits | `CSS.supports('width: 1cqi')` |\n| dynamic-viewport-units | DynamicViewportUnits | `CSS.supports('width: 1dvi')` |\n| has | Has | `CSS.supports('selector(:has(+ *))')` \u003cbr\u003e(_Possible false positive in Firefox 112_) |\n| houdini-paint-api | HoudiniPaintApi | `window.CSS.paintWorklet` |\n| individual-transforms | IndividualTransforms | `CSS.supports('transform: scale(1)')` |\n| light-dark | LightDark | `CSS.supports('color: light-dark(black, white)')` |\n| logical-properties | LogicalProperties | `CSS.supports('border-start-start-radius: 1px')` |\n| media-range-syntax | MediaRangeSyntax | `window.matchMedia('(width \u003e= 1px)')` |\n| nesting | Nesting | `CSS.supports('selector(\u0026 a)')` |\n| nth-of-s | NthOfS | `CSS.supports('selector(:nth-child(1 of .a))')` |\n| overscroll-behavior | OverscrollBehavior | `CSS.supports('overscroll-behavior: none')` |\n| relative-color-syntax | RelativeColorSyntax | `CSS.supports('color: rgb(from red r g b / 1%)')` |\n| scroll-timeline | ScrollTimeline | `CSS.supports('scroll-timeline-name: --a')` |\n| subgrid | Subgrid | `CSS.supports('grid-template-rows: subgrid')` |\n| text-box-trim | TextBoxTrim | `CSS.supports('text-box-trim: both')` |\n| trigonometry | Trigonometry | `CSS.supports('width: calc(1px * cos(1deg))')` |\n| user-invalid | UserInvalid | `CSS.supports('selector(:user-invalid)')` |\n| user-valid | UserValid | `CSS.supports('selector(:user-valid)')` |\n| view-timeline | ViewTimeline | `CSS.supports('view-timeline-name: --a'),` |\n| view-transitions | ViewTransitions | `window.ViewTransition` |\n\n\n### How were these features selected?\n\nFeatures were selected based on:\n\n- `@supports` limitations\n- instability of the spec\n- freshness to the language\n- impact on CSS architecture\n- impact on progressive enhancement\n\n## Colophon\n\nCreated by [Stephanie Eckles](https://front-end.social/@5t3ph), author of [ModernCSS.dev](https://moderncss.dev), [SmolCSS.dev](https://smolcss.dev), and other [front-end dev resources](https://thinkdobecreate.com).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5t3ph%2Fsupportscss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5t3ph%2Fsupportscss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5t3ph%2Fsupportscss/lists"}