Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Extracts CSS definition syntax and converts it into JSON

License

Notifications You must be signed in to change notification settings

gosub-io/css-definition-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Definition Generator

These scripts will generate a definition and typedef file from all the CSS properties currently available. It does so by scraping the MDN website for the CSS properties and their descriptions.

Note that this is not a perfect solution, as the MDN website is not always up to date with the latest CSS properties. However, it is a good starting point. The properties we are scraping are available from:

https://www.w3.org/Style/CSS/all-properties.en.json

Usage

To generate the definition and typedef files, simply run the following command:

$ php definitions.php

This will create the definitions.json file AND the ./cache directories. The cache dir is nice if you want to run the same script multiple times, as it will not have to re-scrape the MDN website.

Once you have the definition.json file generated. You can run the following command to generate the typedef file:

$ php typedefs.php > typedefs.raw.txt
$ php cleanup.php typedefs.raw.txt > typedefs.json 

This will generate the typedefs.json file, which you can then use in your project.

If you like, you can use missing.php to check if there are any missing properties in the definitions.json file.

About

Extracts CSS definition syntax and converts it into JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages