Slugs used for custom feature checkers.
Shape(s) of the custom feature checkers.
Partial options to override defaults.
OptionalcustomChecks: T_CustomChecker[]Custom feature checks to include in the run.
Optionalroot: ElementThe root element to add feature classes to.
Protected ReadonlycustomCompleted copy of the built-in check options.
See FeatureCheck.constructor for details.
Protected ReadonlyoptsCompleted copy of the built-in check options.
See FeatureCheck.CheckerOpts for details.
Protected ReadonlyrootThe root element used for adding and removing feature-check classes.
See FeatureCheck.constructor for details.
StaticDEFAULT_Default value for FeatureCheck.opts.
StaticDEFAULT_ExperimentalA list of classes to add to the root element before this script loads and runs.
Shape(s) of the custom feature checkers.
OptionalcustomChecks: T_CustomChecker[]Custom checks to include in the class list.
StaticgetExperimentalBuilds a feature-check class name that represents the result of a compatibility test.
Feature slug used to conduct the test.
The version of the class to get. If true, class indicates that the feature is enabled; otherwise, class indicates the feature is unavailable.
StaticsupportsExperimentalChecks for CSS rule support.
A valid test param for the CSS @supports() rule.
ExperimentalRuns all the checks and sets root element classes accordingly.
ProtectedaspectProtectedatProtectedbackgroundProtectedcustomExperimentalRuns a custom check and updates the feature slug's class names on the FeatureCheck.root element.
A custom check to run.
ProtecteddisplayProtectedfocusProtectedfocusProtectedhasProtectedsetExperimentalSet a feature slug's class names on the FeatureCheck.root element.
Feature result to set.
If true, the feature is marked as available. Otherwise it is marked unavailable.
InternalignorePrefix: boolean = falseWhether to exclude the 'js__' prefix. This is only used to set the 'js' and 'no-js' classes.
ProtectedsubgridProtectedwhere
Utility class that uses client-side JS to test for JS and CSS feature compaibility. Updates root element class names accordingly.
Example
This class is meant to be used client-side to assess local CSS & JS compatibility.
The simplest way to use this class is by importing:
and running one line:
The check can also be customized — this customization can mark some features as never available and add on custom feature checks:
Since
0.1.0-pre.0