├── .editorconfig ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug.yml │ └── config.yml ├── PULL_REQUEST_TEMPLATE ├── dependabot.yml └── workflows │ ├── idle.yml │ ├── lint.yml │ └── publish-release.yml ├── .gitignore ├── .npmignore ├── .nvmrc ├── .prettierrc.json ├── .release-please-manifest.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── REVIEWING.md ├── api ├── index.js ├── inheritance.json ├── inheritance.md └── inheritance.schema.json ├── css ├── README.md ├── at-rules.json ├── at-rules.md ├── at-rules.schema.json ├── definitions.json ├── functions.json ├── functions.md ├── functions.schema.json ├── index.js ├── properties.json ├── properties.md ├── properties.schema.json ├── selectors.json ├── selectors.md ├── selectors.schema.json ├── syntaxes.json ├── syntaxes.md ├── syntaxes.schema.json ├── types.json ├── types.md ├── types.schema.json ├── units.json ├── units.md └── units.schema.json ├── docs ├── assets │ ├── property_definition.png │ └── property_index.png ├── publishing.md └── updating_css_json.md ├── index.js ├── l10n ├── css.json └── index.js ├── package-lock.json ├── package.json ├── release-please-config.json └── test └── lint.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This file is used to request PR reviews. 2 | 3 | # Default 4 | * @mdn/core-yari-content 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: "Issue report" 2 | description: Report an unexpected problem or unintended behavior. 3 | labels: ["needs triage"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | ### Before you start 9 | 10 | **Want to fix the problem yourself?** This project is open source and we welcome fixes and improvements from the community! 11 | 12 | ↩ Check the project [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) guide to see how to get started. 13 | 14 | --- 15 | - type: textarea 16 | id: problem 17 | attributes: 18 | label: What information was incorrect, unhelpful, or incomplete? 19 | validations: 20 | required: true 21 | - type: textarea 22 | id: expected 23 | attributes: 24 | label: What did you expect to see? 25 | validations: 26 | required: true 27 | - type: textarea 28 | id: references 29 | attributes: 30 | label: Do you have any supporting links, references, or citations? 31 | description: Link to information that helps us confirm your issue. 32 | - type: textarea 33 | id: more-info 34 | attributes: 35 | label: Do you have anything more you want to share? 36 | description: For example, steps to reproduce, screenshots, screen recordings, or sample code. 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Content or feature request 4 | url: https://github.com/mdn/mdn/issues/new/choose 5 | about: Propose new content for MDN Web Docs or submit a feature request using this link. 6 | - name: MDN GitHub Discussions 7 | url: https://github.com/orgs/mdn/discussions 8 | about: Does the issue involve a lot of changes, or is it hard to split it into actionable tasks? Start a discussion before opening an issue. 9 | - name: MDN Web Docs on Discourse 10 | url: https://discourse.mozilla.org/c/mdn/learn/250 11 | about: Need help with assessments on MDN Web Docs? We have a support community for this purpose on Discourse. 12 | - name: Help with code 13 | url: https://stackoverflow.com/ 14 | about: If you are stuck and need help with code, StackOverflow is a great resource. 15 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ### Description 7 | 8 | 9 | 10 | ### Motivation 11 | 12 | 13 | 14 | ### Additional details 15 | 16 | 17 | 18 | ### Related issues and pull requests 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | updates: 4 | - package-ecosystem: npm 5 | directory: "/" 6 | schedule: 7 | interval: daily 8 | open-pull-requests-limit: 10 9 | labels: 10 | - "automated pr" 11 | - "dependencies" 12 | - "javascript" 13 | 14 | - package-ecosystem: "github-actions" 15 | directory: "/" 16 | schedule: 17 | interval: "daily" 18 | labels: 19 | - "automated pr" 20 | - "dependencies" 21 | - "github actions" 22 | -------------------------------------------------------------------------------- /.github/workflows/idle.yml: -------------------------------------------------------------------------------- 1 | # This workflow is hosted at: https://github.com/mdn/workflows/blob/main/.github/workflows/idle.yml 2 | # Docs for this workflow: https://github.com/mdn/workflows/blob/main/README.md#idle 3 | name: "Label idle issues" 4 | 5 | on: 6 | schedule: 7 | - cron: "0 9 * * 5" 8 | 9 | jobs: 10 | mark-as-idle: 11 | uses: mdn/workflows/.github/workflows/idle.yml@main 12 | with: 13 | target-repo: "mdn/data" 14 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: lint 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions/setup-node@v4 13 | with: 14 | node-version-file: ".nvmrc" 15 | - run: npm ci 16 | - run: npm test 17 | -------------------------------------------------------------------------------- /.github/workflows/publish-release.yml: -------------------------------------------------------------------------------- 1 | name: publish-release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | workflow_dispatch: 9 | inputs: 10 | force-npm-publish: 11 | description: "Force npm publish" 12 | type: boolean 13 | 14 | permissions: 15 | contents: write 16 | pull-requests: write 17 | 18 | jobs: 19 | publish-release: 20 | if: github.repository == 'mdn/data' 21 | runs-on: ubuntu-latest 22 | 23 | steps: 24 | - name: Release 25 | uses: GoogleCloudPlatform/release-please-action@v4 26 | id: release 27 | 28 | - name: Setup 29 | if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} 30 | uses: actions/checkout@v4 31 | 32 | - name: Checkout 33 | if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} 34 | uses: actions/setup-node@v4 35 | with: 36 | registry-url: "https://registry.npmjs.org/" 37 | node-version-file: ".nvmrc" 38 | 39 | - name: Install 40 | if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} 41 | run: npm ci 42 | 43 | - name: Publish 44 | if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }} 45 | run: npm publish 46 | env: 47 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .travis.yml 2 | .editorconfig 3 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v18 2 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "bracketSameLine": true 3 | } 4 | -------------------------------------------------------------------------------- /.release-please-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | ".": "2.21.0" 3 | } 4 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of conduct 2 | 3 | This repository is governed by Mozilla's code of conduct and etiquette guidelines. 4 | For more details, read [Mozilla's Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/). 5 | 6 | ## Reporting violations 7 | 8 | For more information on how to report violations of the Community Participation Guidelines, read the [How to report](https://www.mozilla.org/about/governance/policies/participation/reporting/) page. 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # MDN data contribution guide 2 | 3 | Thanks for taking the time to contribute to [MDN Web Docs](https://developer.mozilla.org)! :tada: 4 | This file lists some general guidelines to help you contribute effectively. 5 | 6 | ## Publishing a release 7 | 8 | Details about publishing a release can be found in the [publishing guide](./docs/publishing.md). 9 | 10 | ## Types of contribution 11 | 12 | There are many ways you can help improve this repository! For example: 13 | 14 | ### General tasks 15 | 16 | - **Fixing a bug:** we have a list of [issues](https://github.com/mdn/data/issues), 17 | or maybe you found your own. 18 | - **Reviewing a pull request:** there is a list of [PRs](https://github.com/mdn/data/pulls). 19 | Let us know if these look good to you. 20 | - **Localizing strings:** translations are in the [l10n folder](./l10n). You can add your locale. 21 | 22 | **Note**: Commits need to adhere to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) and only `fix:` and `feat:` commits are considered. 23 | 24 | ### CSS data tasks 25 | 26 | - **Updating CSS data**: familiarize yourself with the [CSS schema files](./css/README.md) and add missing CSS data. An additional guide is provided in the [How to update the CSS JSON DB](./docs/updating_css_json.md) document. 27 | 28 | ## Validating the data 29 | 30 | You can use `npm test` to validate data against the schema. You might need to install the devDependencies using `npm install --dev`. 31 | 32 | ## Reviewer's checklist 33 | 34 | Not everything is enforced or validated by the schema. A few things a reviewer should pay attention to: 35 | 36 | - Make sure `npm test` reports no errors. 37 | - Double check the data using the latest specifications. 38 | 39 | ## Code style 40 | 41 | The JSON files should be formatted according to the [.editorconfig](.editorconfig) file. 42 | 43 | ## Licensing 44 | 45 | Please note that the compatibility data is made available under the 46 | [CC0 1.0 Universal (public domain) license](LICENSE), 47 | so any contributions must be compatible with that license. If you're not sure about that, just ask. 48 | 49 | ## Getting help 50 | 51 | If you need help with this repository or have any questions, contact the MDN team 52 | in the [#mdn](irc://irc.mozilla.org/mdn) IRC channel on irc.mozilla.org or write us on [discourse](https://discourse.mozilla-community.org/c/mdn). 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer 6 | exclusive Copyright and Related Rights (defined below) upon the creator and 7 | subsequent owner(s) (each and all, an "owner") of an original work of 8 | authorship and/or a database (each, a "Work"). 9 | 10 | Certain owners wish to permanently relinquish those rights to a Work for the 11 | purpose of contributing to a commons of creative, cultural and scientific 12 | works ("Commons") that the public can reliably and without fear of later 13 | claims of infringement build upon, modify, incorporate in other works, reuse 14 | and redistribute as freely as possible in any form whatsoever and for any 15 | purposes, including without limitation commercial purposes. These owners may 16 | contribute to the Commons to promote the ideal of a free culture and the 17 | further production of creative, cultural and scientific works, or to gain 18 | reputation or greater distribution for their Work in part through the use and 19 | efforts of others. 20 | 21 | For these and/or other purposes and motivations, and without any expectation 22 | of additional consideration or compensation, the person associating CC0 with a 23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 25 | and publicly distribute the Work under its terms, with knowledge of his or her 26 | Copyright and Related Rights in the Work and the meaning and intended legal 27 | effect of CC0 on those rights. 28 | 29 | 1. Copyright and Related Rights. A Work made available under CC0 may be 30 | protected by copyright and related or neighboring rights ("Copyright and 31 | Related Rights"). Copyright and Related Rights include, but are not limited 32 | to, the following: 33 | 34 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 35 | and translate a Work; 36 | 37 | ii. moral rights retained by the original author(s) and/or performer(s); 38 | 39 | iii. publicity and privacy rights pertaining to a person's image or likeness 40 | depicted in a Work; 41 | 42 | iv. rights protecting against unfair competition in regards to a Work, 43 | subject to the limitations in paragraph 4(a), below; 44 | 45 | v. rights protecting the extraction, dissemination, use and reuse of data in 46 | a Work; 47 | 48 | vi. database rights (such as those arising under Directive 96/9/EC of the 49 | European Parliament and of the Council of 11 March 1996 on the legal 50 | protection of databases, and under any national implementation thereof, 51 | including any amended or successor version of such directive); and 52 | 53 | vii. other similar, equivalent or corresponding rights throughout the world 54 | based on applicable law or treaty, and any national implementations thereof. 55 | 56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 59 | and Related Rights and associated claims and causes of action, whether now 60 | known or unknown (including existing as well as future claims and causes of 61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 62 | duration provided by applicable law or treaty (including future time 63 | extensions), (iii) in any current or future medium and for any number of 64 | copies, and (iv) for any purpose whatsoever, including without limitation 65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 66 | the Waiver for the benefit of each member of the public at large and to the 67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 68 | shall not be subject to revocation, rescission, cancellation, termination, or 69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 70 | by the public as contemplated by Affirmer's express Statement of Purpose. 71 | 72 | 3. Public License Fallback. Should any part of the Waiver for any reason be 73 | judged legally invalid or ineffective under applicable law, then the Waiver 74 | shall be preserved to the maximum extent permitted taking into account 75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver 76 | is so judged Affirmer hereby grants to each affected person a royalty-free, 77 | non transferable, non sublicensable, non exclusive, irrevocable and 78 | unconditional license to exercise Affirmer's Copyright and Related Rights in 79 | the Work (i) in all territories worldwide, (ii) for the maximum duration 80 | provided by applicable law or treaty (including future time extensions), (iii) 81 | in any current or future medium and for any number of copies, and (iv) for any 82 | purpose whatsoever, including without limitation commercial, advertising or 83 | promotional purposes (the "License"). The License shall be deemed effective as 84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the 85 | License for any reason be judged legally invalid or ineffective under 86 | applicable law, such partial invalidity or ineffectiveness shall not 87 | invalidate the remainder of the License, and in such case Affirmer hereby 88 | affirms that he or she will not (i) exercise any of his or her remaining 89 | Copyright and Related Rights in the Work or (ii) assert any associated claims 90 | and causes of action with respect to the Work, in either case contrary to 91 | Affirmer's express Statement of Purpose. 92 | 93 | 4. Limitations and Disclaimers. 94 | 95 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 96 | surrendered, licensed or otherwise affected by this document. 97 | 98 | b. Affirmer offers the Work as-is and makes no representations or warranties 99 | of any kind concerning the Work, express, implied, statutory or otherwise, 100 | including without limitation warranties of title, merchantability, fitness 101 | for a particular purpose, non infringement, or the absence of latent or 102 | other defects, accuracy, or the present or absence of errors, whether or not 103 | discoverable, all to the greatest extent permissible under applicable law. 104 | 105 | c. Affirmer disclaims responsibility for clearing rights of other persons 106 | that may apply to the Work or any use thereof, including without limitation 107 | any person's Copyright and Related Rights in the Work. Further, Affirmer 108 | disclaims responsibility for obtaining any necessary consents, permissions 109 | or other rights required for any use of the Work. 110 | 111 | d. Affirmer understands and acknowledges that Creative Commons is not a 112 | party to this document and has no duty or obligation with respect to this 113 | CC0 or use of the Work. 114 | 115 | For more information, please see 116 | 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to MDN data 2 | 3 | > **Note** 4 | > We are in the process of deprecating the `mdn/data` package in favor of [`w3c/webref`](https://github.com/w3c/webref). 5 | > If you depend on this project, let us know in our community [GitHub discussions](https://github.com/mdn/mdn-community/discussions/categories/platform). 6 | > Thank you. 7 | 8 | [![NPM version](https://img.shields.io/npm/v/mdn-data.svg)](https://www.npmjs.com/package/mdn-data) 9 | [![lint](https://github.com/mdn/data/actions/workflows/lint.yml/badge.svg)](https://github.com/mdn/data/actions/workflows/lint.yml) 10 | 11 | This repository contains general data for Web technologies and is maintained by the [MDN team at Mozilla](https://wiki.mozilla.org/MDN). 12 | 13 | ## Repository contents 14 | 15 | The data in this repository is used in MDN Web Docs to build [information boxes](https://developer.mozilla.org/en-US/docs/Web/CSS/background) and [sidebar navigation](https://developer.mozilla.org/en-US/docs/Web/API/Window). 16 | External tools make use of this data as well, for example, the [CSSTree](https://github.com/csstree/csstree/) CSS parser. 17 | 18 | There's a top-level directory for each broad area covered: for example, `api` and `css`. 19 | Inside each of these directories is one or more JSON files containing the data. 20 | 21 | ### api 22 | 23 | Contains data about Web APIs: 24 | 25 | - API inheritance (interface inheritance and mixin implementations) 26 | 27 | ### css 28 | 29 | Contains data about: 30 | 31 | - CSS at-rules 32 | - CSS functions 33 | - CSS properties 34 | - CSS selectors 35 | - CSS syntaxes 36 | - CSS types 37 | - CSS units 38 | 39 | For more information, see the [CSS data](./css/README.md) documentation and the [Updating CSS JSON DB](./docs/updating_css_json.md) guide. 40 | 41 | ### l10n 42 | 43 | The l10n folder contains localization strings that are used in the various 44 | json files throughout this repository. 45 | 46 | ## Problems? 47 | 48 | If you find a problem, please [file an issue](https://github.com/mdn/data/issues/new). 49 | 50 | ## Contributing 51 | 52 | We're very happy to accept contributions to this data. 53 | Please familiarize yourself with the schema for the data you're editing, and send us a pull request. 54 | See the [CONTRIBUTING.md](./CONTRIBUTING.md) document for more information. 55 | 56 | ## See also 57 | 58 | - [https://github.com/mdn/browser-compat-data](https://github.com/mdn/browser-compat-data) 59 | for compatibility data for Web technologies 60 | -------------------------------------------------------------------------------- /REVIEWING.md: -------------------------------------------------------------------------------- 1 | # Reviewing guide 2 | 3 | All reviewers must abide by the [code of conduct](CODE_OF_CONDUCT.md); they are also protected by the code of conduct. 4 | A reviewer should not tolerate poor behavior and is encouraged to [report any behavior](CODE_OF_CONDUCT.md#Reporting_violations) that violates the code of conduct. 5 | 6 | ## Review process 7 | 8 | The MDN Web Docs team has a well-defined review process that must be followed by reviewers in all repositories under the GitHub MDN organization. 9 | This process is described in detail on the [Pull request guidelines](https://developer.mozilla.org/en-US/docs/MDN/Community/Pull_requests) page. 10 | -------------------------------------------------------------------------------- /api/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | inheritance: require('./inheritance'), 3 | } 4 | -------------------------------------------------------------------------------- /api/inheritance.md: -------------------------------------------------------------------------------- 1 | # Inheritance 2 | 3 | [data](https://github.com/mdn/data/blob/main/api/inheritance.json) | 4 | [schema](https://github.com/mdn/data/blob/main/api/inheritance.schema.json) 5 | 6 | Interfaces of Web APIs can inherit from other interfaces or implement [mixins](https://developer.mozilla.org/en-US/docs/Glossary/Mixin). For each interface, this data informs about the inherited (parent) interface and the implemented mixins. 7 | 8 | ## Structure for inheritance data of a specific name 9 | 10 | The overall inheritance data is an object with one property per interface. 11 | Each interface entry looks like the following example (E.g. for the DocumentFragment interface). 12 | 13 | ```json 14 | "DocumentFragment": { 15 | "inherits": "Node", 16 | "implements": [ 17 | "ParentNode", 18 | "LegacyQueryInterface" 19 | ] 20 | } 21 | ``` 22 | 23 | The 2 properties are both required. 24 | * `inherits` (a string or null): the name of the interface it inherits properties and methods from. If null, it means it doesn't inherit from any interface. 25 | * `implements` (array of strings): the list of mixins the interface implements. The array can be empty. 26 | -------------------------------------------------------------------------------- /api/inheritance.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": { 4 | "type": "object", 5 | "additionalProperties": false, 6 | "properties": { 7 | "inherits": { 8 | "oneOf": [ 9 | { 10 | "type": "null" 11 | }, 12 | { 13 | "type": "string", 14 | "minLength": 1 15 | } 16 | ] 17 | }, 18 | "implements": { 19 | "minItems": 0, 20 | "uniqueItems": true, 21 | "items": { 22 | "type": "string" 23 | } 24 | } 25 | }, 26 | "required": [ 27 | "inherits", 28 | "implements" 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /css/README.md: -------------------------------------------------------------------------------- 1 | # MDN CSS data 2 | 3 | This folder contains data about the different features of the [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) language. 4 | 5 | ## How to update the CSS JSON DB 6 | 7 | A guide to making changes is provided in the [How to update the CSS JSON DB](../docs/updating_css_json.md) document. 8 | 9 | ## Different types of CSS data 10 | 11 | The CSS data is split into these parts: 12 | 13 | - **at-rules**: 14 | [data](https://github.com/mdn/data/blob/main/css/at-rules.json) | 15 | [schema](https://github.com/mdn/data/blob/main/css/at-rules.schema.json) | 16 | [docs](https://github.com/mdn/data/blob/main/css/at-rules.md) 17 | - **functions**: 18 | [data](https://github.com/mdn/data/blob/main/css/functions.json) | 19 | [schema](https://github.com/mdn/data/blob/main/css/functions.schema.json) | 20 | [docs](https://github.com/mdn/data/blob/main/css/functions.md) 21 | - **properties**: 22 | [data](https://github.com/mdn/data/blob/main/css/properties.json) | 23 | [schema](https://github.com/mdn/data/blob/main/css/properties.schema.json) | 24 | [docs](https://github.com/mdn/data/blob/main/css/properties.md) 25 | - **selectors**: 26 | [data](https://github.com/mdn/data/blob/main/css/selectors.json) | 27 | [schema](https://github.com/mdn/data/blob/main/css/selectors.schema.json) | 28 | [docs](https://github.com/mdn/data/blob/main/css/selectors.md) 29 | - **syntaxes**: 30 | [data](https://github.com/mdn/data/blob/main/css/syntaxes.json) | 31 | [schema](https://github.com/mdn/data/blob/main/css/syntaxes.schema.json) | 32 | [docs](https://github.com/mdn/data/blob/main/css/syntaxes.md) 33 | - **types**: 34 | [data](https://github.com/mdn/data/blob/main/css/types.json) | 35 | [schema](https://github.com/mdn/data/blob/main/css/types.schema.json) | 36 | [docs](https://github.com/mdn/data/blob/main/css/types.md) 37 | - **units**: 38 | [data](https://github.com/mdn/data/blob/main/css/units.json) | 39 | [schema](https://github.com/mdn/data/blob/main/css/units.schema.json) | 40 | [docs](https://github.com/mdn/data/blob/main/css/units.md) 41 | -------------------------------------------------------------------------------- /css/at-rules.json: -------------------------------------------------------------------------------- 1 | { 2 | "@charset": { 3 | "syntax": "@charset \"\";", 4 | "groups": [ 5 | "CSS Syntax" 6 | ], 7 | "status": "standard", 8 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@charset" 9 | }, 10 | "@counter-style": { 11 | "syntax": "@counter-style {\n [ system: ; ] ||\n [ symbols: ; ] ||\n [ additive-symbols: ; ] ||\n [ negative: ; ] ||\n [ prefix: ; ] ||\n [ suffix: ; ] ||\n [ range: ; ] ||\n [ pad: ; ] ||\n [ speak-as: ; ] ||\n [ fallback: ; ]\n}", 12 | "interfaces": [ 13 | "CSSCounterStyleRule" 14 | ], 15 | "groups": [ 16 | "CSS Counter Styles" 17 | ], 18 | "descriptors": { 19 | "additive-symbols": { 20 | "syntax": "[ && ]#", 21 | "media": "all", 22 | "initial": "n/a (required)", 23 | "percentages": "no", 24 | "computed": "asSpecified", 25 | "order": "orderOfAppearance", 26 | "status": "standard", 27 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/additive-symbols" 28 | }, 29 | "fallback": { 30 | "syntax": "", 31 | "media": "all", 32 | "initial": "decimal", 33 | "percentages": "no", 34 | "computed": "asSpecified", 35 | "order": "uniqueOrder", 36 | "status": "standard", 37 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/fallback" 38 | }, 39 | "negative": { 40 | "syntax": " ?", 41 | "media": "all", 42 | "initial": "\"-\" hyphen-minus", 43 | "percentages": "no", 44 | "computed": "asSpecified", 45 | "order": "orderOfAppearance", 46 | "status": "standard", 47 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/negative" 48 | }, 49 | "pad": { 50 | "syntax": " && ", 51 | "media": "all", 52 | "initial": "0 \"\"", 53 | "percentages": "no", 54 | "computed": "asSpecified", 55 | "order": "uniqueOrder", 56 | "status": "standard", 57 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/pad" 58 | }, 59 | "prefix": { 60 | "syntax": "", 61 | "media": "all", 62 | "initial": "\"\"", 63 | "percentages": "no", 64 | "computed": "asSpecified", 65 | "order": "uniqueOrder", 66 | "status": "standard", 67 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/prefix" 68 | }, 69 | "range": { 70 | "syntax": "[ [ | infinite ]{2} ]# | auto", 71 | "media": "all", 72 | "initial": "auto", 73 | "percentages": "no", 74 | "computed": "asSpecified", 75 | "order": "orderOfAppearance", 76 | "status": "standard", 77 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/range" 78 | }, 79 | "speak-as": { 80 | "syntax": "auto | bullets | numbers | words | spell-out | ", 81 | "media": "all", 82 | "initial": "auto", 83 | "percentages": "no", 84 | "computed": "asSpecified", 85 | "order": "uniqueOrder", 86 | "status": "standard", 87 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/speak-as" 88 | }, 89 | "suffix": { 90 | "syntax": "", 91 | "media": "all", 92 | "initial": "\". \"", 93 | "percentages": "no", 94 | "computed": "asSpecified", 95 | "order": "uniqueOrder", 96 | "status": "standard", 97 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/suffix" 98 | }, 99 | "symbols": { 100 | "syntax": "+", 101 | "media": "all", 102 | "initial": "n/a (required)", 103 | "percentages": "no", 104 | "computed": "asSpecified", 105 | "order": "orderOfAppearance", 106 | "status": "standard", 107 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/symbols" 108 | }, 109 | "system": { 110 | "syntax": "cyclic | numeric | alphabetic | symbolic | additive | [ fixed ? ] | [ extends ]", 111 | "media": "all", 112 | "initial": "symbolic", 113 | "percentages": "no", 114 | "computed": "asSpecified", 115 | "order": "uniqueOrder", 116 | "status": "standard", 117 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/system" 118 | } 119 | }, 120 | "status": "standard", 121 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style" 122 | }, 123 | "@container": { 124 | "syntax": "@container # {\n \n}", 125 | "interfaces": [ 126 | "CSSContainerRule" 127 | ], 128 | "groups": [ 129 | "CSS Conditional Rules" 130 | ], 131 | "status": "standard", 132 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@container" 133 | }, 134 | "@document": { 135 | "syntax": "@document [ | url-prefix() | domain() | media-document() | regexp() ]# {\n \n}", 136 | "interfaces": [ 137 | "CSSDocumentRule" 138 | ], 139 | "groups": [ 140 | "CSS Conditional Rules" 141 | ], 142 | "status": "nonstandard", 143 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@document" 144 | }, 145 | "@font-face": { 146 | "syntax": "@font-face {\n [ font-family: ; ] ||\n [ src: ; ] ||\n [ unicode-range: ; ] ||\n [ font-variant: ; ] ||\n [ font-feature-settings: ; ] ||\n [ font-variation-settings: ; ] ||\n [ font-stretch: ; ] ||\n [ font-weight: ; ] ||\n [ font-style: ; ] ||\n [ size-adjust: ; ] ||\n [ ascent-override: ; ] ||\n [ descent-override: ; ] ||\n [ line-gap-override: ; ]\n}", 147 | "interfaces": [ 148 | "CSSFontFaceRule" 149 | ], 150 | "groups": [ 151 | "CSS Fonts" 152 | ], 153 | "descriptors": { 154 | "ascent-override": { 155 | "syntax": "normal | ", 156 | "media": "all", 157 | "initial": "normal", 158 | "percentages": "asSpecified", 159 | "computed": "asSpecified", 160 | "order": "orderOfAppearance", 161 | "status": "standard", 162 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/ascent-override" 163 | }, 164 | "descent-override": { 165 | "syntax": "normal | ", 166 | "media": "all", 167 | "initial": "normal", 168 | "percentages": "asSpecified", 169 | "computed": "asSpecified", 170 | "order": "orderOfAppearance", 171 | "status": "standard", 172 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/descent-override" 173 | }, 174 | "font-display": { 175 | "syntax": "auto | block | swap | fallback | optional", 176 | "media": "visual", 177 | "percentages": "no", 178 | "initial": "auto", 179 | "computed": "asSpecified", 180 | "order": "uniqueOrder", 181 | "status": "standard", 182 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-display" 183 | }, 184 | "font-family": { 185 | "syntax": "", 186 | "media": "all", 187 | "initial": "n/a (required)", 188 | "percentages": "no", 189 | "computed": "asSpecified", 190 | "order": "uniqueOrder", 191 | "status": "standard", 192 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-family" 193 | }, 194 | "font-feature-settings": { 195 | "syntax": "normal | #", 196 | "media": "all", 197 | "initial": "normal", 198 | "percentages": "no", 199 | "computed": "asSpecified", 200 | "order": "orderOfAppearance", 201 | "status": "standard", 202 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-feature-settings" 203 | }, 204 | "font-stretch": { 205 | "syntax": "{1,2}", 206 | "media": "all", 207 | "initial": "normal", 208 | "percentages": "no", 209 | "computed": "asSpecified", 210 | "order": "uniqueOrder", 211 | "status": "obsolete", 212 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-stretch" 213 | }, 214 | "font-style": { 215 | "syntax": "normal | italic | oblique {0,2}", 216 | "media": "all", 217 | "initial": "normal", 218 | "percentages": "no", 219 | "computed": "asSpecified", 220 | "order": "uniqueOrder", 221 | "status": "standard", 222 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-style" 223 | }, 224 | "font-variation-settings": { 225 | "syntax": "normal | [ ]#", 226 | "media": "all", 227 | "initial": "normal", 228 | "percentages": "no", 229 | "computed": "asSpecified", 230 | "order": "orderOfAppearance", 231 | "status": "standard", 232 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-variation-settings" 233 | }, 234 | "font-weight": { 235 | "syntax": "{1,2}", 236 | "media": "all", 237 | "initial": "normal", 238 | "percentages": "no", 239 | "computed": "asSpecified", 240 | "order": "uniqueOrder", 241 | "status": "standard", 242 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-weight" 243 | }, 244 | "line-gap-override": { 245 | "syntax": "normal | ", 246 | "media": "all", 247 | "initial": "normal", 248 | "percentages": "asSpecified", 249 | "computed": "asSpecified", 250 | "order": "orderOfAppearance", 251 | "status": "standard", 252 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/line-gap-override" 253 | }, 254 | "size-adjust": { 255 | "syntax": "", 256 | "media": "all", 257 | "initial": "100%", 258 | "percentages": "asSpecified", 259 | "computed": "asSpecified", 260 | "order": "orderOfAppearance", 261 | "status": "standard", 262 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/size-adjust" 263 | }, 264 | "src": { 265 | "syntax": "[ [ format( # ) ]? | local( ) ]#", 266 | "media": "all", 267 | "initial": "n/a (required)", 268 | "percentages": "no", 269 | "computed": "asSpecified", 270 | "order": "orderOfAppearance", 271 | "status": "standard", 272 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/src" 273 | }, 274 | "unicode-range": { 275 | "syntax": "#", 276 | "media": "all", 277 | "initial": "U+0-10FFFF", 278 | "percentages": "no", 279 | "computed": "asSpecified", 280 | "order": "orderOfAppearance", 281 | "status": "standard", 282 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/unicode-range" 283 | } 284 | }, 285 | "status": "standard", 286 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face" 287 | }, 288 | "@font-feature-values": { 289 | "syntax": "@font-feature-values # {\n \n}", 290 | "interfaces": [ 291 | "CSSFontFeatureValuesRule" 292 | ], 293 | "groups": [ 294 | "CSS Fonts" 295 | ], 296 | "status": "standard", 297 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-feature-values" 298 | }, 299 | "@font-palette-values": { 300 | "syntax": "@font-palette-values {\n \n}", 301 | "interfaces": [ 302 | "CSSFontPaletteValuesRule" 303 | ], 304 | "groups": [ 305 | "CSS Fonts" 306 | ], 307 | "descriptors": { 308 | "base-palette": { 309 | "syntax": "light | dark | ", 310 | "media": "all", 311 | "initial": "n/a (required)", 312 | "percentages": "no", 313 | "computed": "asSpecified", 314 | "order": "uniqueOrder", 315 | "status": "standard", 316 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values/base-palette" 317 | }, 318 | "font-family": { 319 | "syntax": "#", 320 | "media": "all", 321 | "initial": "n/a (required)", 322 | "percentages": "no", 323 | "computed": "asSpecified", 324 | "order": "orderOfAppearance", 325 | "status": "standard", 326 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values/font-family" 327 | }, 328 | "override-colors": { 329 | "syntax": "[ ]#", 330 | "media": "all", 331 | "initial": "n/a (required)", 332 | "percentages": "no", 333 | "computed": "asSpecified", 334 | "order": "orderOfAppearance", 335 | "status": "standard", 336 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values/override-colors" 337 | } 338 | }, 339 | "status": "standard", 340 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values" 341 | }, 342 | "@import": { 343 | "syntax": "@import [ | ]\n [ layer | layer() ]?\n [ supports( [ | ] ) ]?\n ? ;", 344 | "interfaces": [ 345 | "CSSImportRule" 346 | ], 347 | "groups": [ 348 | "CSS Cascading and Inheritance" 349 | ], 350 | "status": "standard", 351 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@import" 352 | }, 353 | "@keyframes": { 354 | "syntax": "@keyframes {\n \n}", 355 | "interfaces": [ 356 | "CSSKeyframeRule", 357 | "CSSKeyframesRule" 358 | ], 359 | "groups": [ 360 | "CSS Animations" 361 | ], 362 | "status": "standard", 363 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@keyframes" 364 | }, 365 | "@layer": { 366 | "syntax": "@layer [ # | ? {\n \n} ]", 367 | "interfaces": [ 368 | "CSSLayerBlockRule", 369 | "CSSLayerStatementRule" 370 | ], 371 | "groups": [ 372 | "CSS Cascading and Inheritance" 373 | ], 374 | "status": "standard", 375 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@layer" 376 | }, 377 | "@media": { 378 | "syntax": "@media {\n \n}", 379 | "interfaces": [ 380 | "CSSMediaRule" 381 | ], 382 | "groups": [ 383 | "CSS Conditional Rules", 384 | "Media Queries" 385 | ], 386 | "status": "standard", 387 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@media" 388 | }, 389 | "@namespace": { 390 | "syntax": "@namespace ? [ | ];", 391 | "interfaces": [ 392 | "CSSNamespaceRule" 393 | ], 394 | "groups": [ 395 | "CSS Namespaces" 396 | ], 397 | "status": "standard", 398 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@namespace" 399 | }, 400 | "@page": { 401 | "syntax": "@page {\n \n}", 402 | "interfaces": [ 403 | "CSSPageRule" 404 | ], 405 | "groups": [ 406 | "CSS Paged Media" 407 | ], 408 | "descriptors": { 409 | "bleed": { 410 | "syntax": "auto | ", 411 | "media": [ 412 | "visual", 413 | "paged" 414 | ], 415 | "initial": "auto", 416 | "percentages": "no", 417 | "computed": "asSpecified", 418 | "order": "uniqueOrder", 419 | "status": "standard" 420 | }, 421 | "marks": { 422 | "syntax": "none | [ crop || cross ]", 423 | "media": [ 424 | "visual", 425 | "paged" 426 | ], 427 | "initial": "none", 428 | "percentages": "no", 429 | "computed": "asSpecified", 430 | "order": "orderOfAppearance", 431 | "status": "standard" 432 | }, 433 | "page-orientation": { 434 | "syntax": "upright | rotate-left | rotate-right ", 435 | "media": [ 436 | "visual", 437 | "paged" 438 | ], 439 | "initial": "upright", 440 | "percentages": "no", 441 | "computed": "asSpecified", 442 | "order": "orderOfAppearance", 443 | "status": "standard", 444 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@page/page-orientation" 445 | }, 446 | "size": { 447 | "syntax": "{1,2} | auto | [ || [ portrait | landscape ] ]", 448 | "media": [ 449 | "visual", 450 | "paged" 451 | ], 452 | "initial": "auto", 453 | "percentages": "no", 454 | "computed": "asSpecifiedRelativeToAbsoluteLengths", 455 | "order": "orderOfAppearance", 456 | "status": "standard", 457 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@page/size" 458 | } 459 | }, 460 | "status": "standard", 461 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@page" 462 | }, 463 | "@position-try": { 464 | "syntax": "@position-try {\n \n}", 465 | "interfaces": [ 466 | "CSSPositionTryRule" 467 | ], 468 | "groups": [ 469 | "CSS Anchor Positioning" 470 | ], 471 | "status": "experimental", 472 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@position-try" 473 | }, 474 | "@property": { 475 | "syntax": "@property {\n \n}", 476 | "interfaces": [ 477 | "CSSPropertyRule" 478 | ], 479 | "groups": [ 480 | "CSS Houdini" 481 | ], 482 | "descriptors": { 483 | "inherits": { 484 | "syntax": "true | false", 485 | "media": "all", 486 | "percentages": "no", 487 | "initial": "auto", 488 | "computed": "asSpecified", 489 | "order": "uniqueOrder", 490 | "status": "standard", 491 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property/inherits" 492 | }, 493 | "initial-value": { 494 | "syntax": "?", 495 | "media": "all", 496 | "initial": "n/a (required)", 497 | "percentages": "no", 498 | "computed": "asSpecified", 499 | "order": "uniqueOrder", 500 | "status": "standard", 501 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property/initial-value" 502 | }, 503 | "syntax": { 504 | "syntax": "", 505 | "media": "all", 506 | "percentages": "no", 507 | "initial": "n/a (required)", 508 | "computed": "asSpecified", 509 | "order": "uniqueOrder", 510 | "status": "standard", 511 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property/syntax" 512 | } 513 | }, 514 | "status": "standard", 515 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property" 516 | }, 517 | "@scope": { 518 | "syntax": "@scope [()]? [to ()]? {\n \n}", 519 | "interfaces": [ 520 | "CSSScopeRule" 521 | ], 522 | "groups": [ 523 | "CSS Conditional Rules" 524 | ], 525 | "status": "standard", 526 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@scope" 527 | }, 528 | "@starting-style": { 529 | "syntax": "@starting-style {\n | \n}", 530 | "interfaces": [ 531 | "CSSStartingStyleRule" 532 | ], 533 | "groups": [ 534 | "CSS Transitions" 535 | ], 536 | "status": "standard", 537 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@starting-style" 538 | }, 539 | "@supports": { 540 | "syntax": "@supports {\n \n}", 541 | "interfaces": [ 542 | "CSSSupportsRule" 543 | ], 544 | "groups": [ 545 | "CSS Conditional Rules" 546 | ], 547 | "status": "standard", 548 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@supports" 549 | }, 550 | "@view-transition": { 551 | "syntax": "@view-transition {\n \n}", 552 | "interfaces": [ 553 | "CSSViewTransitionRule" 554 | ], 555 | "groups": [ 556 | "CSS View Transitions" 557 | ], 558 | "descriptors": { 559 | "navigation": { 560 | "syntax": "auto | none", 561 | "media": "all", 562 | "initial": "none", 563 | "percentages": "no", 564 | "computed": "asSpecified", 565 | "order": "uniqueOrder", 566 | "status": "standard" 567 | }, 568 | "types": { 569 | "syntax": "none | +", 570 | "media": "all", 571 | "initial": "none", 572 | "percentages": "no", 573 | "computed": "asSpecified", 574 | "order": "uniqueOrder", 575 | "status": "standard" 576 | } 577 | }, 578 | "status": "standard", 579 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@view-transition" 580 | } 581 | } 582 | -------------------------------------------------------------------------------- /css/at-rules.md: -------------------------------------------------------------------------------- 1 | # At-rules 2 | 3 | [data](https://github.com/mdn/data/blob/main/css/at-rules.json) | 4 | [schema](https://github.com/mdn/data/blob/main/css/at-rules.schema.json) 5 | 6 | An [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule) is a CSS statement beginning with an at sign (@) that instructs CSS how to behave. There are several available identifiers defining what CSS should do in certain situations. 7 | 8 | ## Structure for simple at-rules 9 | 10 | A simple at-rule object might look like this: 11 | 12 | ```json 13 | "@myRule": { 14 | "syntax": "@myRule {\n \n};", 15 | "groups": [ 16 | "CSS myGroup" 17 | ], 18 | "status": "standard" 19 | }, 20 | ``` 21 | 22 | The 3 properties seen above are all required: 23 | 24 | * `syntax` (string): This is the formal syntax of the at-rule and is usually found in the specification. 25 | * `groups` (array of strings): CSS is organized in modules like "CSS Fonts" or "CSS Animations". MDN organizes features in these groups as well — `groups` should contain the name of the module(s) the at-rule is defined in. 26 | * `status` (enum string): This is either `standard`, `nonstandard`, `experimental` or `obsolete` depending on the standardization status of the feature. 27 | 28 | There are 3 more properties that are optional: 29 | * `mdn_url` (string): a URL linking to the at-rule's page on MDN. This URL must omit the localization part of the URL (such as `en-US/`). 30 | * `interfaces` (array of strings): These are the [CSSOM](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model) interfaces that belong to the at-rule. Note that inherited interfaces like `CSSGroupingRule` or `CSSConditionRule` should not be included. 31 | * `descriptors` (object): see below 32 | 33 | ## Structure for at-rules with descriptors 34 | 35 | The `descriptors` object (when included) contains one or more objects that describe the different descriptors available on the at-rule. Look at `@font-face`, for example: 36 | 37 | ```json 38 | "@font-face": { 39 | "syntax": "...", 40 | "interfaces": [], 41 | "groups": [], 42 | "descriptors": { 43 | "font-display": { 44 | "syntax": "[ auto | block | swap | fallback | optional ]", 45 | "media": "visual", 46 | "percentages": "no", 47 | "initial": "auto", 48 | "computed": "asSpecified", 49 | "order": "uniqueOrder", 50 | "status": "experimental" 51 | }, 52 | "font-family": { 53 | "syntax": "", 54 | "media": "all", 55 | "initial": "n/a (required)", 56 | "percentages": "no", 57 | "computed": "asSpecified", 58 | "order": "uniqueOrder", 59 | "status": "standard" 60 | } 61 | }, 62 | "status": "standard" 63 | } 64 | ``` 65 | 66 | Each `descriptors` object consists of 7 required properties: 67 | * `syntax` (string): The syntax / possible values of the descriptor. 68 | * `media` (string): The media groups the descriptor applies to, e.g. "all, visual" (multiple values are comma-separated). 69 | * `percentages` (string or array of strings): 70 | * If it is an array, the elements are the other descriptors this descriptor is taking the percentages from (array elements must be in a descriptors list). 71 | * If it is a string, it indicates the percentage value of the descriptor. 72 | * `initial` (string or array of strings): 73 | * If it is an array, the elements are the other descriptors this descriptor is taking the initial values from (array elements must be in a descriptors list). 74 | * If it is a string, it indicates the initial value of the descriptor. 75 | * `computed` (string or array of strings): 76 | * If it is an array, the elements are the other descriptors this descriptor is computed from (array elements must be in a descriptors list). 77 | * If it is a string, it indicates the computed value of the descriptor. 78 | * `order` (enum string): Either `orderOfAppearance` or `uniqueOrder`. 79 | -------------------------------------------------------------------------------- /css/at-rules.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "stringOrPropertyList": { 4 | "oneOf": [ 5 | { 6 | "type": "string" 7 | }, 8 | { 9 | "type": "array", 10 | "minItems": 1, 11 | "uniqueItems": true, 12 | "items": { 13 | "type": "string", 14 | "property-reference": { 15 | "comment": "property-reference is an extension to the JSON schema validator. Here it jumps 3 levels up in the hierarchy and tests if a value is an existing key in descriptors. See test/validate-schema.js for implementation details.", 16 | "$data": "3" 17 | } 18 | } 19 | } 20 | ] 21 | } 22 | }, 23 | "type": "object", 24 | "additionalProperties": { 25 | "type": "object", 26 | "additionalProperties": false, 27 | "properties": { 28 | "syntax": { 29 | "type": "string" 30 | }, 31 | "interfaces": { 32 | "type": "array", 33 | "items": { 34 | "type": "string" 35 | } 36 | }, 37 | "groups": { 38 | "type": "array", 39 | "minitems": 1, 40 | "uniqueItems": true, 41 | "items": { 42 | "$ref": "definitions.json#/groupList" 43 | } 44 | }, 45 | "descriptors": { 46 | "type": "object", 47 | "additionalProperties": { 48 | "type": "object", 49 | "additionalProperties": false, 50 | "properties": { 51 | "syntax": { 52 | "type": "string" 53 | }, 54 | "media": { 55 | "oneOf": [ 56 | { 57 | "type": "string", 58 | "enum": [ 59 | "all", 60 | "continuous", 61 | "paged", 62 | "visual" 63 | ] 64 | }, 65 | { 66 | "type": "array", 67 | "minItems": 2, 68 | "uniqueItems": true, 69 | "items": { 70 | "type": "string", 71 | "enum": [ 72 | "continuous", 73 | "paged", 74 | "visual" 75 | ] 76 | } 77 | } 78 | ] 79 | }, 80 | "initial": { 81 | "$ref": "#/definitions/stringOrPropertyList" 82 | }, 83 | "percentages": { 84 | "$ref": "#/definitions/stringOrPropertyList" 85 | }, 86 | "computed": { 87 | "$ref": "#/definitions/stringOrPropertyList" 88 | }, 89 | "order": { 90 | "enum": [ 91 | "orderOfAppearance", 92 | "uniqueOrder" 93 | ] 94 | }, 95 | "status": { 96 | "enum": [ 97 | "standard", 98 | "nonstandard", 99 | "experimental", 100 | "obsolete" 101 | ] 102 | }, 103 | "mdn_url": { 104 | "type": "string", 105 | "pattern": "^https://developer.mozilla.org/docs/Web/CSS/" 106 | } 107 | }, 108 | "required": [ 109 | "syntax", 110 | "initial", 111 | "percentages", 112 | "computed", 113 | "order", 114 | "status" 115 | ] 116 | } 117 | }, 118 | "status": { 119 | "enum": [ 120 | "standard", 121 | "nonstandard", 122 | "experimental", 123 | "obsolete" 124 | ] 125 | }, 126 | "mdn_url": { 127 | "type": "string", 128 | "pattern": "^https://developer.mozilla.org/docs/Web/CSS/" 129 | } 130 | }, 131 | "required": [ 132 | "syntax", 133 | "groups", 134 | "status" 135 | ] 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /css/definitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "groupList": { 3 | "enum": [ 4 | "Basic Selectors", 5 | "Combinators", 6 | "Compositing and Blending", 7 | "CSS Anchor Positioning", 8 | "CSS Animations", 9 | "CSS Backgrounds and Borders", 10 | "CSS Basic User Interface", 11 | "CSS Box Alignment", 12 | "CSS Box Model", 13 | "CSS Box Sizing", 14 | "CSS Cascading and Inheritance", 15 | "CSS Color", 16 | "CSS Conditional Rules", 17 | "CSS Containment", 18 | "CSS Counter Styles", 19 | "CSS Custom Properties for Cascading Variables", 20 | "CSS Display", 21 | "CSS Easing Functions", 22 | "CSS Environment Variables", 23 | "CSS Flexible Box Layout", 24 | "CSS Fonts", 25 | "CSS Form Control Styling", 26 | "CSS Fragmentation", 27 | "CSS Generated Content", 28 | "CSS Grid Layout", 29 | "CSS Houdini", 30 | "CSS Images", 31 | "CSS Inline", 32 | "CSS Lists and Counters", 33 | "CSS Logical Properties and Values", 34 | "CSS Masking", 35 | "CSS Mobile Text Size Adjustment", 36 | "CSS Motion Path", 37 | "CSS Multi-column Layout", 38 | "CSS Namespaces", 39 | "CSS Overflow", 40 | "CSS Overscroll Behavior", 41 | "CSS Paged Media", 42 | "CSS Positioned Layout", 43 | "CSS Regions", 44 | "CSS Resolutions", 45 | "CSS Rhythmic Sizing", 46 | "CSS Ruby", 47 | "CSS Scroll Anchoring", 48 | "CSS Scroll Snap", 49 | "CSS Scrollbars Styling", 50 | "CSS Shadow Parts", 51 | "CSS Shapes", 52 | "CSS Speech", 53 | "CSS Syntax", 54 | "CSS Table", 55 | "CSS Text", 56 | "CSS Text Decoration", 57 | "CSS Transforms", 58 | "CSS Transitions", 59 | "CSS Types", 60 | "CSS Values and Units", 61 | "CSS View Transitions", 62 | "CSS Viewport", 63 | "CSS Will Change", 64 | "CSS Writing Modes", 65 | "Filter Effects", 66 | "Grouping Selectors", 67 | "MathML", 68 | "Media Queries", 69 | "Microsoft Extensions", 70 | "Motion Path", 71 | "Mozilla Extensions", 72 | "Pointer Events", 73 | "Pseudo", 74 | "Pseudo-classes", 75 | "Pseudo-elements", 76 | "Selectors", 77 | "Scalable Vector Graphics", 78 | "Scroll-driven Animations", 79 | "WebKit Extensions" 80 | ] 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /css/functions.json: -------------------------------------------------------------------------------- 1 | { 2 | "abs()": { 3 | "syntax": "abs( )", 4 | "groups": [ 5 | "CSS Values and Units" 6 | ], 7 | "status": "standard", 8 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/abs" 9 | }, 10 | "acos()": { 11 | "syntax": "acos( )", 12 | "groups": [ 13 | "CSS Values and Units" 14 | ], 15 | "status": "standard", 16 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/acos" 17 | }, 18 | "anchor()": { 19 | "syntax": "anchor( ? && , ? )", 20 | "groups": [ 21 | "CSS Anchor Positioning" 22 | ], 23 | "status": "experimental", 24 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/anchor" 25 | }, 26 | "anchor-size()": { 27 | "syntax": "anchor-size( [ || ]? , ? )", 28 | "groups": [ 29 | "CSS Anchor Positioning" 30 | ], 31 | "status": "experimental", 32 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/anchor-size" 33 | }, 34 | "asin()": { 35 | "syntax": "asin( )", 36 | "groups": [ 37 | "CSS Values and Units" 38 | ], 39 | "status": "standard", 40 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/asin" 41 | }, 42 | "atan()": { 43 | "syntax": "atan( )", 44 | "groups": [ 45 | "CSS Values and Units" 46 | ], 47 | "status": "standard", 48 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/atan" 49 | }, 50 | "atan2()": { 51 | "syntax": "atan2( , )", 52 | "groups": [ 53 | "CSS Values and Units" 54 | ], 55 | "status": "standard", 56 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/atan2" 57 | }, 58 | "attr()": { 59 | "syntax": "attr( ? [, ]? )", 60 | "groups": [ 61 | "CSS Values and Units" 62 | ], 63 | "status": "standard", 64 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/attr" 65 | }, 66 | "blur()": { 67 | "syntax": "blur( ? )", 68 | "groups": [ 69 | "Filter Effects" 70 | ], 71 | "status": "standard", 72 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/blur" 73 | }, 74 | "brightness()": { 75 | "syntax": "brightness( [ | ]? )", 76 | "groups": [ 77 | "Filter Effects" 78 | ], 79 | "status": "standard", 80 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/brightness" 81 | }, 82 | "calc()": { 83 | "syntax": "calc( )", 84 | "groups": [ 85 | "CSS Values and Units" 86 | ], 87 | "status": "standard", 88 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/calc" 89 | }, 90 | "calc-size()": { 91 | "syntax": "calc-size( , )", 92 | "groups": [ 93 | "CSS Values and Units" 94 | ], 95 | "status": "experimental", 96 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/calc-size" 97 | }, 98 | "circle()": { 99 | "syntax": "circle( ? [ at ]? )", 100 | "groups": [ 101 | "CSS Shapes" 102 | ], 103 | "status": "standard", 104 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/circle" 105 | }, 106 | "clamp()": { 107 | "syntax": "clamp( #{3} )", 108 | "groups": [ 109 | "CSS Values and Units" 110 | ], 111 | "status": "standard", 112 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/clamp" 113 | }, 114 | "color()": { 115 | "syntax": "color( [ from ]? [ / [ | none ] ]? )", 116 | "groups": [ 117 | "CSS Color" 118 | ], 119 | "status": "standard", 120 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/color" 121 | }, 122 | "color-mix()": { 123 | "syntax": "color-mix( , [ && ? ]#{2})", 124 | "groups": [ 125 | "CSS Color" 126 | ], 127 | "status": "standard", 128 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/color-mix" 129 | }, 130 | "conic-gradient()": { 131 | "syntax": "conic-gradient( [ ] )", 132 | "groups": [ 133 | "CSS Images" 134 | ], 135 | "status": "standard", 136 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/conic-gradient" 137 | }, 138 | "contrast()": { 139 | "syntax": "contrast( [ | ]? )", 140 | "groups": [ 141 | "Filter Effects" 142 | ], 143 | "status": "standard", 144 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/contrast" 145 | }, 146 | "cos()": { 147 | "syntax": "cos( )", 148 | "groups": [ 149 | "CSS Values and Units" 150 | ], 151 | "status": "standard", 152 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cos" 153 | }, 154 | "counter()": { 155 | "syntax": "counter( , ? )", 156 | "groups": [ 157 | "CSS Lists and Counters" 158 | ], 159 | "status": "standard", 160 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/counter" 161 | }, 162 | "counters()": { 163 | "syntax": "counters( , , ? )", 164 | "groups": [ 165 | "CSS Lists and Counters" 166 | ], 167 | "status": "standard", 168 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/counters" 169 | }, 170 | "cross-fade()": { 171 | "syntax": "cross-fade( , ? )", 172 | "groups": [ 173 | "CSS Images" 174 | ], 175 | "status": "standard", 176 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cross-fade" 177 | }, 178 | "cubic-bezier()": { 179 | "syntax": "cubic-bezier( [ , ]#{2} )", 180 | "groups": [ 181 | "CSS Easing Functions" 182 | ], 183 | "status": "standard", 184 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function/cubic-bezier" 185 | }, 186 | "drop-shadow()": { 187 | "syntax": "drop-shadow( [ ? && {2,3} ] )", 188 | "groups": [ 189 | "Filter Effects" 190 | ], 191 | "status": "standard", 192 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/drop-shadow" 193 | }, 194 | "element()": { 195 | "syntax": "element( )", 196 | "groups": [ 197 | "CSS Images" 198 | ], 199 | "status": "experimental", 200 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/element" 201 | }, 202 | "ellipse()": { 203 | "syntax": "ellipse( ? [ at ]? )", 204 | "groups": [ 205 | "CSS Shapes" 206 | ], 207 | "status": "standard", 208 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/ellipse" 209 | }, 210 | "env()": { 211 | "syntax": "env( , ? )", 212 | "groups": [ 213 | "CSS Environment Variables" 214 | ], 215 | "status": "standard", 216 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/env" 217 | }, 218 | "exp()": { 219 | "syntax": "exp( )", 220 | "groups": [ 221 | "CSS Values and Units" 222 | ], 223 | "status": "standard", 224 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/exp" 225 | }, 226 | "fit-content()": { 227 | "syntax": "fit-content( )", 228 | "groups": [ 229 | "CSS Box Sizing", 230 | "CSS Grid Layout" 231 | ], 232 | "status": "standard", 233 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fit-content_function" 234 | }, 235 | "grayscale()": { 236 | "syntax": "grayscale( [ | ]? )", 237 | "groups": [ 238 | "Filter Effects" 239 | ], 240 | "status": "standard", 241 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/grayscale" 242 | }, 243 | "hsl()": { 244 | "syntax": "hsl( , , , ? ) | hsl( [ | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? )", 245 | "groups": [ 246 | "CSS Color" 247 | ], 248 | "status": "standard", 249 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/hsl" 250 | }, 251 | "hsla()": { 252 | "syntax": "hsla( , , , ? ) | hsla( [ | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? )", 253 | "groups": [ 254 | "CSS Color" 255 | ], 256 | "status": "nonstandard", 257 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/hsl" 258 | }, 259 | "hue-rotate()": { 260 | "syntax": "hue-rotate( [ | ]? )", 261 | "groups": [ 262 | "Filter Effects" 263 | ], 264 | "status": "standard", 265 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/hue-rotate" 266 | }, 267 | "hwb()": { 268 | "syntax": "hwb( [ | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? )", 269 | "groups": [ 270 | "CSS Color" 271 | ], 272 | "status": "standard", 273 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/hwb" 274 | }, 275 | "hypot()": { 276 | "syntax": "hypot( # )", 277 | "groups": [ 278 | "CSS Values and Units" 279 | ], 280 | "status": "standard", 281 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/hypot" 282 | }, 283 | "image()": { 284 | "syntax": "image( ? [ ? , ? ]! )", 285 | "groups": [ 286 | "CSS Images" 287 | ], 288 | "status": "standard", 289 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image/image" 290 | }, 291 | "image-set()": { 292 | "syntax": "image-set( # )", 293 | "groups": [ 294 | "CSS Images" 295 | ], 296 | "status": "standard", 297 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image/image-set" 298 | }, 299 | "inset()": { 300 | "syntax": "inset( {1,4} [ round <'border-radius'> ]? )", 301 | "groups": [ 302 | "CSS Shapes" 303 | ], 304 | "status": "standard", 305 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/inset" 306 | }, 307 | "invert()": { 308 | "syntax": "invert( [ | ]? )", 309 | "groups": [ 310 | "Filter Effects" 311 | ], 312 | "status": "standard", 313 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/invert" 314 | }, 315 | "lab()": { 316 | "syntax": "lab( [ | | none] [ | | none] [ | | none] [ / [ | none] ]? )", 317 | "groups": [ 318 | "CSS Color" 319 | ], 320 | "status": "standard", 321 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/lab" 322 | }, 323 | "layer()": { 324 | "syntax": "layer( )", 325 | "groups": [ 326 | "CSS Cascading and Inheritance" 327 | ], 328 | "status": "standard", 329 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@import/layer_function" 330 | }, 331 | "lch()": { 332 | "syntax": "lch( [ | | none] [ | | none] [ | none] [ / [ | none] ]? )", 333 | "groups": [ 334 | "CSS Color" 335 | ], 336 | "status": "standard", 337 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/lch" 338 | }, 339 | "leader()": { 340 | "syntax": "leader( )", 341 | "groups": [ 342 | "CSS Generated Content" 343 | ], 344 | "status": "experimental" 345 | }, 346 | "light-dark()": { 347 | "syntax": "light-dark( , )", 348 | "groups": [ 349 | "CSS Color" 350 | ], 351 | "status": "standard", 352 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/light-dark" 353 | }, 354 | "linear()": { 355 | "syntax": "linear( [ && {0,2} ]# )", 356 | "groups": [ 357 | "CSS Easing Functions" 358 | ], 359 | "status": "standard", 360 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function/linear" 361 | }, 362 | "linear-gradient()": { 363 | "syntax": "linear-gradient( [ ] )", 364 | "groups": [ 365 | "CSS Images" 366 | ], 367 | "status": "standard", 368 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/linear-gradient" 369 | }, 370 | "log()": { 371 | "syntax": "log( , ? )", 372 | "groups": [ 373 | "CSS Values and Units" 374 | ], 375 | "status": "standard", 376 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/log" 377 | }, 378 | "matrix()": { 379 | "syntax": "matrix( #{6} )", 380 | "groups": [ 381 | "CSS Transforms" 382 | ], 383 | "status": "standard", 384 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/matrix" 385 | }, 386 | "matrix3d()": { 387 | "syntax": "matrix3d( #{16} )", 388 | "groups": [ 389 | "CSS Transforms" 390 | ], 391 | "status": "standard", 392 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/matrix3d" 393 | }, 394 | "max()": { 395 | "syntax": "max( # )", 396 | "groups": [ 397 | "CSS Values and Units" 398 | ], 399 | "status": "standard", 400 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/max" 401 | }, 402 | "min()": { 403 | "syntax": "min( # )", 404 | "groups": [ 405 | "CSS Values and Units" 406 | ], 407 | "status": "standard", 408 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/min" 409 | }, 410 | "minmax()": { 411 | "syntax": "minmax( [ | min-content | max-content | auto ] , [ | | min-content | max-content | auto ] )", 412 | "groups": [ 413 | "CSS Values and Units" 414 | ], 415 | "status": "standard", 416 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/minmax" 417 | }, 418 | "mod()": { 419 | "syntax": "mod( , )", 420 | "groups": [ 421 | "CSS Values and Units" 422 | ], 423 | "status": "standard", 424 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mod" 425 | }, 426 | "oklab()": { 427 | "syntax": "oklab( [ | | none] [ | | none] [ | | none] [ / [ | none] ]? )", 428 | "groups": [ 429 | "CSS Color" 430 | ], 431 | "status": "standard", 432 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/oklab" 433 | }, 434 | "oklch()": { 435 | "syntax": "oklch( [ | | none] [ | | none] [ | none] [ / [ | none] ]? )", 436 | "groups": [ 437 | "CSS Color" 438 | ], 439 | "status": "standard", 440 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/oklch" 441 | }, 442 | "opacity()": { 443 | "syntax": "opacity( [ | ]? )", 444 | "groups": [ 445 | "Filter Effects" 446 | ], 447 | "status": "standard", 448 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/opacity" 449 | }, 450 | "paint()": { 451 | "syntax": "paint( , ? )", 452 | "groups": [ 453 | "CSS Houdini" 454 | ], 455 | "status": "standard", 456 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image/paint" 457 | }, 458 | "palette-mix()": { 459 | "syntax": "palette-mix( , [ [normal | light | dark | | ] && ? ]#{2})", 460 | "groups": [ 461 | "CSS Fonts" 462 | ], 463 | "status": "standard", 464 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-palette/palette-mix" 465 | }, 466 | "path()": { 467 | "syntax": "path( <'fill-rule'>? , )", 468 | "groups": [ 469 | "CSS Shapes" 470 | ], 471 | "status": "standard", 472 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/path" 473 | }, 474 | "perspective()": { 475 | "syntax": "perspective( [ | none ] )", 476 | "groups": [ 477 | "CSS Transforms" 478 | ], 479 | "status": "standard", 480 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/perspective" 481 | }, 482 | "polygon()": { 483 | "syntax": "polygon( <'fill-rule'>? , [ ]# )", 484 | "groups": [ 485 | "CSS Shapes" 486 | ], 487 | "status": "standard", 488 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/polygon" 489 | }, 490 | "pow()": { 491 | "syntax": "pow( , )", 492 | "groups": [ 493 | "CSS Values and Units" 494 | ], 495 | "status": "standard", 496 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/pow" 497 | }, 498 | "radial-gradient()": { 499 | "syntax": "radial-gradient( [ ] )", 500 | "groups": [ 501 | "CSS Images" 502 | ], 503 | "status": "standard", 504 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/radial-gradient" 505 | }, 506 | "ray()": { 507 | "syntax": "ray( && ? && contain? && [at ]? )", 508 | "groups": [ 509 | "Motion Path" 510 | ], 511 | "status": "standard", 512 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ray" 513 | }, 514 | "rect()": { 515 | "syntax": "rect( [ | auto ]{4} [ round <'border-radius'> ]? )", 516 | "groups": [ 517 | "CSS Shapes" 518 | ], 519 | "status": "standard", 520 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/rect" 521 | }, 522 | "rem()": { 523 | "syntax": "rem( , )", 524 | "groups": [ 525 | "CSS Values and Units" 526 | ], 527 | "status": "standard", 528 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/rem" 529 | }, 530 | "repeating-conic-gradient()": { 531 | "syntax": "repeating-conic-gradient( [ ] )", 532 | "groups": [ 533 | "CSS Images" 534 | ], 535 | "status": "standard", 536 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/repeating-conic-gradient" 537 | }, 538 | "repeating-linear-gradient()": { 539 | "syntax": "repeating-linear-gradient( [ ] )", 540 | "groups": [ 541 | "CSS Images" 542 | ], 543 | "status": "standard", 544 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/repeating-linear-gradient" 545 | }, 546 | "repeating-radial-gradient()": { 547 | "syntax": "repeating-radial-gradient( [ ] )", 548 | "groups": [ 549 | "CSS Images" 550 | ], 551 | "status": "standard", 552 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/repeating-radial-gradient" 553 | }, 554 | "rgb()": { 555 | "syntax": "rgb( #{3} , ? ) | rgb( #{3} , ? ) | rgb( [ | | none ]{3} [ / [ | none ] ]? )", 556 | "groups": [ 557 | "CSS Color" 558 | ], 559 | "status": "standard", 560 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/rgb" 561 | }, 562 | "rgba()": { 563 | "syntax": "rgba( #{3} , ? ) | rgba( #{3} , ? ) | rgba( [ | | none ]{3} [ / [ | none ] ]? )", 564 | "groups": [ 565 | "CSS Color" 566 | ], 567 | "status": "nonstandard", 568 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/rgb" 569 | }, 570 | "rotate()": { 571 | "syntax": "rotate( [ | ] )", 572 | "groups": [ 573 | "CSS Transforms" 574 | ], 575 | "status": "standard", 576 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotate" 577 | }, 578 | "rotate3d()": { 579 | "syntax": "rotate3d( , , , [ | ] )", 580 | "groups": [ 581 | "CSS Transforms" 582 | ], 583 | "status": "standard", 584 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotate3d" 585 | }, 586 | "rotateX()": { 587 | "syntax": "rotateX( [ | ] )", 588 | "groups": [ 589 | "CSS Transforms" 590 | ], 591 | "status": "standard", 592 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotateX" 593 | }, 594 | "rotateY()": { 595 | "syntax": "rotateY( [ | ] )", 596 | "groups": [ 597 | "CSS Transforms" 598 | ], 599 | "status": "standard", 600 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotateY" 601 | }, 602 | "rotateZ()": { 603 | "syntax": "rotateZ( [ | ] )", 604 | "groups": [ 605 | "CSS Transforms" 606 | ], 607 | "status": "standard", 608 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotateZ" 609 | }, 610 | "round()": { 611 | "syntax": "round( ?, , )", 612 | "groups": [ 613 | "CSS Values and Units" 614 | ], 615 | "status": "standard", 616 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/round" 617 | }, 618 | "saturate()": { 619 | "syntax": "saturate( [ | ]? )", 620 | "groups": [ 621 | "Filter Effects" 622 | ], 623 | "status": "standard", 624 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/saturate" 625 | }, 626 | "scale()": { 627 | "syntax": "scale( [ | ]#{1,2} )", 628 | "groups": [ 629 | "CSS Transforms" 630 | ], 631 | "status": "standard", 632 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scale" 633 | }, 634 | "scale3d()": { 635 | "syntax": "scale3d( [ | ]#{3} )", 636 | "groups": [ 637 | "CSS Transforms" 638 | ], 639 | "status": "standard", 640 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scale3d" 641 | }, 642 | "scaleX()": { 643 | "syntax": "scaleX( [ | ] )", 644 | "groups": [ 645 | "CSS Transforms" 646 | ], 647 | "status": "standard", 648 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scaleX" 649 | }, 650 | "scaleY()": { 651 | "syntax": "scaleY( [ | ] )", 652 | "groups": [ 653 | "CSS Transforms" 654 | ], 655 | "status": "standard", 656 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scaleY" 657 | }, 658 | "scaleZ()": { 659 | "syntax": "scaleZ( [ | ] )", 660 | "groups": [ 661 | "CSS Transforms" 662 | ], 663 | "status": "standard", 664 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scaleZ" 665 | }, 666 | "scroll()": { 667 | "syntax": "scroll( [ || ]? )", 668 | "groups": [ 669 | "Scroll-driven Animations" 670 | ], 671 | "status": "experimental", 672 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-timeline/scroll" 673 | }, 674 | "sepia()": { 675 | "syntax": "sepia( [ | ]? )", 676 | "groups": [ 677 | "Filter Effects" 678 | ], 679 | "status": "standard", 680 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/sepia" 681 | }, 682 | "sign()": { 683 | "syntax": "sign( )", 684 | "groups": [ 685 | "CSS Values and Units" 686 | ], 687 | "status": "standard", 688 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/sign" 689 | }, 690 | "sin()": { 691 | "syntax": "sin( )", 692 | "groups": [ 693 | "CSS Values and Units" 694 | ], 695 | "status": "standard", 696 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/sin" 697 | }, 698 | "skew()": { 699 | "syntax": "skew( [ | ] , [ | ]? )", 700 | "groups": [ 701 | "CSS Transforms" 702 | ], 703 | "status": "standard", 704 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/skew" 705 | }, 706 | "skewX()": { 707 | "syntax": "skewX( [ | ] )", 708 | "groups": [ 709 | "CSS Transforms" 710 | ], 711 | "status": "standard", 712 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/skewX" 713 | }, 714 | "skewY()": { 715 | "syntax": "skewY( [ | ] )", 716 | "groups": [ 717 | "CSS Transforms" 718 | ], 719 | "status": "standard", 720 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/skewY" 721 | }, 722 | "sqrt()": { 723 | "syntax": "sqrt( )", 724 | "groups": [ 725 | "CSS Values and Units" 726 | ], 727 | "status": "standard", 728 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/sqrt" 729 | }, 730 | "steps()": { 731 | "syntax": "steps( , ? )", 732 | "groups": [ 733 | "CSS Easing Functions" 734 | ], 735 | "status": "standard", 736 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function/steps" 737 | }, 738 | "symbols()": { 739 | "syntax": "symbols( ? [ | ]+ )", 740 | "groups": [ 741 | "CSS Counter Styles" 742 | ], 743 | "status": "standard", 744 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/symbols" 745 | }, 746 | "tan()": { 747 | "syntax": "tan( )", 748 | "groups": [ 749 | "CSS Values and Units" 750 | ], 751 | "status": "standard", 752 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/tan" 753 | }, 754 | "target-counter()": { 755 | "syntax": "target-counter( [ | ] , , ? )", 756 | "groups": [ 757 | "CSS Generated Content" 758 | ], 759 | "status": "experimental" 760 | }, 761 | "target-counters()": { 762 | "syntax": "target-counters( [ | ] , , , ? )", 763 | "groups": [ 764 | "CSS Generated Content" 765 | ], 766 | "status": "experimental" 767 | }, 768 | "target-text()": { 769 | "syntax": "target-text( [ | ] , [ content | before | after | first-letter ]? )", 770 | "groups": [ 771 | "CSS Generated Content" 772 | ], 773 | "status": "experimental" 774 | }, 775 | "translate()": { 776 | "syntax": "translate( , ? )", 777 | "groups": [ 778 | "CSS Transforms" 779 | ], 780 | "status": "standard", 781 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translate" 782 | }, 783 | "translate3d()": { 784 | "syntax": "translate3d( , , )", 785 | "groups": [ 786 | "CSS Transforms" 787 | ], 788 | "status": "standard", 789 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translate3d" 790 | }, 791 | "translateX()": { 792 | "syntax": "translateX( )", 793 | "groups": [ 794 | "CSS Transforms" 795 | ], 796 | "status": "standard", 797 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translateX" 798 | }, 799 | "translateY()": { 800 | "syntax": "translateY( )", 801 | "groups": [ 802 | "CSS Transforms" 803 | ], 804 | "status": "standard", 805 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translateY" 806 | }, 807 | "translateZ()": { 808 | "syntax": "translateZ( )", 809 | "groups": [ 810 | "CSS Transforms" 811 | ], 812 | "status": "standard", 813 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translateZ" 814 | }, 815 | "var()": { 816 | "syntax": "var( , ? )", 817 | "groups": [ 818 | "CSS Custom Properties for Cascading Variables" 819 | ], 820 | "status": "standard", 821 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/var" 822 | }, 823 | "view()": { 824 | "syntax": "view([ || <'view-timeline-inset'>]?)", 825 | "groups": [ 826 | "Scroll-driven Animations" 827 | ], 828 | "status": "experimental", 829 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-timeline/view" 830 | }, 831 | "xywh()": { 832 | "syntax": "xywh( {2} {2} [ round <'border-radius'> ]? )", 833 | "groups": [ 834 | "CSS Shapes" 835 | ], 836 | "status": "standard", 837 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/xywh" 838 | } 839 | } 840 | -------------------------------------------------------------------------------- /css/functions.md: -------------------------------------------------------------------------------- 1 | # Functions 2 | 3 | [data](https://github.com/mdn/data/blob/main/css/functions.json) | 4 | [schema](https://github.com/mdn/data/blob/main/css/functions.schema.json) 5 | 6 | [CSS value functions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions) are statements that invoke special data processing or calculations to return a CSS value for a CSS property. CSS value functions represent more complex data types and they may take some input arguments to calculate the return value. 7 | 8 | The value syntax starts with the **name of the function**, followed by a left parenthesis (. Next up are the argument(s), and the function is finished off with a closing parenthesis ). 9 | 10 | Functions can take multiple arguments, which are formatted similarly to CSS property values. Whitespace is allowed, but they are optional inside the parentheses. In some functional notations multiple arguments are separated by commas, while others use spaces. 11 | 12 | ```javascript 13 | selector { 14 | property: function([argument]? [, argument]!); 15 | } 16 | ``` 17 | 18 | For more information about the formal grammar of CSS syntaxes, see [CSS value functions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions). 19 | -------------------------------------------------------------------------------- /css/functions.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "status": { 4 | "enum": [ 5 | "standard", 6 | "nonstandard", 7 | "experimental", 8 | "obsolete" 9 | ] 10 | }, 11 | "mdn_url": { 12 | "type": "string", 13 | "pattern": "^https://developer.mozilla.org/docs/" 14 | } 15 | }, 16 | "type": "object", 17 | "additionalProperties": { 18 | "type": "object", 19 | "additionalProperties": false, 20 | "required": [ 21 | "syntax", 22 | "groups", 23 | "status" 24 | ], 25 | "properties": { 26 | "syntax": { 27 | "type": "string" 28 | }, 29 | "groups": { 30 | "type": "array", 31 | "minitems": 1, 32 | "uniqueItems": true, 33 | "items": { 34 | "$ref": "definitions.json#/groupList" 35 | } 36 | }, 37 | "status": { 38 | "$ref": "#/definitions/status" 39 | }, 40 | "mdn_url": { 41 | "$ref": "#/definitions/mdn_url" 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /css/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | atRules: require('./at-rules'), 3 | functions: require('./functions'), 4 | selectors: require('./selectors'), 5 | types: require('./types'), 6 | properties: require('./properties'), 7 | syntaxes: require('./syntaxes'), 8 | units: require('./units'), 9 | } 10 | -------------------------------------------------------------------------------- /css/properties.md: -------------------------------------------------------------------------------- 1 | # Properties 2 | 3 | [data](https://github.com/mdn/data/blob/main/css/properties.json) | 4 | [schema](https://github.com/mdn/data/blob/main/css/properties.schema.json) 5 | 6 | At its core, CSS consists of [properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference#index). 7 | 8 | ## Structure for long-hand properties 9 | A long-hand property might look like this: 10 | 11 | ```json 12 | "background-color": { 13 | "syntax": "", 14 | "media": "visual", 15 | "inherited": false, 16 | "animationType": "color", 17 | "percentages": "no", 18 | "groups": [ 19 | "CSS Background and Borders" 20 | ], 21 | "initial": "transparent", 22 | "appliesto": "allElements", 23 | "computed": "computedColor", 24 | "order": "uniqueOrder", 25 | "alsoAppliesTo": [ 26 | "::first-letter", 27 | "::first-line", 28 | "::placeholder" 29 | ], 30 | "status": "standard" 31 | }, 32 | ``` 33 | 34 | 35 | ## Structure for short-hand properties 36 | A short-hand property might look like this: 37 | 38 | ```json 39 | "background": { 40 | "syntax": "[ , ]* ", 41 | "media": "visual", 42 | "inherited": false, 43 | "animationType": [ 44 | "background-color", 45 | "background-image", 46 | "background-clip", 47 | "background-position", 48 | "background-size", 49 | "background-repeat", 50 | "background-attachment" 51 | ], 52 | "percentages": [ 53 | "background-position", 54 | "background-size" 55 | ], 56 | "groups": [ 57 | "CSS Background and Borders" 58 | ], 59 | "initial": [ 60 | "background-image", 61 | "background-position", 62 | "background-size", 63 | "background-repeat", 64 | "background-origin", 65 | "background-clip", 66 | "background-attachment", 67 | "background-color" 68 | ], 69 | "appliesto": "allElements", 70 | "computed": [ 71 | "background-image", 72 | "background-position", 73 | "background-size", 74 | "background-repeat", 75 | "background-origin", 76 | "background-clip", 77 | "background-attachment", 78 | "background-color" 79 | ], 80 | "order": "orderOfAppearance", 81 | "alsoAppliesTo": [ 82 | "::first-letter", 83 | "::first-line", 84 | "::placeholder" 85 | ], 86 | "status": "standard" 87 | }, 88 | ``` 89 | 90 | ## Properties of a `Property` object 91 | 92 | There are 11 required properties in this object: 93 | * `syntax` (string): This is the formal syntax of the property and is usually found in the specification. It might contain references to [syntax data](https://github.com/mdn/data/blob/main/css/syntaxes.md). 94 | For more information see also 95 | [Value definition syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax) 96 | on MDN and the [CSS Values and Units](https://www.w3.org/TR/css3-values/#value-defs) specification. 97 | * `media` (string): The media groups this property applies to, e.g. "all, visual" (multiple values are comma-separated). 98 | * `inherited` (boolean): Whether or not the property is inherited. See [inheritance](https://developer.mozilla.org/en-US/docs/Web/CSS/inheritance) for details. 99 | * `animationType` (enum or array of property names): 100 | * If it is an enum (appropriate for long-hand properties), this is the animation type of the property. 101 | * If it is an array (appropriate for short-hand properties), these are the properties the animation type is taken from. 102 | * `percentages` (enum or array of property names): 103 | * If it is an enum (appropriate for long-hand properties), this defines what the percentage actually refers to when a percentage is set as a value on the property ("no" means that the property can't accept a percentage as a value). 104 | * If it is an array (appropriate for short-hand properties), these are the long-hand properties making up part of the short-hand value that percentages can be set as values for. 105 | * `groups` (array of unique strings with at least 1 entry): CSS is organized in modules like "CSS Fonts" or "CSS Animations". MDN organizes features in these groups as well — `groups` should contain the name of the module(s) the property is defined in. 106 | * `initial` (string or array of property names): 107 | * If it is a string (appropriate for long-hand properties), this is the initial value of the property. 108 | * If it is an array (appropriate for short-hand properties), these are the properties the initial value is taken from. 109 | * `appliesto` (enum): To which elements the property can be applied to. See the schema for [a list of enums](https://github.com/mdn/data/blob/main/css/properties.schema.json#L161) 110 | * `computed` (enum or array of property names): 111 | * If it is an enum (appropriate for long-hand properties), this is the computed value of the property. See the schema for [a list of enums](https://github.com/mdn/data/blob/main/css/properties.schema.json#L91). 112 | * If it is an array (appropriate for short-hand properties), these are the properties the value is computed from. 113 | * `order` (enum): The [canonical order](https://developer.mozilla.org/en-US/docs/Glossary/Canonical_order) for the property. See the schema for [a list of enums](https://github.com/mdn/data/blob/main/css/properties.schema.json#L261). 114 | * `status` (enum string): This is either `standard`, `nonstandard`, `experimental` or `obsolete` depending on the standardization status of the feature. 115 | 116 | There are 3 more properties that are optional: 117 | * `mdn_url` (string): a URL linking to the property's page on MDN. This URL must omit the localization part of the URL (such as `en-US/`). 118 | * `stacking` (boolean): Whether or not the property creates a stacking context. See [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context) for details. 119 | * `alsoAppliesTo` (enum): To which elements the property also applies to. See the schema for [a list of enums](https://github.com/mdn/data/blob/main/css/properties.schema.json#L253). 120 | -------------------------------------------------------------------------------- /css/properties.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "propertyList": { 4 | "type": "array", 5 | "minItems": 1, 6 | "uniqueItems": true, 7 | "items": { 8 | "type": "string", 9 | "property-reference": { 10 | "comment": "property-reference is an extension to the JSON schema validator. Here it jumps to the root level of the hierarchy and tests if a value is an existing key there (i.e a defined property). See test/validate-schema.js for implementation details.", 11 | "$data": "/" 12 | } 13 | } 14 | }, 15 | "animationType": { 16 | "enum": [ 17 | "angleBasicShapeOrPath", 18 | "angleOrBasicShapeOrPath", 19 | "asIfPossibleOtherwiseDiscrete", 20 | "basicShapeOtherwiseNo", 21 | "byComputedValue", 22 | "byComputedValueType", 23 | "byComputedValueTypeNormalAnimatesAsObliqueZeroDeg", 24 | "color", 25 | "discrete", 26 | "discreteButVisibleForDurationWhenAnimatedHidden", 27 | "discreteButVisibleForDurationWhenAnimatedNone", 28 | "eachOfShorthandPropertiesExceptUnicodeBiDiAndDirection", 29 | "filterList", 30 | "fontStretch", 31 | "fontWeight", 32 | "integer", 33 | "length", 34 | "lpc", 35 | "notAnimatable", 36 | "numberOrLength", 37 | "number", 38 | "position", 39 | "rectangle", 40 | "repeatableList", 41 | "shadowList", 42 | "simpleListOfLpc", 43 | "simpleListOfLpcDifferenceLpc", 44 | "transform", 45 | "visibility" 46 | ] 47 | }, 48 | "percentages": { 49 | "enum": [ 50 | "blockSizeOfContainingBlock", 51 | "convertedToNumber", 52 | "dependsOnLayoutModel", 53 | "inlineSizeOfContainingBlock", 54 | "lengthsAsPercentages", 55 | "logicalHeightOfContainingBlock", 56 | "logicalWidthOfContainingBlock", 57 | "logicalHeightOrWidthOfContainingBlock", 58 | "mapToRange0To1", 59 | "maxZoomFactor", 60 | "minZoomFactor", 61 | "no", 62 | "referToBorderBox", 63 | "referToContainingBlockHeight", 64 | "referToDimensionOfBorderBox", 65 | "referToDimensionOfContentArea", 66 | "referToElementFontSize", 67 | "referToFlexContainersInnerMainSize", 68 | "referToHeightOfBackgroundPositioningAreaMinusBackgroundImageHeight", 69 | "referToLineBoxWidth", 70 | "referToLineHeight", 71 | "referToParentElementsFontSize", 72 | "referToSizeOfBackgroundPositioningAreaMinusBackgroundImageSize", 73 | "referToSizeOfBorderImage", 74 | "referToSizeOfBoundingBox", 75 | "referToSizeOfContainingBlock", 76 | "referToSizeOfElement", 77 | "referToSizeOfFont", 78 | "referToSizeOfMaskBorderImage", 79 | "referToSizeOfMaskPaintingArea", 80 | "referToSVGViewportHeight", 81 | "referToSVGViewportSize", 82 | "referToSVGViewportWidth", 83 | "referToSVGViewportDiagonal", 84 | "referToTheUsedValueOfLineHeight", 85 | "referToTotalPathLength", 86 | "referToWidthAndHeightOfElement", 87 | "referToWidthOfAffectedGlyph", 88 | "referToWidthOfBackgroundPositioningAreaMinusBackgroundImageWidth", 89 | "referToWidthOfContainingBlock", 90 | "referToWidthOrHeightOfBorderImageArea", 91 | "referToReferenceBoxWhenSpecifiedOtherwiseBorderBox", 92 | "regardingHeightOfGeneratedBoxContainingBlockPercentages0", 93 | "regardingHeightOfGeneratedBoxContainingBlockPercentagesNone", 94 | "regardingHeightOfGeneratedBoxContainingBlockPercentagesRelativeToContainingBlock", 95 | "relativeToBackgroundPositioningArea", 96 | "relativeToCorrespondingDimensionOfRelevantScrollport", 97 | "relativeToMaskBorderImageArea", 98 | "relativeToScrollContainerPaddingBoxAxis", 99 | "relativeToTheScrollContainersScrollport", 100 | "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline", 101 | "relativeToWidthAndHeight" 102 | ] 103 | }, 104 | "computed": { 105 | "enum": [ 106 | "absoluteLength", 107 | "absoluteLength0ForNone", 108 | "absoluteLength0IfColumnRuleStyleNoneOrHidden", 109 | "absoluteLengthOr0IfBorderBottomStyleNoneOrHidden", 110 | "absoluteLengthOr0IfBorderLeftStyleNoneOrHidden", 111 | "absoluteLengthOr0IfBorderRightStyleNoneOrHidden", 112 | "absoluteLengthOr0IfBorderTopStyleNoneOrHidden", 113 | "absoluteLengthOrAsSpecified", 114 | "absoluteLengthOrKeyword", 115 | "absoluteLengthOrNone", 116 | "absoluteLengthOrNormal", 117 | "absoluteLengthOrPercentage", 118 | "absoluteLengthOrPercentageNumbersConverted", 119 | "absoluteLengthsSpecifiedColorAsSpecified", 120 | "absoluteLengthZeroIfBorderStyleNoneOrHidden", 121 | "absoluteLengthZeroOrLarger", 122 | "absoluteURIOrNone", 123 | "angleRoundedToNextQuarter", 124 | "asAutoOrColor", 125 | "asColorOrAbsoluteURL", 126 | "asDefinedForBasicShapeWithAbsoluteURIOtherwiseAsSpecified", 127 | "asLength", 128 | "asLonghands", 129 | "asSpecified", 130 | "asSpecifiedAppliesToEachProperty", 131 | "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent", 132 | "asSpecifiedButWithPercentageConvertedToTheEquivalentNumber", 133 | "asSpecifiedExceptMatchParent", 134 | "asSpecifiedExceptPositionedFloatingAndRootElementsKeywordMaybeDifferent", 135 | "asSpecifiedRelativeToAbsoluteLengths", 136 | "asSpecifiedURLsAbsolute", 137 | "asSpecifiedWithExceptionOfResolution", 138 | "asSpecifiedWithLengthsAbsoluteAndNormalComputingToZeroExceptMultiColumn", 139 | "asSpecifiedWithLengthValuesComputed", 140 | "asSpecifiedWithVarsSubstituted", 141 | "autoOnAbsolutelyPositionedElementsValueOfAlignItemsOnParent", 142 | "autoOrRectangle", 143 | "colorPlusThreeAbsoluteLengths", 144 | "computedColor", 145 | "consistsOfTwoDimensionKeywords", 146 | "consistsOfTwoKeywordsForOriginAndOffsets", 147 | "forLengthAbsoluteValueOtherwisePercentage", 148 | "autoForTranslucentColorRGBAOtherwiseRGB", 149 | "keywordOrNumericalValueBolderLighterTransformedToRealValue", 150 | "keywordPlusIntegerIfDigits", 151 | "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto", 152 | "listEachItemConsistingOfAbsoluteLengthPercentageAndOrigin", 153 | "listEachItemConsistingOfAbsoluteLengthPercentageOrKeyword", 154 | "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage", 155 | "listEachItemConsistingOfPairsOfAutoOrLengthPercentage", 156 | "listEachItemHasTwoKeywordsOnePerDimension", 157 | "listEachItemIdentifierOrNoneAuto", 158 | "listEachItemTwoKeywordsOriginOffsets", 159 | "noneOrImageWithAbsoluteURI", 160 | "noneOrOrderedListOfIdentifiers", 161 | "normalizedAngle", 162 | "normalOnElementsForPseudosNoneAbsoluteURIStringOrAsSpecified", 163 | "oneToFourPercentagesOrAbsoluteLengthsPlusFill", 164 | "optimumValueOfAbsoluteLengthOrNormal", 165 | "percentage", 166 | "percentageAsSpecifiedAbsoluteLengthOrNone", 167 | "percentageAsSpecifiedOrAbsoluteLength", 168 | "percentageAutoOrAbsoluteLength", 169 | "percentageOrAbsoluteLengthPlusKeywords", 170 | "sameAsBoxOffsets", 171 | "sameAsMaxWidthAndMaxHeight", 172 | "sameAsMinWidthAndMinHeight", 173 | "sameAsWidthAndHeight", 174 | "specifiedIntegerOrAbsoluteLength", 175 | "specifiedKeywordOrComputedFunction", 176 | "specifiedValue", 177 | "specifiedValueClipped0To1", 178 | "specifiedValueNumberClipped0To1", 179 | "theComputedLengthAndVisualBox", 180 | "theKeywordListStyleImageNoneOrComputedValue", 181 | "theSpecifiedKeyword", 182 | "theSpecifiedKeywordOrAComputedLengthPercentageValue", 183 | "translucentValuesRGBAOtherwiseRGB", 184 | "twoAbsoluteLengthOrPercentages", 185 | "twoAbsoluteLengths" 186 | ] 187 | }, 188 | "appliesto": { 189 | "enum": [ 190 | "absolutelyPositionedElements", 191 | "allElements", 192 | "allElementsAcceptingWidthOrHeight", 193 | "allElementsAndPseudos", 194 | "allElementsAndText", 195 | "allElementsButNonReplacedAndTableColumns", 196 | "allElementsButNonReplacedAndTableRows", 197 | "allElementsCreatingNativeWindows", 198 | "allElementsExceptGeneratedContentOrPseudoElements", 199 | "allElementsExceptInlineBoxesAndInternalRubyOrTableBoxes", 200 | "allElementsExceptInternalTableDisplayTypes", 201 | "allElementsExceptNonReplacedInlineElementsTableRowsColumnsRowColumnGroups", 202 | "allElementsExceptTableDisplayTypes", 203 | "allElementsExceptTableElementsWhenCollapse", 204 | "allElementsExceptTableRowColumnGroupsTableRowsColumns", 205 | "allElementsExceptTableRowGroupsRowsColumnGroupsAndColumns", 206 | "allElementsNoEffectIfDisplayNone", 207 | "allElementsSomeValuesNoEffectOnNonInlineElements", 208 | "allElementsSVGContainerElements", 209 | "allElementsSVGContainerGraphicsAndGraphicsReferencingElements", 210 | "allElementsThatCanReferenceImages", 211 | "allElementsThatGenerateAPrincipalBox", 212 | "allElementsTreeAbidingPseudoElementsPageMarginBoxes", 213 | "allElementsUAsNotRequiredWhenCollapse", 214 | "anyElementEffectOnProgressAndMeter", 215 | "asLonghands", 216 | "beforeAndAfterPseudos", 217 | "blockContainerElements", 218 | "blockContainers", 219 | "blockContainersAndInlineBoxes", 220 | "blockContainersAndMultiColumnContainers", 221 | "blockContainersExceptMultiColumnContainers", 222 | "blockContainersExceptTableWrappers", 223 | "blockContainersFlexContainersGridContainers", 224 | "blockContainersFlexContainersGridContainersInlineBoxesTableRowsSVGTextContentElements", 225 | "blockContainersMultiColumnContainersFlexContainersGridContainers", 226 | "blockElementsInNormalFlow", 227 | "blockLevelElements", 228 | "blockLevelBoxesAndAbsolutelyPositionedBoxesAndGridItems", 229 | "boxElements", 230 | "childrenOfBoxElements", 231 | "directChildrenOfElementsWithDisplayMozBoxMozInlineBox", 232 | "elementsForWhichLayoutContainmentCanApply", 233 | "elementsForWhichSizeContainmentCanApply", 234 | "elementsThatAcceptInput", 235 | "elementsWithDefaultPreferredSize", 236 | "elementsWithDisplayBoxOrInlineBox", 237 | "elementsWithDisplayMarker", 238 | "elementsWithDisplayMozBoxMozInlineBox", 239 | "elementsWithOverflowNotVisibleAndReplacedElements", 240 | "exclusionElements", 241 | "firstLetterPseudoElementsAndInlineLevelFirstChildren", 242 | "flexContainers", 243 | "flexItemsAndAbsolutelyPositionedFlexContainerChildren", 244 | "flexItemsAndInFlowPseudos", 245 | "flexItemsGridItemsAbsolutelyPositionedContainerChildren", 246 | "flexItemsGridItemsAndAbsolutelyPositionedBoxes", 247 | "floats", 248 | "gridContainers", 249 | "gridContainersWithMasonryLayout", 250 | "gridContainersWithMasonryLayoutInTheirBlockAxis", 251 | "gridContainersWithMasonryLayoutInTheirInlineAxis", 252 | "gridItemsAndBoxesWithinGridContainer", 253 | "iframeElements", 254 | "images", 255 | "inFlowBlockLevelElements", 256 | "inlineBoxesAndBlockContainers", 257 | "inFlowChildrenOfBoxElements", 258 | "inlineLevelAndTableCellElements", 259 | "inlineLevelBoxesAndSVGTextContentElements", 260 | "inlineLevelBoxesFlexItemsGridItemsTableCellsAndSVGTextContentElements", 261 | "limitedSVGElements", 262 | "limitedSVGElementsCircle", 263 | "limitedSVGElementsEllipse", 264 | "limitedSVGElementsEllipseRect", 265 | "limitedSVGElementsFilterPrimitives", 266 | "limitedSVGElementsFloodAndDropShadow", 267 | "limitedSVGElementsGeometry", 268 | "limitedSVGElementsGraphics", 269 | "limitedSVGElementsGraphicsAndUse", 270 | "limitedSVGElementsLightSource", 271 | "limitedSVGElementsPath", 272 | "limitedSVGElementsShapes", 273 | "limitedSVGElementsShapesAndTextContent", 274 | "limitedSVGElementsShapeText", 275 | "limitedSVGElementsStop", 276 | "limitedSVGElementsTextContent", 277 | "listItems", 278 | "maskElements", 279 | "multicolElements", 280 | "multiColumnElementsFlexContainersGridContainers", 281 | "multilineFlexContainers", 282 | "nonReplacedBlockAndInlineBlockElements", 283 | "nonReplacedBlockElements", 284 | "nonReplacedElements", 285 | "nonReplacedInlineElements", 286 | "positionedElements", 287 | "positionedElementsWithADefaultAnchorElement", 288 | "replacedElements", 289 | "rubyAnnotationContainers", 290 | "rubyBasesAnnotationsBaseAnnotationContainers", 291 | "sameAsMargin", 292 | "sameAsWidthAndHeight", 293 | "scrollContainers", 294 | "scrollingBoxes", 295 | "tableCaptionElements", 296 | "tableCellElements", 297 | "tableElements", 298 | "textAndBlockContainers", 299 | "textAndSVGShapes", 300 | "textElements", 301 | "textFields", 302 | "transformableElements", 303 | "xulImageElements" 304 | ] 305 | }, 306 | "alsoApplyTo": { 307 | "type": "array", 308 | "minItems": 1, 309 | "uniqueItems": true, 310 | "items": { 311 | "enum": [ 312 | "::first-letter", 313 | "::first-line", 314 | "::placeholder" 315 | ] 316 | } 317 | }, 318 | "order": { 319 | "enum": [ 320 | "canonicalOrder", 321 | "lengthOrPercentageBeforeKeywordIfBothPresent", 322 | "lengthOrPercentageBeforeKeywords", 323 | "oneOrTwoValuesLengthAbsoluteKeywordsPercentages", 324 | "orderOfAppearance", 325 | "percentagesOrLengthsFollowedByFill", 326 | "perGrammar", 327 | "uniqueOrder" 328 | ] 329 | }, 330 | "status": { 331 | "enum": [ 332 | "standard", 333 | "nonstandard", 334 | "experimental", 335 | "obsolete" 336 | ] 337 | }, 338 | "mdn_url": { 339 | "type": "string", 340 | "pattern": "^https://developer.mozilla.org/docs/" 341 | } 342 | }, 343 | "type": "object", 344 | "additionalProperties": { 345 | "type": "object", 346 | "additionalProperties": false, 347 | "required": [ 348 | "syntax", 349 | "inherited", 350 | "animationType", 351 | "percentages", 352 | "groups", 353 | "initial", 354 | "appliesto", 355 | "computed", 356 | "order", 357 | "status" 358 | ], 359 | "properties": { 360 | "syntax": { 361 | "type": "string" 362 | }, 363 | "media": { 364 | "oneOf": [ 365 | { 366 | "type": "string", 367 | "enum": [ 368 | "all", 369 | "aural", 370 | "continuous", 371 | "interactive", 372 | "none", 373 | "noPracticalMedia", 374 | "paged", 375 | "visual", 376 | "visualInContinuousMediaNoEffectInOverflowColumns" 377 | ] 378 | }, 379 | { 380 | "type": "array", 381 | "minItems": 2, 382 | "uniqueItems": true, 383 | "items": { 384 | "type": "string", 385 | "enum": [ 386 | "interactive", 387 | "paged", 388 | "visual" 389 | ] 390 | } 391 | } 392 | ] 393 | }, 394 | "inherited": { 395 | "type": "boolean" 396 | }, 397 | "animationType": { 398 | "oneOf": [ 399 | { 400 | "$ref": "#/definitions/animationType" 401 | }, 402 | { 403 | "$ref": "#/definitions/propertyList" 404 | } 405 | ] 406 | }, 407 | "percentages": { 408 | "oneOf": [ 409 | { 410 | "$ref": "#/definitions/percentages" 411 | }, 412 | { 413 | "$ref": "#/definitions/propertyList" 414 | } 415 | ] 416 | }, 417 | "groups": { 418 | "type": "array", 419 | "minitems": 1, 420 | "uniqueItems": true, 421 | "items": { 422 | "$ref": "definitions.json#/groupList" 423 | } 424 | }, 425 | "initial": { 426 | "oneOf": [ 427 | { 428 | "type": "string" 429 | }, 430 | { 431 | "$ref": "#/definitions/propertyList" 432 | } 433 | ] 434 | }, 435 | "appliesto": { 436 | "$ref": "#/definitions/appliesto" 437 | }, 438 | "alsoAppliesTo": { 439 | "$ref": "#/definitions/alsoApplyTo" 440 | }, 441 | "computed": { 442 | "oneOf": [ 443 | { 444 | "$ref": "#/definitions/computed" 445 | }, 446 | { 447 | "$ref": "#/definitions/propertyList" 448 | } 449 | ] 450 | }, 451 | "order": { 452 | "$ref": "#/definitions/order" 453 | }, 454 | "stacking": { 455 | "type": "boolean" 456 | }, 457 | "status": { 458 | "$ref": "#/definitions/status" 459 | }, 460 | "mdn_url": { 461 | "$ref": "#/definitions/mdn_url" 462 | } 463 | } 464 | } 465 | } 466 | -------------------------------------------------------------------------------- /css/selectors.json: -------------------------------------------------------------------------------- 1 | { 2 | "Type selectors": { 3 | "syntax": "element", 4 | "groups": [ 5 | "Basic Selectors", 6 | "Selectors" 7 | ], 8 | "status": "standard", 9 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Type_selectors" 10 | }, 11 | "Class selectors": { 12 | "syntax": ".class", 13 | "groups": [ 14 | "Basic Selectors", 15 | "Selectors" 16 | ], 17 | "status": "standard", 18 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Class_selectors" 19 | }, 20 | "ID selectors": { 21 | "syntax": "#id", 22 | "groups": [ 23 | "Basic Selectors", 24 | "Selectors" 25 | ], 26 | "status": "standard", 27 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ID_selectors" 28 | }, 29 | "Universal selectors": { 30 | "syntax": "*", 31 | "groups": [ 32 | "Basic Selectors", 33 | "Selectors" 34 | ], 35 | "status": "standard", 36 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Universal_selectors" 37 | }, 38 | "Attribute selectors": { 39 | "syntax": "[attr=value]", 40 | "groups": [ 41 | "Basic Selectors", 42 | "Selectors" 43 | ], 44 | "status": "standard", 45 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Attribute_selectors" 46 | }, 47 | "Nesting selector": { 48 | "syntax": "A { &B { } }", 49 | "groups": [ 50 | "Basic Selectors", 51 | "Selectors" 52 | ], 53 | "status": "standard", 54 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Nesting_selector" 55 | }, 56 | "Selector list": { 57 | "syntax": ",", 58 | "groups": [ 59 | "Grouping Selectors", 60 | "Selectors" 61 | ], 62 | "status": "standard", 63 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Selector_list" 64 | }, 65 | "Next-sibling combinator": { 66 | "syntax": "A + B", 67 | "groups": [ 68 | "Combinators", 69 | "Selectors" 70 | ], 71 | "status": "standard", 72 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Next-sibling_combinator" 73 | }, 74 | "Subsequent-sibling combinator": { 75 | "syntax": "A ~ B", 76 | "groups": [ 77 | "Combinators", 78 | "Selectors" 79 | ], 80 | "status": "standard", 81 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Subsequent-sibling_combinator" 82 | }, 83 | "Child combinator": { 84 | "syntax": "A > B", 85 | "groups": [ 86 | "Combinators", 87 | "Selectors" 88 | ], 89 | "status": "standard", 90 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Child_combinator" 91 | }, 92 | "Descendant combinator": { 93 | "syntax": "A B", 94 | "groups": [ 95 | "Combinators", 96 | "Selectors" 97 | ], 98 | "status": "standard", 99 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Descendant_combinator" 100 | }, 101 | "Column combinator": { 102 | "syntax": "A || B", 103 | "groups": [ 104 | "Combinators", 105 | "Selectors" 106 | ], 107 | "status": "standard", 108 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Column_combinator" 109 | }, 110 | "Namespace separator": { 111 | "syntax": "A | B", 112 | "groups": [ 113 | "Combinators", 114 | "Selectors" 115 | ], 116 | "status": "standard", 117 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Namespace_separator" 118 | }, 119 | "Pseudo-classes": { 120 | "syntax": ":", 121 | "groups": [ 122 | "Pseudo", 123 | "Selectors" 124 | ], 125 | "status": "standard", 126 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Pseudo-classes" 127 | }, 128 | "Pseudo-elements": { 129 | "syntax": "::", 130 | "groups": [ 131 | "Pseudo", 132 | "Selectors" 133 | ], 134 | "status": "standard", 135 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements" 136 | }, 137 | ":active": { 138 | "syntax": ":active", 139 | "groups": [ 140 | "Pseudo-classes", 141 | "Selectors" 142 | ], 143 | "status": "standard", 144 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:active" 145 | }, 146 | ":active-view-transition": { 147 | "syntax": ":active-view-transition", 148 | "groups": [ 149 | "Pseudo-classes", 150 | "Selectors", 151 | "CSS View Transitions" 152 | ], 153 | "status": "standard" 154 | }, 155 | ":active-view-transition-type()": { 156 | "syntax": ":active-view-transition-type( # )", 157 | "groups": [ 158 | "Pseudo-classes", 159 | "Selectors", 160 | "CSS View Transitions" 161 | ], 162 | "status": "standard" 163 | }, 164 | ":any-link": { 165 | "syntax": ":any-link", 166 | "groups": [ 167 | "Pseudo-classes", 168 | "Selectors" 169 | ], 170 | "status": "standard", 171 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:any-link" 172 | }, 173 | ":autofill": { 174 | "syntax": ":autofill", 175 | "groups": [ 176 | "Pseudo-classes", 177 | "Selectors" 178 | ], 179 | "status": "standard", 180 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:autofill" 181 | }, 182 | ":blank": { 183 | "syntax": ":blank", 184 | "groups": [ 185 | "Pseudo-classes", 186 | "Selectors", 187 | "CSS Paged Media" 188 | ], 189 | "status": "experimental", 190 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:blank" 191 | }, 192 | ":buffering": { 193 | "syntax": ":buffering", 194 | "groups": [ 195 | "Pseudo-classes", 196 | "Selectors" 197 | ], 198 | "status": "standard", 199 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:buffering" 200 | }, 201 | ":checked": { 202 | "syntax": ":checked", 203 | "groups": [ 204 | "Pseudo-classes", 205 | "Selectors" 206 | ], 207 | "status": "standard", 208 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:checked" 209 | }, 210 | ":current": { 211 | "syntax": ":current", 212 | "groups": [ 213 | "Pseudo-classes", 214 | "Selectors" 215 | ], 216 | "status": "experimental", 217 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:current" 218 | }, 219 | ":default": { 220 | "syntax": ":default", 221 | "groups": [ 222 | "Pseudo-classes", 223 | "Selectors" 224 | ], 225 | "status": "standard", 226 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:default" 227 | }, 228 | ":defined": { 229 | "syntax": ":defined", 230 | "groups": [ 231 | "Pseudo-classes", 232 | "Selectors" 233 | ], 234 | "status": "standard", 235 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:defined" 236 | }, 237 | ":dir()": { 238 | "syntax": ":dir( [ ltr | rtl ] )", 239 | "groups": [ 240 | "Pseudo-classes", 241 | "Selectors" 242 | ], 243 | "status": "standard", 244 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:dir" 245 | }, 246 | ":disabled": { 247 | "syntax": ":disabled", 248 | "groups": [ 249 | "Pseudo-classes", 250 | "Selectors" 251 | ], 252 | "status": "standard", 253 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:disabled" 254 | }, 255 | ":empty": { 256 | "syntax": ":empty", 257 | "groups": [ 258 | "Pseudo-classes", 259 | "Selectors" 260 | ], 261 | "status": "standard", 262 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:empty" 263 | }, 264 | ":enabled": { 265 | "syntax": ":enabled", 266 | "groups": [ 267 | "Pseudo-classes", 268 | "Selectors" 269 | ], 270 | "status": "standard", 271 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:enabled" 272 | }, 273 | ":first": { 274 | "syntax": ":first", 275 | "groups": [ 276 | "Pseudo-classes", 277 | "Selectors", 278 | "CSS Paged Media" 279 | ], 280 | "status": "standard", 281 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:first" 282 | }, 283 | ":first-child": { 284 | "syntax": ":first-child", 285 | "groups": [ 286 | "Pseudo-classes", 287 | "Selectors" 288 | ], 289 | "status": "standard", 290 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:first-child" 291 | }, 292 | ":first-of-type": { 293 | "syntax": ":first-of-type", 294 | "groups": [ 295 | "Pseudo-classes", 296 | "Selectors" 297 | ], 298 | "status": "standard", 299 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:first-of-type" 300 | }, 301 | ":focus": { 302 | "syntax": ":focus", 303 | "groups": [ 304 | "Pseudo-classes", 305 | "Selectors" 306 | ], 307 | "status": "standard", 308 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:focus" 309 | }, 310 | ":focus-visible": { 311 | "syntax": ":focus-visible", 312 | "groups": [ 313 | "Pseudo-classes", 314 | "Selectors" 315 | ], 316 | "status": "standard", 317 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:focus-visible" 318 | }, 319 | ":focus-within": { 320 | "syntax": ":focus-within", 321 | "groups": [ 322 | "Pseudo-classes", 323 | "Selectors" 324 | ], 325 | "status": "standard", 326 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:focus-within" 327 | }, 328 | ":fullscreen": { 329 | "syntax": ":fullscreen", 330 | "groups": [ 331 | "Pseudo-classes", 332 | "Selectors" 333 | ], 334 | "status": "standard", 335 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:fullscreen" 336 | }, 337 | ":future": { 338 | "syntax": ":future", 339 | "groups": [ 340 | "Pseudo-classes", 341 | "Selectors" 342 | ], 343 | "status": "standard", 344 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:future" 345 | }, 346 | ":has()": { 347 | "syntax": ":has( )", 348 | "groups": [ 349 | "Pseudo-classes", 350 | "Selectors" 351 | ], 352 | "status": "standard", 353 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:has" 354 | }, 355 | ":has-slotted": { 356 | "syntax": ":has-slotted", 357 | "groups": [ 358 | "Pseudo-classes", 359 | "Selectors" 360 | ], 361 | "status": "standard", 362 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:has-slotted" 363 | }, 364 | ":host": { 365 | "syntax": ":host", 366 | "groups": [ 367 | "Pseudo-classes", 368 | "Selectors" 369 | ], 370 | "status": "standard", 371 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:host" 372 | }, 373 | ":host()": { 374 | "syntax": ":host( )", 375 | "groups": [ 376 | "Pseudo-classes", 377 | "Selectors" 378 | ], 379 | "status": "standard", 380 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:host_function" 381 | }, 382 | ":host-context()": { 383 | "syntax": ":host-context( )", 384 | "groups": [ 385 | "Pseudo-classes", 386 | "Selectors" 387 | ], 388 | "status": "standard", 389 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:host-context" 390 | }, 391 | ":hover": { 392 | "syntax": ":hover", 393 | "groups": [ 394 | "Pseudo-classes", 395 | "Selectors" 396 | ], 397 | "status": "standard", 398 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:hover" 399 | }, 400 | ":in-range": { 401 | "syntax": ":in-range", 402 | "groups": [ 403 | "Pseudo-classes", 404 | "Selectors" 405 | ], 406 | "status": "standard", 407 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:in-range" 408 | }, 409 | ":indeterminate": { 410 | "syntax": ":indeterminate", 411 | "groups": [ 412 | "Pseudo-classes", 413 | "Selectors" 414 | ], 415 | "status": "standard", 416 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:indeterminate" 417 | }, 418 | ":invalid": { 419 | "syntax": ":invalid", 420 | "groups": [ 421 | "Pseudo-classes", 422 | "Selectors" 423 | ], 424 | "status": "standard", 425 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:invalid" 426 | }, 427 | ":is()": { 428 | "syntax": ":is( )", 429 | "groups": [ 430 | "Pseudo-classes", 431 | "Selectors" 432 | ], 433 | "status": "standard", 434 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:is" 435 | }, 436 | ":lang()": { 437 | "syntax": ":lang( )", 438 | "groups": [ 439 | "Pseudo-classes", 440 | "Selectors" 441 | ], 442 | "status": "standard", 443 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:lang" 444 | }, 445 | ":last-child": { 446 | "syntax": ":last-child", 447 | "groups": [ 448 | "Pseudo-classes", 449 | "Selectors" 450 | ], 451 | "status": "standard", 452 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:last-child" 453 | }, 454 | ":last-of-type": { 455 | "syntax": ":last-of-type", 456 | "groups": [ 457 | "Pseudo-classes", 458 | "Selectors" 459 | ], 460 | "status": "standard", 461 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:last-of-type" 462 | }, 463 | ":left": { 464 | "syntax": ":left", 465 | "groups": [ 466 | "Pseudo-classes", 467 | "Selectors", 468 | "CSS Paged Media" 469 | ], 470 | "status": "standard", 471 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:left" 472 | }, 473 | ":link": { 474 | "syntax": ":link", 475 | "groups": [ 476 | "Pseudo-classes", 477 | "Selectors" 478 | ], 479 | "status": "standard", 480 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:link" 481 | }, 482 | ":local-link": { 483 | "syntax": ":local-link", 484 | "groups": [ 485 | "Pseudo-classes", 486 | "Selectors" 487 | ], 488 | "status": "experimental", 489 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:local-link" 490 | }, 491 | ":modal": { 492 | "syntax": ":modal", 493 | "groups": [ 494 | "Pseudo-classes", 495 | "Selectors" 496 | ], 497 | "status": "standard", 498 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:modal" 499 | }, 500 | ":muted": { 501 | "syntax": ":muted", 502 | "groups": [ 503 | "Pseudo-classes", 504 | "Selectors" 505 | ], 506 | "status": "standard", 507 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:muted" 508 | }, 509 | ":not()": { 510 | "syntax": ":not( )", 511 | "groups": [ 512 | "Pseudo-classes", 513 | "Selectors" 514 | ], 515 | "status": "standard", 516 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:not" 517 | }, 518 | ":nth-child()": { 519 | "syntax": ":nth-child( [ of ]? )", 520 | "groups": [ 521 | "Pseudo-classes", 522 | "Selectors" 523 | ], 524 | "status": "standard", 525 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-child" 526 | }, 527 | ":nth-last-child()": { 528 | "syntax": ":nth-last-child( [ of ]? )", 529 | "groups": [ 530 | "Pseudo-classes", 531 | "Selectors" 532 | ], 533 | "status": "standard", 534 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-last-child" 535 | }, 536 | ":nth-last-of-type()": { 537 | "syntax": ":nth-last-of-type( )", 538 | "groups": [ 539 | "Pseudo-classes", 540 | "Selectors" 541 | ], 542 | "status": "standard", 543 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-last-of-type" 544 | }, 545 | ":nth-of-type()": { 546 | "syntax": ":nth-of-type( )", 547 | "groups": [ 548 | "Pseudo-classes", 549 | "Selectors" 550 | ], 551 | "status": "standard", 552 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-of-type" 553 | }, 554 | ":only-child": { 555 | "syntax": ":only-child", 556 | "groups": [ 557 | "Pseudo-classes", 558 | "Selectors" 559 | ], 560 | "status": "standard", 561 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:only-child" 562 | }, 563 | ":only-of-type": { 564 | "syntax": ":only-of-type", 565 | "groups": [ 566 | "Pseudo-classes", 567 | "Selectors" 568 | ], 569 | "status": "standard", 570 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:only-of-type" 571 | }, 572 | ":open": { 573 | "syntax": ":open", 574 | "groups": [ 575 | "Pseudo-classes", 576 | "Selectors" 577 | ], 578 | "status": "standard", 579 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:open" 580 | }, 581 | ":optional": { 582 | "syntax": ":optional", 583 | "groups": [ 584 | "Pseudo-classes", 585 | "Selectors" 586 | ], 587 | "status": "standard", 588 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:optional" 589 | }, 590 | ":out-of-range": { 591 | "syntax": ":out-of-range", 592 | "groups": [ 593 | "Pseudo-classes", 594 | "Selectors" 595 | ], 596 | "status": "standard", 597 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:out-of-range" 598 | }, 599 | ":past": { 600 | "syntax": ":past", 601 | "groups": [ 602 | "Pseudo-classes", 603 | "Selectors" 604 | ], 605 | "status": "standard", 606 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:past" 607 | }, 608 | ":paused": { 609 | "syntax": ":paused", 610 | "groups": [ 611 | "Pseudo-classes", 612 | "Selectors" 613 | ], 614 | "status": "standard", 615 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:paused" 616 | }, 617 | ":picture-in-picture": { 618 | "syntax": ":picture-in-picture", 619 | "groups": [ 620 | "Pseudo-classes", 621 | "Selectors" 622 | ], 623 | "status": "standard", 624 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:picture-in-picture" 625 | }, 626 | ":placeholder-shown": { 627 | "syntax": ":placeholder-shown", 628 | "groups": [ 629 | "Pseudo-classes", 630 | "Selectors" 631 | ], 632 | "status": "standard", 633 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:placeholder-shown" 634 | }, 635 | ":playing": { 636 | "syntax": ":playing", 637 | "groups": [ 638 | "Pseudo-classes", 639 | "Selectors" 640 | ], 641 | "status": "standard", 642 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:playing" 643 | }, 644 | ":popover-open": { 645 | "syntax": ":popover-open", 646 | "groups": [ 647 | "Pseudo-classes", 648 | "Selectors" 649 | ], 650 | "status": "standard", 651 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:popover-open" 652 | }, 653 | ":read-only": { 654 | "syntax": ":read-only", 655 | "groups": [ 656 | "Pseudo-classes", 657 | "Selectors" 658 | ], 659 | "status": "standard", 660 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:read-only" 661 | }, 662 | ":read-write": { 663 | "syntax": ":read-write", 664 | "groups": [ 665 | "Pseudo-classes", 666 | "Selectors" 667 | ], 668 | "status": "standard", 669 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:read-write" 670 | }, 671 | ":required": { 672 | "syntax": ":required", 673 | "groups": [ 674 | "Pseudo-classes", 675 | "Selectors" 676 | ], 677 | "status": "standard", 678 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:required" 679 | }, 680 | ":right": { 681 | "syntax": ":right", 682 | "groups": [ 683 | "Pseudo-classes", 684 | "Selectors", 685 | "CSS Paged Media" 686 | ], 687 | "status": "standard", 688 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:right" 689 | }, 690 | ":root": { 691 | "syntax": ":root", 692 | "groups": [ 693 | "Pseudo-classes", 694 | "Selectors" 695 | ], 696 | "status": "standard", 697 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:root" 698 | }, 699 | ":scope": { 700 | "syntax": ":scope", 701 | "groups": [ 702 | "Pseudo-classes", 703 | "Selectors" 704 | ], 705 | "status": "standard", 706 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:scope" 707 | }, 708 | ":seeking": { 709 | "syntax": ":seeking", 710 | "groups": [ 711 | "Pseudo-classes", 712 | "Selectors" 713 | ], 714 | "status": "standard", 715 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:seeking" 716 | }, 717 | ":stalled": { 718 | "syntax": ":stalled", 719 | "groups": [ 720 | "Pseudo-classes", 721 | "Selectors" 722 | ], 723 | "status": "standard", 724 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:stalled" 725 | }, 726 | ":state()": { 727 | "syntax": ":state( )", 728 | "groups": [ 729 | "Pseudo-classes", 730 | "Selectors" 731 | ], 732 | "status": "standard", 733 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:state" 734 | }, 735 | ":target": { 736 | "syntax": ":target", 737 | "groups": [ 738 | "Pseudo-classes", 739 | "Selectors" 740 | ], 741 | "status": "standard", 742 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:target" 743 | }, 744 | ":target-current": { 745 | "syntax": ":target-current", 746 | "groups": [ 747 | "Pseudo-classes", 748 | "Selectors" 749 | ], 750 | "status": "experimental" 751 | }, 752 | ":target-within": { 753 | "syntax": ":target-within", 754 | "groups": [ 755 | "Pseudo-classes", 756 | "Selectors" 757 | ], 758 | "status": "experimental", 759 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:target-within" 760 | }, 761 | ":user-invalid": { 762 | "syntax": ":user-invalid", 763 | "groups": [ 764 | "Pseudo-classes", 765 | "Selectors" 766 | ], 767 | "status": "standard", 768 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:user-invalid" 769 | }, 770 | ":user-valid": { 771 | "syntax": ":user-valid", 772 | "groups": [ 773 | "Pseudo-classes", 774 | "Selectors" 775 | ], 776 | "status": "standard", 777 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:user-valid" 778 | }, 779 | ":valid": { 780 | "syntax": ":valid", 781 | "groups": [ 782 | "Pseudo-classes", 783 | "Selectors" 784 | ], 785 | "status": "standard", 786 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:valid" 787 | }, 788 | ":visited": { 789 | "syntax": ":visited", 790 | "groups": [ 791 | "Pseudo-classes", 792 | "Selectors" 793 | ], 794 | "status": "standard", 795 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:visited" 796 | }, 797 | ":volume-locked": { 798 | "syntax": ":volume-locked", 799 | "groups": [ 800 | "Pseudo-classes", 801 | "Selectors" 802 | ], 803 | "status": "standard", 804 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:volume-locked" 805 | }, 806 | ":where()": { 807 | "syntax": ":where( )", 808 | "groups": [ 809 | "Pseudo-classes", 810 | "Selectors" 811 | ], 812 | "status": "standard", 813 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:where" 814 | }, 815 | ":xr-overlay": { 816 | "syntax": ":xr-overlay", 817 | "groups": [ 818 | "Pseudo-classes", 819 | "Selectors" 820 | ], 821 | "status": "experimental" 822 | }, 823 | "::-ms-browse": { 824 | "syntax": "::-ms-browse", 825 | "groups": [ 826 | "Pseudo-elements", 827 | "Selectors", 828 | "Microsoft Extensions" 829 | ], 830 | "status": "nonstandard" 831 | }, 832 | "::-ms-check": { 833 | "syntax": "::-ms-check", 834 | "groups": [ 835 | "Pseudo-elements", 836 | "Selectors", 837 | "Microsoft Extensions" 838 | ], 839 | "status": "nonstandard" 840 | }, 841 | "::-ms-clear": { 842 | "syntax": "::-ms-clear", 843 | "groups": [ 844 | "Pseudo-elements", 845 | "Selectors", 846 | "Microsoft Extensions" 847 | ], 848 | "status": "nonstandard" 849 | }, 850 | "::-ms-expand": { 851 | "syntax": "::-ms-expand", 852 | "groups": [ 853 | "Pseudo-elements", 854 | "Selectors", 855 | "Microsoft Extensions" 856 | ], 857 | "status": "nonstandard" 858 | }, 859 | "::-ms-fill": { 860 | "syntax": "::-ms-fill", 861 | "groups": [ 862 | "Pseudo-elements", 863 | "Selectors", 864 | "Microsoft Extensions" 865 | ], 866 | "status": "nonstandard" 867 | }, 868 | "::-ms-fill-lower": { 869 | "syntax": "::-ms-fill-lower", 870 | "groups": [ 871 | "Pseudo-elements", 872 | "Selectors", 873 | "Microsoft Extensions" 874 | ], 875 | "status": "nonstandard" 876 | }, 877 | "::-ms-fill-upper": { 878 | "syntax": "::-ms-fill-upper", 879 | "groups": [ 880 | "Pseudo-elements", 881 | "Selectors", 882 | "Microsoft Extensions" 883 | ], 884 | "status": "nonstandard" 885 | }, 886 | "::-ms-reveal": { 887 | "syntax": "::-ms-reveal", 888 | "groups": [ 889 | "Pseudo-elements", 890 | "Selectors", 891 | "Microsoft Extensions" 892 | ], 893 | "status": "nonstandard" 894 | }, 895 | "::-ms-thumb": { 896 | "syntax": "::-ms-thumb", 897 | "groups": [ 898 | "Pseudo-elements", 899 | "Selectors", 900 | "Microsoft Extensions" 901 | ], 902 | "status": "nonstandard" 903 | }, 904 | "::-ms-ticks-after": { 905 | "syntax": "::-ms-ticks-after", 906 | "groups": [ 907 | "Pseudo-elements", 908 | "Selectors", 909 | "Microsoft Extensions" 910 | ], 911 | "status": "nonstandard" 912 | }, 913 | "::-ms-ticks-before": { 914 | "syntax": "::-ms-ticks-before", 915 | "groups": [ 916 | "Pseudo-elements", 917 | "Selectors", 918 | "Microsoft Extensions" 919 | ], 920 | "status": "nonstandard" 921 | }, 922 | "::-ms-tooltip": { 923 | "syntax": "::-ms-tooltip", 924 | "groups": [ 925 | "Pseudo-elements", 926 | "Selectors", 927 | "Microsoft Extensions" 928 | ], 929 | "status": "nonstandard" 930 | }, 931 | "::-ms-track": { 932 | "syntax": "::-ms-track", 933 | "groups": [ 934 | "Pseudo-elements", 935 | "Selectors", 936 | "Microsoft Extensions" 937 | ], 938 | "status": "nonstandard" 939 | }, 940 | "::-ms-value": { 941 | "syntax": "::-ms-value", 942 | "groups": [ 943 | "Pseudo-elements", 944 | "Selectors", 945 | "Microsoft Extensions" 946 | ], 947 | "status": "nonstandard" 948 | }, 949 | "::-moz-progress-bar": { 950 | "syntax": "::-moz-progress-bar", 951 | "groups": [ 952 | "Pseudo-elements", 953 | "Selectors", 954 | "Mozilla Extensions" 955 | ], 956 | "status": "nonstandard", 957 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-progress-bar" 958 | }, 959 | "::-moz-range-progress": { 960 | "syntax": "::-moz-range-progress", 961 | "groups": [ 962 | "Pseudo-elements", 963 | "Selectors", 964 | "Mozilla Extensions" 965 | ], 966 | "status": "nonstandard", 967 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-range-progress" 968 | }, 969 | "::-moz-range-thumb": { 970 | "syntax": "::-moz-range-thumb", 971 | "groups": [ 972 | "Pseudo-elements", 973 | "Selectors", 974 | "Mozilla Extensions" 975 | ], 976 | "status": "nonstandard", 977 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-range-thumb" 978 | }, 979 | "::-moz-range-track": { 980 | "syntax": "::-moz-range-track", 981 | "groups": [ 982 | "Pseudo-elements", 983 | "Selectors", 984 | "Mozilla Extensions" 985 | ], 986 | "status": "nonstandard", 987 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-range-track" 988 | }, 989 | "::-webkit-progress-bar": { 990 | "syntax": "::-webkit-progress-bar", 991 | "groups": [ 992 | "Pseudo-elements", 993 | "Selectors", 994 | "WebKit Extensions" 995 | ], 996 | "status": "nonstandard", 997 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-progress-bar" 998 | }, 999 | "::-webkit-progress-inner-value": { 1000 | "syntax": "::-webkit-progress-inner-value", 1001 | "groups": [ 1002 | "Pseudo-elements", 1003 | "Selectors", 1004 | "WebKit Extensions" 1005 | ], 1006 | "status": "nonstandard" 1007 | }, 1008 | "::-webkit-progress-value": { 1009 | "syntax": "::-webkit-progress-value", 1010 | "groups": [ 1011 | "Pseudo-elements", 1012 | "Selectors", 1013 | "WebKit Extensions" 1014 | ], 1015 | "status": "nonstandard", 1016 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-progress-value" 1017 | }, 1018 | "::-webkit-slider-runnable-track": { 1019 | "syntax": "::-webkit-slider-runnable-track", 1020 | "groups": [ 1021 | "Pseudo-elements", 1022 | "Selectors", 1023 | "WebKit Extensions" 1024 | ], 1025 | "status": "nonstandard", 1026 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-slider-runnable-track" 1027 | }, 1028 | "::-webkit-slider-thumb": { 1029 | "syntax": "::-webkit-slider-thumb", 1030 | "groups": [ 1031 | "Pseudo-elements", 1032 | "Selectors", 1033 | "WebKit Extensions" 1034 | ], 1035 | "status": "nonstandard", 1036 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-slider-thumb" 1037 | }, 1038 | "::after": { 1039 | "syntax": "::after", 1040 | "groups": [ 1041 | "Pseudo-elements", 1042 | "Selectors" 1043 | ], 1044 | "status": "standard", 1045 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::after" 1046 | }, 1047 | "::backdrop": { 1048 | "syntax": "::backdrop", 1049 | "groups": [ 1050 | "Pseudo-elements", 1051 | "Selectors", 1052 | "CSS Positioned Layout" 1053 | ], 1054 | "status": "standard", 1055 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::backdrop" 1056 | }, 1057 | "::before": { 1058 | "syntax": "::before", 1059 | "groups": [ 1060 | "Pseudo-elements", 1061 | "Selectors" 1062 | ], 1063 | "status": "standard", 1064 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::before" 1065 | }, 1066 | "::checkmark": { 1067 | "syntax": "::checkmark", 1068 | "groups": [ 1069 | "CSS Form Control Styling" 1070 | ], 1071 | "status": "standard", 1072 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::checkmark" 1073 | }, 1074 | "::cue": { 1075 | "syntax": "::cue", 1076 | "groups": [ 1077 | "Pseudo-elements", 1078 | "Selectors" 1079 | ], 1080 | "status": "standard", 1081 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::cue" 1082 | }, 1083 | "::cue()": { 1084 | "syntax": "::cue( )", 1085 | "groups": [ 1086 | "Pseudo-elements", 1087 | "Selectors" 1088 | ], 1089 | "status": "standard", 1090 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::cue" 1091 | }, 1092 | "::cue-region": { 1093 | "syntax": "::cue-region", 1094 | "groups": [ 1095 | "Pseudo-elements", 1096 | "Selectors" 1097 | ], 1098 | "status": "experimental" 1099 | }, 1100 | "::cue-region()": { 1101 | "syntax": "::cue-region( )", 1102 | "groups": [ 1103 | "Pseudo-elements", 1104 | "Selectors" 1105 | ], 1106 | "status": "experimental" 1107 | }, 1108 | "::details-content": { 1109 | "syntax": "::details-content", 1110 | "groups": [ 1111 | "Pseudo-elements", 1112 | "Selectors" 1113 | ], 1114 | "status": "standard", 1115 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::details-content" 1116 | }, 1117 | "::file-selector-button": { 1118 | "syntax": "::file-selector-button", 1119 | "groups": [ 1120 | "Pseudo-elements", 1121 | "Selectors" 1122 | ], 1123 | "status": "standard", 1124 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::file-selector-button" 1125 | }, 1126 | "::first-letter": { 1127 | "syntax": "::first-letter", 1128 | "groups": [ 1129 | "Pseudo-elements", 1130 | "Selectors" 1131 | ], 1132 | "status": "standard", 1133 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::first-letter" 1134 | }, 1135 | "::first-line": { 1136 | "syntax": "::first-line", 1137 | "groups": [ 1138 | "Pseudo-elements", 1139 | "Selectors" 1140 | ], 1141 | "status": "standard", 1142 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::first-line" 1143 | }, 1144 | "::grammar-error": { 1145 | "syntax": "::grammar-error", 1146 | "groups": [ 1147 | "Pseudo-elements", 1148 | "Selectors" 1149 | ], 1150 | "status": "standard", 1151 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::grammar-error" 1152 | }, 1153 | "::highlight()": { 1154 | "syntax": "::highlight( )", 1155 | "groups": [ 1156 | "Pseudo-elements", 1157 | "Selectors" 1158 | ], 1159 | "status": "standard", 1160 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::highlight" 1161 | }, 1162 | "::marker": { 1163 | "syntax": "::marker", 1164 | "groups": [ 1165 | "Pseudo-elements", 1166 | "Selectors", 1167 | "CSS Lists and Counters" 1168 | ], 1169 | "status": "standard", 1170 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::marker" 1171 | }, 1172 | "::part()": { 1173 | "syntax": "::part( + )", 1174 | "groups": [ 1175 | "Pseudo-elements", 1176 | "Selectors", 1177 | "CSS Shadow Parts" 1178 | ], 1179 | "status": "standard", 1180 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::part" 1181 | }, 1182 | "::picker-icon": { 1183 | "syntax": "::picker-icon", 1184 | "groups": [ 1185 | "CSS Form Control Styling" 1186 | ], 1187 | "status": "standard", 1188 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::picker-icon" 1189 | }, 1190 | "::picker()": { 1191 | "syntax": "::picker( + )", 1192 | "groups": [ 1193 | "CSS Form Control Styling" 1194 | ], 1195 | "status": "standard", 1196 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::picker" 1197 | }, 1198 | "::placeholder": { 1199 | "syntax": "::placeholder", 1200 | "groups": [ 1201 | "Pseudo-elements", 1202 | "Selectors" 1203 | ], 1204 | "status": "standard", 1205 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::placeholder" 1206 | }, 1207 | "::scroll-marker": { 1208 | "syntax": "::scroll-marker", 1209 | "groups": [ 1210 | "Pseudo-elements", 1211 | "Selectors" 1212 | ], 1213 | "status": "experimental" 1214 | }, 1215 | "::scroll-marker-group": { 1216 | "syntax": "::scroll-marker-group", 1217 | "groups": [ 1218 | "Pseudo-elements", 1219 | "Selectors" 1220 | ], 1221 | "status": "experimental" 1222 | }, 1223 | "::selection": { 1224 | "syntax": "::selection", 1225 | "groups": [ 1226 | "Pseudo-elements", 1227 | "Selectors" 1228 | ], 1229 | "status": "standard", 1230 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::selection" 1231 | }, 1232 | "::slotted()": { 1233 | "syntax": "::slotted( )", 1234 | "groups": [ 1235 | "Pseudo-elements", 1236 | "Selectors" 1237 | ], 1238 | "status": "standard", 1239 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::slotted" 1240 | }, 1241 | "::spelling-error": { 1242 | "syntax": "::spelling-error", 1243 | "groups": [ 1244 | "Pseudo-elements", 1245 | "Selectors" 1246 | ], 1247 | "status": "standard", 1248 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::spelling-error" 1249 | }, 1250 | "::target-text": { 1251 | "syntax": "::target-text", 1252 | "groups": [ 1253 | "Pseudo-elements", 1254 | "Selectors" 1255 | ], 1256 | "status": "standard", 1257 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::target-text" 1258 | }, 1259 | "::view-transition": { 1260 | "syntax": "::view-transition", 1261 | "groups": [ 1262 | "Pseudo-elements", 1263 | "Selectors", 1264 | "CSS View Transitions" 1265 | ], 1266 | "status": "standard", 1267 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition" 1268 | }, 1269 | "::view-transition-group()": { 1270 | "syntax": "::view-transition-group([ '*' | ])", 1271 | "groups": [ 1272 | "Pseudo-elements", 1273 | "Selectors", 1274 | "CSS View Transitions" 1275 | ], 1276 | "status": "standard", 1277 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-group" 1278 | }, 1279 | "::view-transition-image-pair()": { 1280 | "syntax": "::view-transition-image-pair([ '*' | ])", 1281 | "groups": [ 1282 | "Pseudo-elements", 1283 | "Selectors", 1284 | "CSS View Transitions" 1285 | ], 1286 | "status": "standard", 1287 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-image-pair" 1288 | }, 1289 | "::view-transition-new()": { 1290 | "syntax": "::view-transition-new([ '*' | ])", 1291 | "groups": [ 1292 | "Pseudo-elements", 1293 | "Selectors", 1294 | "CSS View Transitions" 1295 | ], 1296 | "status": "standard", 1297 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-new" 1298 | }, 1299 | "::view-transition-old()": { 1300 | "syntax": "::view-transition-old([ '*' | ])", 1301 | "groups": [ 1302 | "Pseudo-elements", 1303 | "Selectors", 1304 | "CSS View Transitions" 1305 | ], 1306 | "status": "standard", 1307 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-old" 1308 | } 1309 | } 1310 | -------------------------------------------------------------------------------- /css/selectors.md: -------------------------------------------------------------------------------- 1 | # Selectors 2 | 3 | [data](https://github.com/mdn/data/blob/main/css/selectors.json) | 4 | [schema](https://github.com/mdn/data/blob/main/css/selectors.schema.json) 5 | 6 | [CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) define which elements CSS rulesets will be applied to. 7 | 8 | ## Structure for selectors 9 | 10 | A selector object looks like this: 11 | 12 | ```json 13 | "General sibling selectors": { 14 | "syntax": "A ~ B", 15 | "groups": [ 16 | "Combinators" 17 | ], 18 | "status": "standard" 19 | } 20 | ``` 21 | 22 | The three properties shown above are all required: 23 | * `syntax` (string): The syntax of the selector (e.g. `::after` with two colons indicating a [pseudo-element](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Pseudo-classes_and_pseudo-elements#Pseudo-elements), `:hover` with one colon indicating a [pseudo-class](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Pseudo-classes_and_pseudo-elements#Pseudo-classes), or `A ~ B` indicating a [combinator](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Combinators_and_multiple_selectors#Combinators)). 24 | * `groups` (array of strings): CSS is organized in modules like "CSS Values and Units". MDN organizes features in these groups as well — `groups` should contain the name of the module(s) the selector is defined in. 25 | * `status` (enum string): This is either `standard`, `nonstandard`, `experimental` or `obsolete` depending on the standardization status of the feature. 26 | 27 | There is another property that is optional: 28 | * `mdn_url` (string): a URL linking to the selector's page on MDN. This URL must omit the localization part of the URL (such as `en-US/`). 29 | -------------------------------------------------------------------------------- /css/selectors.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": { 4 | "type": "object", 5 | "additionalProperties": false, 6 | "properties": { 7 | "syntax": { 8 | "type": "string" 9 | }, 10 | "groups": { 11 | "type": "array", 12 | "minitems": 1, 13 | "uniqueItems": true, 14 | "items": { 15 | "$ref": "definitions.json#/groupList" 16 | } 17 | }, 18 | "status": { 19 | "enum": [ 20 | "standard", 21 | "nonstandard", 22 | "experimental", 23 | "obsolete" 24 | ] 25 | }, 26 | "mdn_url": { 27 | "type": "string", 28 | "pattern": "^https://developer.mozilla.org/docs/Web/CSS/" 29 | } 30 | }, 31 | "required": [ 32 | "syntax", 33 | "groups", 34 | "status" 35 | ] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /css/syntaxes.md: -------------------------------------------------------------------------------- 1 | # Syntaxes 2 | 3 | [data](https://github.com/mdn/data/blob/main/css/syntaxes.json) | 4 | [schema](https://github.com/mdn/data/blob/main/css/syntaxes.schema.json) 5 | 6 | [CSS value definition syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax) is used for the formal syntax of CSS properties. The syntaxes.json file defines many of these CSS syntaxes. 7 | 8 | For example, the `background-attachment` property has the following syntax where `` is referring to a syntax that is defined in syntaxes.json. 9 | 10 | Definition of `background-attachment` in properties.json: 11 | 12 | ```json 13 | "background-attachment": { 14 | "syntax": "#" 15 | } 16 | ``` 17 | 18 | Definition of `` in syntaxes.json: 19 | 20 | ```json 21 | "attachment": { 22 | "syntax": "scroll | fixed | local" 23 | }, 24 | 25 | ``` 26 | 27 | CSS syntaxes might be more complex than just keywords separated by a pipe (`|`). For example, the syntax might contain values that are referencing 28 | [CSS types](https://github.com/mdn/data/blob/main/css/types.md): 29 | 30 | ```json 31 | "alpha-value": { 32 | "syntax": " | " 33 | }, 34 | ``` 35 | 36 | Or, syntaxes might reference other syntaxes that are also defined in syntaxes.json: 37 | 38 | ```json 39 | "length-percentage": { 40 | "syntax": " | " 41 | }, 42 | ``` 43 | 44 | For more information about the formal grammar of CSS syntaxes, see [CSS value definition syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax). 45 | -------------------------------------------------------------------------------- /css/syntaxes.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": { 4 | "type": "object", 5 | "additionalProperties": false, 6 | "required": [ 7 | "syntax" 8 | ], 9 | "properties": { 10 | "syntax": { 11 | "type": "string" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /css/types.json: -------------------------------------------------------------------------------- 1 | { 2 | "angle": { 3 | "groups": [ 4 | "CSS Types" 5 | ], 6 | "status": "standard", 7 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/angle" 8 | }, 9 | "angle-percentage": { 10 | "groups": [ 11 | "CSS Types" 12 | ], 13 | "status": "standard", 14 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/angle-percentage" 15 | }, 16 | "basic-shape": { 17 | "groups": [ 18 | "CSS Shapes", 19 | "CSS Types" 20 | ], 21 | "status": "standard", 22 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape" 23 | }, 24 | "blend-mode": { 25 | "groups": [ 26 | "Compositing and Blending", 27 | "CSS Types" 28 | ], 29 | "status": "standard", 30 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/blend-mode" 31 | }, 32 | "color": { 33 | "groups": [ 34 | "CSS Color", 35 | "CSS Types" 36 | ], 37 | "status": "standard", 38 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value" 39 | }, 40 | "custom-ident": { 41 | "groups": [ 42 | "CSS Will Change", 43 | "CSS Counter Styles", 44 | "CSS Lists and Counters", 45 | "CSS Types" 46 | ], 47 | "status": "standard", 48 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/custom-ident" 49 | }, 50 | "dashed-ident": { 51 | "groups": [ 52 | "CSS Types" 53 | ], 54 | "status": "standard", 55 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dashed-ident" 56 | }, 57 | "dimension": { 58 | "groups": [ 59 | "CSS Types" 60 | ], 61 | "status": "standard", 62 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dimension" 63 | }, 64 | "display-box": { 65 | "groups": [ 66 | "CSS Display" 67 | ], 68 | "status": "standard", 69 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-box" 70 | }, 71 | "display-inside": { 72 | "groups": [ 73 | "CSS Display" 74 | ], 75 | "status": "standard", 76 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-inside" 77 | }, 78 | "display-internal": { 79 | "groups": [ 80 | "CSS Display" 81 | ], 82 | "status": "standard", 83 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-internal" 84 | }, 85 | "display-legacy": { 86 | "groups": [ 87 | "CSS Display" 88 | ], 89 | "status": "standard", 90 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-legacy" 91 | }, 92 | "display-listitem": { 93 | "groups": [ 94 | "CSS Display" 95 | ], 96 | "status": "standard", 97 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-listitem" 98 | }, 99 | "display-outside": { 100 | "groups": [ 101 | "CSS Display" 102 | ], 103 | "status": "standard", 104 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-outside" 105 | }, 106 | "easing-function": { 107 | "groups": [ 108 | "CSS Easing Functions" 109 | ], 110 | "status": "standard", 111 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function" 112 | }, 113 | "filter-function": { 114 | "groups": [ 115 | "Filter Effects" 116 | ], 117 | "status": "standard", 118 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function" 119 | }, 120 | "flex": { 121 | "groups": [ 122 | "CSS Grid Layout", 123 | "CSS Types" 124 | ], 125 | "status": "standard", 126 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex_value" 127 | }, 128 | "frequency": { 129 | "groups": [ 130 | "CSS Types" 131 | ], 132 | "status": "standard", 133 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/frequency" 134 | }, 135 | "frequency-percentage": { 136 | "groups": [ 137 | "CSS Types" 138 | ], 139 | "status": "standard", 140 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/frequency-percentage" 141 | }, 142 | "gradient": { 143 | "groups": [ 144 | "CSS Images", 145 | "CSS Types" 146 | ], 147 | "status": "standard", 148 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient" 149 | }, 150 | "ident": { 151 | "groups": [ 152 | "CSS Types" 153 | ], 154 | "status": "standard", 155 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ident" 156 | }, 157 | "image": { 158 | "groups": [ 159 | "CSS Images", 160 | "CSS Types" 161 | ], 162 | "status": "standard", 163 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image" 164 | }, 165 | "integer": { 166 | "groups": [ 167 | "CSS Types" 168 | ], 169 | "status": "standard", 170 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/integer" 171 | }, 172 | "length": { 173 | "groups": [ 174 | "CSS Types" 175 | ], 176 | "status": "standard", 177 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/length" 178 | }, 179 | "length-percentage": { 180 | "groups": [ 181 | "CSS Types" 182 | ], 183 | "status": "standard", 184 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/length-percentage" 185 | }, 186 | "line-style": { 187 | "groups": [ 188 | "CSS Types" 189 | ], 190 | "status": "standard", 191 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/line-style" 192 | }, 193 | "number": { 194 | "groups": [ 195 | "CSS Types" 196 | ], 197 | "status": "standard", 198 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/number" 199 | }, 200 | "overflow": { 201 | "groups": [ 202 | "CSS Types" 203 | ], 204 | "status": "standard", 205 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow_value" 206 | }, 207 | "percentage": { 208 | "groups": [ 209 | "CSS Types" 210 | ], 211 | "status": "standard", 212 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/percentage" 213 | }, 214 | "position": { 215 | "groups": [ 216 | "CSS Types" 217 | ], 218 | "status": "standard", 219 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position_value" 220 | }, 221 | "ratio": { 222 | "groups": [ 223 | "CSS Types" 224 | ], 225 | "status": "standard", 226 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ratio" 227 | }, 228 | "resolution": { 229 | "groups": [ 230 | "CSS Types" 231 | ], 232 | "status": "standard", 233 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/resolution" 234 | }, 235 | "shape": { 236 | "groups": [ 237 | "CSS Types" 238 | ], 239 | "status": "obsolete", 240 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/shape" 241 | }, 242 | "string": { 243 | "groups": [ 244 | "CSS Types" 245 | ], 246 | "status": "standard", 247 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/string" 248 | }, 249 | "text-edge": { 250 | "groups": [ 251 | "CSS Types", 252 | "CSS Inline" 253 | ], 254 | "status": "standard", 255 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-edge" 256 | }, 257 | "time": { 258 | "groups": [ 259 | "CSS Types" 260 | ], 261 | "status": "standard", 262 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/time" 263 | }, 264 | "time-percentage": { 265 | "groups": [ 266 | "CSS Types" 267 | ], 268 | "status": "standard", 269 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/time-percentage" 270 | }, 271 | "transform-function": { 272 | "groups": [ 273 | "CSS Transforms", 274 | "CSS Types" 275 | ], 276 | "status": "standard", 277 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function" 278 | }, 279 | "url": { 280 | "groups": [ 281 | "CSS Types" 282 | ], 283 | "status": "standard", 284 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/url_value" 285 | } 286 | } 287 | -------------------------------------------------------------------------------- /css/types.md: -------------------------------------------------------------------------------- 1 | # Types 2 | 3 | [data](https://github.com/mdn/data/blob/main/css/types.json) | 4 | [schema](https://github.com/mdn/data/blob/main/css/types.schema.json) 5 | 6 | [CSS basic data types](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types) define the kinds of values (keywords and units) accepted by CSS properties and functions. 7 | 8 | ## Structure for types 9 | 10 | A type object looks like the following example. 11 | 12 | ```json 13 | "length": { 14 | "groups": [ 15 | "CSS Types" 16 | ], 17 | "status": "standard" 18 | }, 19 | ``` 20 | 21 | The 2 properties are both required. 22 | * `groups` (array of strings): CSS is organized in modules like "CSS Types" or "CSS Color". MDN organizes features in these groups as well — `groups` should contain the name of the module(s) the type is defined in. 23 | * `status` (enum string): This is either `standard`, `nonstandard`, `experimental` or `obsolete` depending on the standardization status of the feature. 24 | 25 | There is another property that is optional: 26 | * `mdn_url` (string): a URL linking to the type's page on MDN. This URL must omit the localization part of the URL (such as `en-US/`). 27 | -------------------------------------------------------------------------------- /css/types.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": { 4 | "type": "object", 5 | "additionalProperties": false, 6 | "properties": { 7 | "groups": { 8 | "type": "array", 9 | "minitems": 1, 10 | "uniqueItems": true, 11 | "items": { 12 | "$ref": "definitions.json#/groupList" 13 | } 14 | }, 15 | "status": { 16 | "enum": [ 17 | "standard", 18 | "nonstandard", 19 | "experimental", 20 | "obsolete" 21 | ] 22 | }, 23 | "mdn_url": { 24 | "type": "string", 25 | "pattern": "^https://developer.mozilla.org/docs/Web/CSS/" 26 | } 27 | }, 28 | "required": [ 29 | "groups", 30 | "status" 31 | ] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /css/units.json: -------------------------------------------------------------------------------- 1 | { 2 | "cap": { 3 | "groups": [ 4 | "CSS Values and Units" 5 | ], 6 | "status": "standard" 7 | }, 8 | "ch": { 9 | "groups": [ 10 | "CSS Values and Units" 11 | ], 12 | "status": "standard" 13 | }, 14 | "cm": { 15 | "groups": [ 16 | "CSS Values and Units" 17 | ], 18 | "status": "standard" 19 | }, 20 | "deg": { 21 | "groups": [ 22 | "CSS Values and Units" 23 | ], 24 | "status": "standard" 25 | }, 26 | "dpcm": { 27 | "groups": [ 28 | "CSS Values and Units" 29 | ], 30 | "status": "standard" 31 | }, 32 | "dpi": { 33 | "groups": [ 34 | "CSS Values and Units" 35 | ], 36 | "status": "standard" 37 | }, 38 | "dppx": { 39 | "groups": [ 40 | "CSS Values and Units" 41 | ], 42 | "status": "standard" 43 | }, 44 | "em": { 45 | "groups": [ 46 | "CSS Values and Units" 47 | ], 48 | "status": "standard" 49 | }, 50 | "ex": { 51 | "groups": [ 52 | "CSS Values and Units" 53 | ], 54 | "status": "standard" 55 | }, 56 | "fr": { 57 | "groups": [ 58 | "CSS Values and Units", 59 | "CSS Flexible Box Layout", 60 | "CSS Grid Layout" 61 | ], 62 | "status": "standard" 63 | }, 64 | "grad": { 65 | "groups": [ 66 | "CSS Values and Units" 67 | ], 68 | "status": "standard" 69 | }, 70 | "Hz": { 71 | "groups": [ 72 | "CSS Values and Units" 73 | ], 74 | "status": "standard" 75 | }, 76 | "ic": { 77 | "groups": [ 78 | "CSS Values and Units" 79 | ], 80 | "status": "standard" 81 | }, 82 | "in": { 83 | "groups": [ 84 | "CSS Values and Units" 85 | ], 86 | "status": "standard" 87 | }, 88 | "kHz": { 89 | "groups": [ 90 | "CSS Values and Units" 91 | ], 92 | "status": "standard" 93 | }, 94 | "mm": { 95 | "groups": [ 96 | "CSS Values and Units" 97 | ], 98 | "status": "standard" 99 | }, 100 | "ms": { 101 | "groups": [ 102 | "CSS Values and Units" 103 | ], 104 | "status": "standard" 105 | }, 106 | "pc": { 107 | "groups": [ 108 | "CSS Values and Units" 109 | ], 110 | "status": "standard" 111 | }, 112 | "pt": { 113 | "groups": [ 114 | "CSS Values and Units" 115 | ], 116 | "status": "standard" 117 | }, 118 | "px": { 119 | "groups": [ 120 | "CSS Values and Units" 121 | ], 122 | "status": "standard" 123 | }, 124 | "Q": { 125 | "groups": [ 126 | "CSS Values and Units" 127 | ], 128 | "status": "standard" 129 | }, 130 | "rad": { 131 | "groups": [ 132 | "CSS Values and Units" 133 | ], 134 | "status": "standard" 135 | }, 136 | "rem": { 137 | "groups": [ 138 | "CSS Values and Units" 139 | ], 140 | "status": "standard" 141 | }, 142 | "s": { 143 | "groups": [ 144 | "CSS Values and Units" 145 | ], 146 | "status": "standard" 147 | }, 148 | "turn": { 149 | "groups": [ 150 | "CSS Values and Units" 151 | ], 152 | "status": "standard" 153 | }, 154 | "vh": { 155 | "groups": [ 156 | "CSS Values and Units" 157 | ], 158 | "status": "standard" 159 | }, 160 | "vmax": { 161 | "groups": [ 162 | "CSS Values and Units" 163 | ], 164 | "status": "standard" 165 | }, 166 | "vmin": { 167 | "groups": [ 168 | "CSS Values and Units" 169 | ], 170 | "status": "standard" 171 | }, 172 | "vw": { 173 | "groups": [ 174 | "CSS Values and Units" 175 | ], 176 | "status": "standard" 177 | }, 178 | "x": { 179 | "groups": [ 180 | "CSS Values and Units" 181 | ], 182 | "status": "standard" 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /css/units.md: -------------------------------------------------------------------------------- 1 | # Units 2 | 3 | [data](https://github.com/mdn/data/blob/main/css/units.json) | 4 | [schema](https://github.com/mdn/data/blob/main/css/units.schema.json) 5 | 6 | Units are CSS units like `em` or `px`. Most of them are defined in the 7 | [CSS Values and Units specification](https://drafts.csswg.org/css-values/). 8 | 9 | ## Structure for units 10 | 11 | A unit object looks like this: 12 | 13 | ```json 14 | "ch": { 15 | "groups": [ 16 | "CSS Values and Units" 17 | ], 18 | "status": "standard" 19 | } 20 | ``` 21 | 22 | The 2 properties are both required. 23 | 24 | * `groups` (array of strings): CSS is organized in modules like "CSS Values and Units". MDN organizes features in these groups as well — `groups` should contain the name of the module(s) the unit is defined in. 25 | * `status` (enum string): This is either `standard`, `nonstandard`, `experimental` or `obsolete` depending on the standardization status of the feature. 26 | -------------------------------------------------------------------------------- /css/units.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "additionalProperties": { 4 | "type": "object", 5 | "additionalProperties": false, 6 | "properties": { 7 | "groups": { 8 | "type": "array", 9 | "minitems": 1, 10 | "uniqueItems": true, 11 | "items": { 12 | "$ref": "definitions.json#/groupList" 13 | } 14 | }, 15 | "status": { 16 | "enum": [ 17 | "standard", 18 | "nonstandard", 19 | "experimental", 20 | "obsolete" 21 | ] 22 | } 23 | }, 24 | "required": [ 25 | "groups", 26 | "status" 27 | ] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs/assets/property_definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdn/data/81fa08fc2595efd3866fe386b9de4bcd5bf62c3d/docs/assets/property_definition.png -------------------------------------------------------------------------------- /docs/assets/property_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mdn/data/81fa08fc2595efd3866fe386b9de4bcd5bf62c3d/docs/assets/property_index.png -------------------------------------------------------------------------------- /docs/publishing.md: -------------------------------------------------------------------------------- 1 | # Publishing a new version of MDN `mdn-data` 2 | 3 | Releases are published on GitHub and to the npm registry as the [mdn-data](https://www.npmjs.com/package/mdn-data) package. 4 | This is then used by MDN to generate sidebars [as well as other features](https://github.com/search?q=repo%3Amdn%2Fyari%20mdn-data&type=code) such as info boxes on pages. 5 | 6 | In order to publish a release: 7 | 8 | 1. Commits need to adhere to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) and only `fix:` and `feat:` commits are considered. 9 | 2. The [publish-release.yml](https://github.com/mdn/data/blob/main/.github/workflows/publish-release.yml) workflow reuses the [mdn/workflows workflow](https://github.com/mdn/workflows/blob/main/.github/workflows/publish-release.yml) by the same name. 10 | 3. The workflow uses [`release-please`](https://github.com/googleapis/release-please), which opens a release pull request if there are relevant commits (following the conventions described in **step 1**) on the `main` branch since the last-published version. 11 | 4. When the pull request from **step 3** is merged, `release-please` creates a GitHub release and a package is published to npm via the [publish-release.yml](https://github.com/mdn/data/blob/main/.github/workflows/publish-release.yml) workflow. 12 | 13 | After these steps have completed, you may check [`mdn-data` on npm](https://www.npmjs.com/package/mdn-data) to see if the release shows up correctly. 🎉 14 | -------------------------------------------------------------------------------- /docs/updating_css_json.md: -------------------------------------------------------------------------------- 1 | # How to update the CSS JSON DB 2 | 3 | Several characteristics of a CSS property, like its syntax or if it can be animated, are mentioned in multiple pages on MDN and are therefore stored in an ad hoc "database". 4 | This database actually consists of several JSON files containing CSS related information, which are [stored on GitHub](https://github.com/mdn/data/tree/main/css). 5 | This document describes how to update this structure. 6 | 7 | ## Prerequisite resources 8 | 9 | To update or check the content of the CSS JSON DB, you will need to gather information from different sources. 10 | 11 | 1. **Latest spec** 12 | Whether it is a W3C Recommendation or an early editor's draft, you should refer to the latest available draft of the spec that covers (or specifies that cover) that feature. 13 | To find it, you can usually do a web search. 14 | The latest version will often be linked to from all versions of the spec, listed under "latest draft" or similar. 15 | 2. **Latest web browsers** 16 | These should be experimental/alpha builds such as [Firefox Nightly](https://www.mozilla.org/en-US/firefox/channel/desktop/)/[Chrome Canary](https://www.google.com/intl/en/chrome/canary/) that are more likely to support the features you are documenting. 17 | This is especially pertinent if you are documenting a nascent/experimental feature. 18 | 3. **Additional info** 19 | Find as much info as you can to better understand how the specific feature works. 20 | E.g. blog posts or demos are good resources. 21 | 4. **Engineering contacts** 22 | It is really useful to find yourself a friendly engineering contact to ask questions about the spec, someone who is involved in the standardization of the API, or its implementation in a browser. 23 | If you have the implementation bug on Bugzilla, the engineer who implemented the feature is a good contact: asking him in the bug, with a needinfo flag is a good way of having an answer about a specific question. 24 | Other good places to find knowledgeable people are: 25 | 26 | - Your internal company address book, if you work for a relevant company. 27 | - A public mailing list that is involved in the discussion of that API, such as Mozilla's [dev-platform](https://groups.google.com/a/mozilla.org/g/dev-platform/) list, or the W3C list [www-style](https://lists.w3.org/Archives/Public/www-style/). 28 | - The spec itself. For example, the [CSS Animations spec](https://drafts.csswg.org/css-animations/) lists the authors and their contact details at the top. 29 | 30 | ## Update the CSS information database 31 | 32 | The information stored for a CSS property is: 33 | 34 | - Name 35 | - Syntax 36 | - Initial value 37 | - To which elements it applies 38 | - Whether it is inherited 39 | - How percentage values are calculated 40 | - Media it belongs to 41 | - Computed value 42 | - Animation type 43 | - Canonical order of values 44 | - Whether it is a shorthand for other properties 45 | - MDN groups it belongs to 46 | 47 | A fundamental element is that we document what is in the _specification_. 48 | That means the reference page is based on the latest iteration of that specification and later on there are compatibility notes stressing the differences between different specification versions and their different implementations by rendering engines. 49 | 50 | ### Get information from the specifications 51 | 52 | Once you have found the relevant specification, the first thing to do is to look for a property definition in the specification. 53 | Look for the summary table (near the bottom), it has most of the values that you are looking for: 54 | 55 | ![The summary table lists useful attributes of the CSS properties defined in the give spec.](./assets/property_index.png) 56 | 57 | In some specifications, especially in older drafts, there isn't such a property index table. 58 | In this case you need to look for the property box of the property itself which looks like this: 59 | 60 | ![This box lists the most useful attributes of a CSS property.](./assets/property_definition.png) 61 | 62 | Note that in some cases the property index table might be more briefly and with less details than the property box. 63 | 64 | ### Store the information in the JSONs 65 | 66 | The information from the specifications is stored in a specific way in the JSON DB. CSS properties are stored within [properties.json](../css/properties.json). 67 | All the JSON keys below are obligatory. 68 | 69 | Translated information is stored as key string mapping to a translation in [l10n/css.json](../l10n/css.json) with language + country codes (according to [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) as keys. 70 | 71 | You can use the macros [`{{cssxref}}`](https://github.com/mdn/yari/blob/main/kumascript/macros/cssxref.ejs) and [`{{SVGElement}}`](https://github.com/mdn/yari/blob/main/kumascript/macros/SVGElement.ejs) within translations to refer to other parts of MDN. 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 120 | 128 | 147 | 148 | 149 | 150 | 151 | 155 | 174 | 175 | 176 | 177 | 178 | 179 | 185 | 186 | 187 | 188 | 189 | 193 | 196 | 197 | 198 | 199 | 200 | 204 | 227 | 228 | 229 | 230 | 231 | 235 | 255 | 256 | 257 | 258 | 259 | 260 | 277 | 278 | 279 |
Spec. nameJSON key nameCommentExamples
ValuesyntaxAs specified within the specification 86 |
"syntax": "visible | hidden"
87 |
MediamediaEither a predefined localization key, a block of localizations 94 |
95 | properties.json 96 |
"media": "visual"
97 |
98 |
99 | l10n/css.json 100 |
101 | "visual": {
102 |   "en-US": "visual",
103 |   "de": "visuell",
104 |   "fr": "visuel",
105 |   "ru": "визуальный"
106 | }
107 |
InheritedinheritedBoolean value 114 |
"inherited": true
115 |
Animation typeanimatable 121 | Either a predefined localization key, a block of localizations, in case 122 | of a shorthand an array of longhands, or a block with the property 123 | "as" and an optional "note" property.
The 124 | "as" property holds a space-separated list of translation 125 | keys for values related to 126 | interpolation. 127 |
129 |
130 | properties.json 131 |
"animationType": "discrete"
132 |
133 | "animationType": [
134 |   "border-color",
135 |   "border-style",
136 |   "border-width"
137 | ]
138 |
139 | l10n/css.json 140 |
141 | "discrete": {
142 |   "en-US": "discrete",
143 |   "de": "diskret",
144 |   "fr": "discrète"
145 | }
146 |
Percentagespercentages 152 | Either a predefined localization key, a block of localizations, or in 153 | case of a shorthand an array of longhands 154 | 156 |
157 | properties.json 158 |
"percentages": "logicalWidthOfContainingBlock"
159 |
160 | "percentages": [
161 |   "background-position",
162 |   "background-size"
163 | ]
164 |
165 | l10n/css.json 166 |
167 | "logicalWidthOfContainingBlock": {
168 |   "en-US": "logical-width of containing block",
169 |   "de": "logische Breite des beinhaltenden Blocks",
170 |   "fr": "largeur logique du bloc englobant",
171 |   "ru": "логическая высота содержащего блока"
172 | }
173 |
-groupsArray of tags to group the information on MDN. 180 |
181 | "groups": [
182 |   "CSS Flexible Box Layout"
183 | ]
184 |
Initialinitial 190 | If the value is CSS code, it must be enclosed in a 191 | <code> tag. 192 | 194 |
"initial": "<code>none<\/code>"
195 |
Applies toappliesto 201 | Either a predefined localization key, a block of localizations, or in 202 | case of a shorthand an array of longhands 203 | 205 |
206 | properties.json 207 |
"appliesto": "absolutelyPositionedElements"
208 |
209 | "appliesto": [
210 |   "border-image-outset",
211 |   "border-image-repeat",
212 |   "border-image-slice",
213 |   "border-image-source",
214 |   "border-image-width"
215 | ]
216 |
217 | l10n/css.json 218 |
219 | "absolutelyPositionedElements": {
220 |   "en-US": "absolutely positioned elements",
221 |   "de": "absolut positionierte Elemente",
222 |   "fr": "éléments positionnés de manière absolue",
223 |   "ja": "絶対位置指定された要素",
224 |   "ru": "абсолютно позиционированные элементы"
225 | }
226 |
Computed valuecomputed 232 | Either a predefined localization key, a block of localizations, or in 233 | case of a shorthand an array of longhands 234 | 236 |
237 | properties.json 238 |
"computed": "normalizedAngle"
239 |
240 | "computed": [
241 |     "border-width",
242 |     "border-style",
243 |     "color"
244 | ]
245 |
246 | l10n.css.json 247 |
248 | "normalizedAngle": {
249 |   "en-US": "normalized angle",
250 |   "de": "normalisierter Winkel",
251 |   "fr": "angle normalisé",
252 |   "ru": "нормализованный угол"
253 | }
254 |
Canonical orderorderEither a predefined localization key or a block of localizations 261 |
262 | properties.json 263 |
"order": "uniqueOrder"
264 |
265 |
266 | l10n/css.json 267 |
268 | "uniqueOrder": {
269 |   "en-US": "the unique non-ambiguous order defined by the formal grammar",
270 |   "de": "die eindeutige Reihenfolge definiert durch die formale Grammatik",
271 |   "fr": "l'ordre unique et non-ambigu défini par la grammaire formelle",
272 |   "ja": "形式文法で定義される一意のあいまいでない順序",
273 |   "es": "el orden único no-ambigüo definido por la gramática formal",
274 |   "ru": "уникальный неоднозначный порядок, определённый формальной грамматикой"
275 | }
276 |
280 | 281 | It may happen that the syntax contains references to specific values. 282 | Such values normally define their own syntaxes. Those syntaxes should be stored [syntaxes.json](../css/syntaxes.json) with their name as key. 283 | E.g. the `font-family` property has a syntax of `[ | ]#`. 284 | The syntaxes for the values `` and `` are stored like this: 285 | 286 | ```json 287 | { 288 | "syntaxes": { 289 | "family-name": " | +", 290 | "generic-family": "serif | sans-serif | cursive | fantasy | monospace" 291 | } 292 | } 293 | ``` 294 | 295 | ## Example for a CSS longhand property 296 | 297 | ```json 298 | { 299 | "backface-visibility": { 300 | "syntax": "visible | hidden", 301 | "media": "visual", 302 | "inherited": false, 303 | "animatable": "no", 304 | "percentages": "no", 305 | "groups": ["CSS Transforms"], 306 | "initial": "visible", 307 | "appliesto": "transformableElements", 308 | "computed": "asSpecified", 309 | "order": "uniqueOrder" 310 | } 311 | } 312 | ``` 313 | 314 | ## Example for a CSS shorthand property 315 | 316 | For shorthand properties, several entries are a list of the longhand properties associated with it. 317 | 318 | ```json 319 | { 320 | "border": { 321 | "syntax": " || || ", 322 | "media": "visual", 323 | "inherited": false, 324 | "animationType": [ 325 | "border-color", 326 | "border-style", 327 | "border-width" 328 | ], 329 | "percentages": "no", 330 | "groups": [ 331 | "CSS Backgrounds and Borders" 332 | ], 333 | "initial": [ 334 | "border-width", 335 | "border-style", 336 | "border-color" 337 | ], 338 | "appliesto": "allElements", 339 | "computed": [ 340 | "border-width", 341 | "border-style", 342 | "border-color" 343 | ], 344 | "order": "orderOfAppearance", 345 | "alsoAppliesTo": [ 346 | "::first-letter" 347 | ], 348 | "status": "standard", 349 | "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border" 350 | }, 351 | } 352 | ``` 353 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | api: require('./api'), 3 | css: require('./css'), 4 | l10n: require('./l10n'), 5 | } 6 | -------------------------------------------------------------------------------- /l10n/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | css: require('./css'), 3 | } 4 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mdn-data", 3 | "version": "2.21.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "mdn-data", 9 | "version": "2.21.0", 10 | "license": "CC0-1.0", 11 | "devDependencies": { 12 | "ajv": "^6.12.6", 13 | "better-ajv-errors": "^1.1.2" 14 | } 15 | }, 16 | "node_modules/@babel/code-frame": { 17 | "version": "7.16.7", 18 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", 19 | "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", 20 | "dev": true, 21 | "dependencies": { 22 | "@babel/highlight": "^7.16.7" 23 | }, 24 | "engines": { 25 | "node": ">=6.9.0" 26 | } 27 | }, 28 | "node_modules/@babel/helper-validator-identifier": { 29 | "version": "7.16.7", 30 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", 31 | "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", 32 | "dev": true, 33 | "engines": { 34 | "node": ">=6.9.0" 35 | } 36 | }, 37 | "node_modules/@babel/highlight": { 38 | "version": "7.17.9", 39 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", 40 | "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", 41 | "dev": true, 42 | "dependencies": { 43 | "@babel/helper-validator-identifier": "^7.16.7", 44 | "chalk": "^2.0.0", 45 | "js-tokens": "^4.0.0" 46 | }, 47 | "engines": { 48 | "node": ">=6.9.0" 49 | } 50 | }, 51 | "node_modules/@babel/highlight/node_modules/chalk": { 52 | "version": "2.4.2", 53 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 54 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 55 | "dev": true, 56 | "dependencies": { 57 | "ansi-styles": "^3.2.1", 58 | "escape-string-regexp": "^1.0.5", 59 | "supports-color": "^5.3.0" 60 | }, 61 | "engines": { 62 | "node": ">=4" 63 | } 64 | }, 65 | "node_modules/@humanwhocodes/momoa": { 66 | "version": "2.0.3", 67 | "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.3.tgz", 68 | "integrity": "sha512-SytjS6gJk+LXSWFuEm0V9ASdgxlX/BDq6A+6gfh7TaHM90xppBydjcM3SFaziZP4ikKmhUOhPkDi2KktzElnQQ==", 69 | "dev": true, 70 | "engines": { 71 | "node": ">=10.10.0" 72 | } 73 | }, 74 | "node_modules/ajv": { 75 | "version": "6.12.6", 76 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 77 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 78 | "dev": true, 79 | "dependencies": { 80 | "fast-deep-equal": "^3.1.1", 81 | "fast-json-stable-stringify": "^2.0.0", 82 | "json-schema-traverse": "^0.4.1", 83 | "uri-js": "^4.2.2" 84 | }, 85 | "funding": { 86 | "type": "github", 87 | "url": "https://github.com/sponsors/epoberezkin" 88 | } 89 | }, 90 | "node_modules/ansi-styles": { 91 | "version": "3.2.1", 92 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 93 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 94 | "dev": true, 95 | "dependencies": { 96 | "color-convert": "^1.9.0" 97 | }, 98 | "engines": { 99 | "node": ">=4" 100 | } 101 | }, 102 | "node_modules/better-ajv-errors": { 103 | "version": "1.2.0", 104 | "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-1.2.0.tgz", 105 | "integrity": "sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==", 106 | "dev": true, 107 | "dependencies": { 108 | "@babel/code-frame": "^7.16.0", 109 | "@humanwhocodes/momoa": "^2.0.2", 110 | "chalk": "^4.1.2", 111 | "jsonpointer": "^5.0.0", 112 | "leven": "^3.1.0 < 4" 113 | }, 114 | "engines": { 115 | "node": ">= 12.13.0" 116 | }, 117 | "peerDependencies": { 118 | "ajv": "4.11.8 - 8" 119 | } 120 | }, 121 | "node_modules/chalk": { 122 | "version": "4.1.2", 123 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 124 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 125 | "dev": true, 126 | "dependencies": { 127 | "ansi-styles": "^4.1.0", 128 | "supports-color": "^7.1.0" 129 | }, 130 | "engines": { 131 | "node": ">=10" 132 | }, 133 | "funding": { 134 | "url": "https://github.com/chalk/chalk?sponsor=1" 135 | } 136 | }, 137 | "node_modules/chalk/node_modules/ansi-styles": { 138 | "version": "4.3.0", 139 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 140 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 141 | "dev": true, 142 | "dependencies": { 143 | "color-convert": "^2.0.1" 144 | }, 145 | "engines": { 146 | "node": ">=8" 147 | }, 148 | "funding": { 149 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 150 | } 151 | }, 152 | "node_modules/chalk/node_modules/color-convert": { 153 | "version": "2.0.1", 154 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 155 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 156 | "dev": true, 157 | "dependencies": { 158 | "color-name": "~1.1.4" 159 | }, 160 | "engines": { 161 | "node": ">=7.0.0" 162 | } 163 | }, 164 | "node_modules/chalk/node_modules/color-name": { 165 | "version": "1.1.4", 166 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 167 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 168 | "dev": true 169 | }, 170 | "node_modules/chalk/node_modules/has-flag": { 171 | "version": "4.0.0", 172 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 173 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 174 | "dev": true, 175 | "engines": { 176 | "node": ">=8" 177 | } 178 | }, 179 | "node_modules/chalk/node_modules/supports-color": { 180 | "version": "7.2.0", 181 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 182 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 183 | "dev": true, 184 | "dependencies": { 185 | "has-flag": "^4.0.0" 186 | }, 187 | "engines": { 188 | "node": ">=8" 189 | } 190 | }, 191 | "node_modules/color-convert": { 192 | "version": "1.9.3", 193 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 194 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 195 | "dev": true, 196 | "dependencies": { 197 | "color-name": "1.1.3" 198 | } 199 | }, 200 | "node_modules/color-name": { 201 | "version": "1.1.3", 202 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 203 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 204 | "dev": true 205 | }, 206 | "node_modules/escape-string-regexp": { 207 | "version": "1.0.5", 208 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 209 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 210 | "dev": true, 211 | "engines": { 212 | "node": ">=0.8.0" 213 | } 214 | }, 215 | "node_modules/fast-deep-equal": { 216 | "version": "3.1.3", 217 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 218 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 219 | "dev": true 220 | }, 221 | "node_modules/fast-json-stable-stringify": { 222 | "version": "2.1.0", 223 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 224 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 225 | "dev": true 226 | }, 227 | "node_modules/has-flag": { 228 | "version": "3.0.0", 229 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 230 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 231 | "dev": true, 232 | "engines": { 233 | "node": ">=4" 234 | } 235 | }, 236 | "node_modules/js-tokens": { 237 | "version": "4.0.0", 238 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 239 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 240 | "dev": true 241 | }, 242 | "node_modules/json-schema-traverse": { 243 | "version": "0.4.1", 244 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 245 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 246 | "dev": true 247 | }, 248 | "node_modules/jsonpointer": { 249 | "version": "5.0.0", 250 | "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.0.tgz", 251 | "integrity": "sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==", 252 | "dev": true, 253 | "engines": { 254 | "node": ">=0.10.0" 255 | } 256 | }, 257 | "node_modules/leven": { 258 | "version": "3.1.0", 259 | "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", 260 | "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", 261 | "dev": true, 262 | "engines": { 263 | "node": ">=6" 264 | } 265 | }, 266 | "node_modules/punycode": { 267 | "version": "2.1.1", 268 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 269 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", 270 | "dev": true, 271 | "engines": { 272 | "node": ">=6" 273 | } 274 | }, 275 | "node_modules/supports-color": { 276 | "version": "5.5.0", 277 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 278 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 279 | "dev": true, 280 | "dependencies": { 281 | "has-flag": "^3.0.0" 282 | }, 283 | "engines": { 284 | "node": ">=4" 285 | } 286 | }, 287 | "node_modules/uri-js": { 288 | "version": "4.4.1", 289 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", 290 | "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 291 | "dev": true, 292 | "dependencies": { 293 | "punycode": "^2.1.0" 294 | } 295 | } 296 | } 297 | } 298 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mdn-data", 3 | "version": "2.21.0", 4 | "description": "Open Web data by the Mozilla Developer Network", 5 | "main": "index.js", 6 | "files": [ 7 | "api/index.js", 8 | "api/*.json", 9 | "css/index.js", 10 | "css/*.json", 11 | "l10n/index.js", 12 | "l10n/*.json" 13 | ], 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/mdn/data.git" 17 | }, 18 | "keywords": [ 19 | "data", 20 | "mdn", 21 | "mozilla", 22 | "css" 23 | ], 24 | "author": "Mozilla Developer Network", 25 | "license": "CC0-1.0", 26 | "bugs": { 27 | "url": "https://github.com/mdn/data/issues" 28 | }, 29 | "homepage": "https://developer.mozilla.org", 30 | "devDependencies": { 31 | "ajv": "^6.12.6", 32 | "better-ajv-errors": "^1.1.2" 33 | }, 34 | "scripts": { 35 | "lint": "node test/lint", 36 | "test": "npm run lint" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /release-please-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", 3 | "last-release-sha": "0a7a19329406b0e8f555083f7dcdd6e84a3d4707", 4 | "release-type": "node", 5 | "changelog-sections": [ 6 | { "type": "feat", "section": "Features", "hidden": false }, 7 | { "type": "fix", "section": "Bug Fixes", "hidden": false }, 8 | { "type": "enhance", "section": "Enhancements", "hidden": false }, 9 | { "type": "chore", "section": "Miscellaneous", "hidden": false } 10 | ], 11 | "include-component-in-tag": false, 12 | "packages": { 13 | ".": {} 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/lint.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var Ajv = require('ajv'); 4 | var betterAjvErrors = require('better-ajv-errors').default; 5 | var dictPaths = ['api', 'css', 'l10n']; 6 | var hasErrors = false; 7 | var ajv = new Ajv({ 8 | $data: true, 9 | allErrors: true, 10 | jsonPointers: true 11 | }); 12 | 13 | ajv.addKeyword('property-reference', { 14 | $data: true, 15 | metaSchema: { type: 'object' }, 16 | validate: function(schema, data, parentSchema) { 17 | var valid = schema.hasOwnProperty(data); 18 | if (!valid) { 19 | // TODO: make a verbose message when invalid 20 | // throw new Error('wrong reference') 21 | } 22 | return valid; 23 | } 24 | }); 25 | 26 | ajv.addSchema(require('../css/definitions.json'), 'definitions.json'); 27 | 28 | function jsonDiff(actual, expected) { 29 | var actualLines = actual.split(/\n/); 30 | var expectedLines = expected.split(/\n/); 31 | 32 | for (var i = 0; i < actualLines.length; i++) { 33 | if (actualLines[i] !== expectedLines[i]) { 34 | return [ 35 | '#' + i, 36 | ' Actual: ' + actualLines[i], 37 | ' Expected: ' + expectedLines[i] 38 | ].join('\n'); 39 | } 40 | } 41 | } 42 | 43 | function checkStyle(filename) { 44 | var actual = fs.readFileSync(filename, 'utf-8').trim(); 45 | var expected = JSON.stringify(JSON.parse(actual), null, 2); 46 | 47 | if (actual === expected) { 48 | console.log(' Style – OK'); 49 | } else { 50 | hasErrors = true; 51 | console.log(' Style – Error on line ' + jsonDiff(actual, expected)); 52 | } 53 | } 54 | 55 | function checkSchema(dataFilename) { 56 | var schemaFilename = dataFilename.replace(/\.json/i, '.schema.json'); 57 | 58 | if (fs.existsSync(schemaFilename)) { 59 | var schema = require(schemaFilename); 60 | var data = require(dataFilename); 61 | var valid = ajv.validate(schema, data); 62 | 63 | if (valid) { 64 | console.log(' JSON Schema – OK'); 65 | } else { 66 | hasErrors = true; 67 | console.log(' JSON Schema – ' + ajv.errors.length + ' error(s)') 68 | // console.log(betterAjvErrors(schema, data, ajv.errors, { indent: 2 })); 69 | 70 | // Output messages by one since better-ajv-errors wrongly joins messages 71 | // (see https://github.com/atlassian/better-ajv-errors/pull/21) 72 | // Other issues with better-ajv-errors: 73 | // - it feels better for performance to output messages one by one rather than a list 74 | // - it seems to be losing some errors when output a list 75 | ajv.errors.forEach(function(error) { 76 | var message = betterAjvErrors(schema, data, [error], { indent: 2 }); 77 | 78 | console.log('\n ' + message.replace(/\n/g, '\n ')); 79 | }); 80 | } 81 | } 82 | } 83 | 84 | dictPaths.forEach(function(dir) { 85 | var absDir = path.resolve(path.join(__dirname, '..', dir)); 86 | 87 | fs.readdirSync(absDir).forEach(function(filename) { 88 | if (path.extname(filename) === '.json') { 89 | var absFilename = path.join(absDir, filename); 90 | 91 | console.log(dir + '/' + filename); 92 | 93 | checkStyle(absFilename) 94 | checkSchema(absFilename); 95 | 96 | console.log(); 97 | } 98 | }); 99 | }); 100 | 101 | if (hasErrors) { 102 | process.exit(1); 103 | } 104 | --------------------------------------------------------------------------------