Skip to content

[Poc] Add Specificity Theme Tests #5510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Conversation

zhpenkov
Copy link
Contributor

@zhpenkov zhpenkov commented Jul 9, 2025

related to: https://github.com/telerik/kendo-themes-private/issues/380

Summary

Added CSS specificity analysis and testing capabilities to Kendo Themes, enabling automated monitoring and reporting of selector specificity across all themes. This may help identify CSS specificity issues, and the data can help organize and target specific selectors that require revision.

Implementation

  • units/specificity.js - New CSS specificity analyzer

    • Calculates selector specificity according to CSS spec (IDs, classes, types)
    • Groups selectors by Kendo component (k-* patterns)
  • units/specificity-report.js - Automated report generator

    • Generates markdown reports with statistics and analysis

Testing Infrastructure

  • units/utility.js
    • Added testKendoTheme() function for theme-level testing
    • Implements specificity thresholds (max: 100, average: 30) (Values may differ)
    • Generates JSON data and markdown reports during tests

Theme Test Files

Added theme-specific test files for all themes:

  • units/bootstrap/theme.test.js
  • units/classic/theme.test.js
  • units/default/theme.test.js
  • units/fluent/theme.test.js
  • units/material/theme.test.js

Steps to run

  1. run npx jest units/{theme}/theme.test.js
  2. see raw data units/{theme}/dist/specificity/{theme}-specificity-data.json
  3. see report units/{theme}/dist/specificity/{theme}-specificity-report.json

@zhpenkov zhpenkov self-assigned this Jul 9, 2025
@zhpenkov zhpenkov added the Test issues related to our visual / ci tests label Jul 9, 2025
Copy link

github-actions bot commented Jul 9, 2025

Packages Report

core default classic bootstrap material fluent utils
Size 29.15 KB (0.0%) 781.89 KB (0.0%) 781.90 KB (0.0%) 793.97 KB (0.0%) 927.47 KB (0.0%) 1152.31 KB (0.0%) 625.19 KB (0.0%)
Gzip Size 4.85 KB (0.0%) 101.05 KB (0.0%) 101.33 KB (0.0%) 103.41 KB (0.0%) 114.48 KB (0.0%) 136.53 KB (0.0%) 52.16 KB (0.0%)
Compile Time 1 s (0.0%) 4 s (0.0%) 3 s (0.0%) 4 s (0.0%) 4 s (0.0%) 5 s (0.0%) 3 s (0.0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test issues related to our visual / ci tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant