2019-09-05 22:20:46 +03:00
---
title: Deprecation data
---
2019-09-05 21:55:25 +03:00
2019-11-01 21:14:53 +03:00
As of version 12.7.0, we publish CSS selector and SCSS variable deprecation data (as of 14.0.0) with `@primer/css` . You can access the data via the [Node API ](#node ) or as [JSON ](#json ).
2019-09-05 21:55:25 +03:00
2021-09-10 20:54:26 +03:00
To deprecate a class, variable, or mixin, add the element to the [deprecations.js ](https://github.com/primer/css/blob/main/deprecations.js ) file with it's replacement value.
The replacement can be:
* A `String` for a direct replacement.
* An `Array` for multiple replacement options.
* `null` to indicate there is no replacement.
This could look something like this:
```js
const deprecations = {
"deprecated-1": "replacement",
"deprecated-2": ["replacement-1", "replacement-2"],
"deprecated-3": null
}
```
2019-09-05 21:55:25 +03:00
2019-09-05 22:20:46 +03:00
## JSON
2019-09-05 21:55:25 +03:00
The JSON data is available in the unpacked node module's `dist/deprecations.json` , and is an object with the following structure:
2021-09-10 20:54:26 +03:00
```json
{
"selectors" {...},
"variables": {...},
"mixins": {...}
}
```
* `selectors` is an object mapping CSS selectors to their replacements. If the replacement is an Array, then there's multiple options. If the replacement is null then there are no replacements.
2019-09-05 21:55:25 +03:00
```json
{
2021-09-10 20:54:26 +03:00
"selectors": {
"deprecated-class": "replacement-class"
2019-09-05 21:55:25 +03:00
}
}
```
2021-03-22 08:34:44 +03:00
2021-09-10 20:54:26 +03:00
* `variables` is an object mapping SCSS variables to their replacement SCSS variable.
2019-09-05 21:55:25 +03:00
```json
{
2021-09-10 20:54:26 +03:00
"variables": {
"$deprecated-variable": "$replacement-variable"
2019-09-05 21:55:25 +03:00
}
}
```
2021-03-22 08:34:44 +03:00
2021-09-10 20:54:26 +03:00
* `mixins` is an object mapping SCSS mixins to their replacement SCSS mixins.
2019-11-01 21:14:53 +03:00
```json
{
2021-09-10 20:54:26 +03:00
"mixins": {
"deprecated-mixin": "replacement-mixin"
2019-11-01 21:14:53 +03:00
}
}
```
2021-03-22 08:34:44 +03:00
2019-09-05 21:55:25 +03:00
2019-09-05 22:20:46 +03:00
## Node
2019-09-05 21:55:25 +03:00
The Node API for selector deprecations is available at
`@primer/css/deprecations` .
2021-09-10 20:54:26 +03:00
### Example:
2019-09-05 21:55:25 +03:00
```js
2021-09-10 20:54:26 +03:00
const {
deprecatedSelectors,
deprecatedSassVariables,
deprecatedSassMixins
} = require('@primer/css/deprecations')
2019-11-01 21:14:53 +03:00
```