Skip to content

Commit 6b3e267

Browse files
author
Bart Veneman
committed
use calculateSelectorNode for calculating specificity
1 parent c662d1c commit 6b3e267

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"code"
5050
],
5151
"dependencies": {
52-
"@bramus/specificity": "^2.3.0",
52+
"@bramus/specificity": "github:bartveneman/specificity#be1f89dea482a366b9ed5bd49ef3e8af4d9ccb34",
5353
"css-tree": "^2.3.1"
5454
},
5555
"devDependencies": {

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import parse from 'css-tree/parser'
22
import walk from 'css-tree/walker'
3-
import { calculate } from '@bramus/specificity/core'
3+
import { calculateSelectorNode } from '@bramus/specificity/core'
44
import { isSupportsBrowserhack, isMediaBrowserhack } from './atrules/atrules.js'
55
import { getCombinators, getComplexity, isAccessibility, isPrefixed } from './selectors/utils.js'
66
import { colorFunctions, colorKeywords, namedColors, systemColors } from './values/colors.js'
@@ -318,7 +318,7 @@ export function analyze(css, options = {}) {
318318
uniqueSelectorComplexities.p(complexity, node.loc)
319319

320320
// #region specificity
321-
let [{ value: specificityObj }] = calculate(node)
321+
let specificityObj = calculateSelectorNode(node)
322322
let sa = specificityObj.a
323323
let sb = specificityObj.b
324324
let sc = specificityObj.c

0 commit comments

Comments
 (0)