Nikolay Vitkov | 924fc2c | 2025-01-03 09:24:38 | [diff] [blame] | 1 | # css-functions-list |
| 2 | |
| 3 | [![Build Status][ci-img]][ci] |
| 4 | |
| 5 | List of standard and |
| 6 | [browser specific](<(https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix)>) |
| 7 | CSS functions. |
| 8 | |
| 9 | Data sources are: |
| 10 | |
| 11 | - MDN reference on |
| 12 | [CSS functions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions) |
| 13 | - MDN reference on |
| 14 | [general CSS features](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference). |
| 15 | - MDN |
| 16 | [browser compatibility data for CSS functions](https://github.com/mdn/browser-compat-data/tree/main/css/types) |
| 17 | - Manually maintained experimental, legacy and removed functions |
| 18 | |
| 19 | ## Install |
| 20 | |
| 21 | ```sh |
| 22 | npm install css-functions-list --save |
| 23 | ``` |
| 24 | |
| 25 | ## Usage |
| 26 | |
| 27 | ```js |
| 28 | import { promises as fs } from 'fs'; |
| 29 | import functionsListPath from 'css-functions-list'; |
| 30 | |
| 31 | (async () => { |
| 32 | const functionsList = JSON.parse( |
| 33 | await fs.readFile(functionsListPath, 'utf8') |
| 34 | ); |
| 35 | console.log(functionsList); |
| 36 | /* [ |
| 37 | 'abs', |
| 38 | 'acos', |
| 39 | 'annotation', |
| 40 | 'asin', |
| 41 | 'atan', |
| 42 | 'atan2', |
| 43 | 'attr', |
| 44 | 'blur', |
| 45 | 'brightness', |
| 46 | 'calc' |
| 47 | // … |
| 48 | ]; */ |
| 49 | })(); |
| 50 | ``` |
| 51 | |
| 52 | ## API |
| 53 | |
| 54 | ### functionsListPath |
| 55 | |
| 56 | Type: `string` |
| 57 | |
| 58 | Path to CSS functions list JSON file. |
| 59 | |
| 60 | ## License |
| 61 | |
| 62 | MIT © [Ivan Nikolić](http://ivannikolic.com) |
| 63 | |
| 64 | <!-- prettier-ignore-start --> |
| 65 | |
| 66 | [ci]: https://github.com/niksy/css-functions-list/actions?query=workflow%3ACI |
| 67 | [ci-img]: https://github.com/niksy/css-functions-list/workflows/CI/badge.svg?branch=master |
| 68 | |
| 69 | <!-- prettier-ignore-end --> |