Skip to content

Commit 87b0b1d

Browse files
authored
Removing the duplicate deprecation backgrounds (#1663)
* Removing the duplicate deprecation backgrounds * Create thick-monkeys-film.md
1 parent 0cc2512 commit 87b0b1d

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

.changeset/thick-monkeys-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Removing the duplicate deprecation backgrounds

__tests__/css.test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import {
22
getCurrentVersion,
33
getPackageStats,
44
getSelectorDiff,
5-
getVariableDiff
5+
getVariableDiff,
6+
currentVersionDeprecations
67
} from './utils/css'
78
import semver from 'semver'
89

@@ -20,3 +21,13 @@ describe('css', () => {
2021
expect(supportStats.size).toEqual(0)
2122
})
2223
})
24+
25+
describe('deprecations', () => {
26+
it('expects deprecations and their replacement to not be equal.', () => {
27+
const deprecations = currentVersionDeprecations()
28+
Object.keys(deprecations["selectors"]).forEach(deprecation => {
29+
const replacement = deprecations["selectors"][deprecation]
30+
expect(deprecation).not.toEqual(replacement)
31+
})
32+
})
33+
})

__tests__/utils/css.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export function getPackageStats(packageName) {
3838
return stats
3939
}
4040

41+
function getDeprecations(versionPath) {
42+
const deprecations = JSON.parse(fs.readFileSync(join(versionPath, './deprecations.json')))
43+
return deprecations
44+
}
45+
4146
function currentVersionSelectors() {
4247
return getSelectors(join(currentPath, './dist'))
4348
}
@@ -46,6 +51,10 @@ function currentVersionVariables() {
4651
return getVariables(join(currentPath, './dist'))
4752
}
4853

54+
export function currentVersionDeprecations() {
55+
return getDeprecations(join(currentPath, './dist'))
56+
}
57+
4958
function lastVersionSelectors() {
5059
return getSelectors(join(lastPath, './dist'))
5160
}

docs/content/support/v18-migration.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ See [color utility classes](/utilities/colors) for a list of all the functional
6464
| `.color-bg-tertiary` | `.color-bg-subtle` |
6565
| `.color-bg-info` | `.color-bg-accent` |
6666
| `.color-bg-info-inverse` | `.color-bg-accent-emphasis` |
67-
| `.color-bg-danger` | `.color-bg-danger` |
6867
| `.color-bg-danger-inverse` | `.color-bg-danger-emphasis` |
69-
| `.color-bg-success` | `.color-bg-success` |
7068
| `.color-bg-success-inverse` | `.color-bg-success-emphasis` |
7169
| `.color-bg-warning` | `.color-bg-attention` |
7270
| `.color-bg-warning-inverse` | `.color-bg-attention-emphasis` |

src/deprecations.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
"color-bg-tertiary": "color-bg-subtle",
3131
"color-bg-info": "color-bg-accent",
3232
"color-bg-info-inverse": "color-bg-accent-emphasis",
33-
"color-bg-danger": "color-bg-danger",
3433
"color-bg-danger-inverse": "color-bg-danger-emphasis",
35-
"color-bg-success": "color-bg-success",
3634
"color-bg-success-inverse": "color-bg-success-emphasis",
3735
"color-bg-warning": "color-bg-attention",
3836
"color-bg-warning-inverse": "color-bg-attention-emphasis",

0 commit comments

Comments
 (0)