Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Wrong specificity

Open
#50 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
css, python
Domain
tooling, web-dev

Research direction

Run the provided CSSParser.parseString reproduction first, then trace how selectorList[0].specificity is calculated for the shown selector. Compare the result with the expected specificity from the linked calculator; done means the reported specificity is corrected and the reproduction no longer shows the discrepancy.

Written by the indexing model from the issue text.

Description

help wanted

Hello,

I got wrong specificity on this selector .form-floating > .form-control:focus ~ label::after, with https://specificity.keegan.st/ I see 032 whereas with your tool 022

Script to reproduce :

from cssutils import CSSParser


parser = CSSParser(parseComments=False, validate=None)
allrules = parser.parseString(
    ".form-floating > .form-control:focus ~ label::after{color:red}"
)
for el in allrules:
    print(el.selectorList[0].specificity)  # (0, 0, 2, 2)

Thanks

Dominant language
Python
Stars
92
Forks
30
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jaraco/cssutils

All issues in jaraco/cssutils

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.