Skip to content

[BUG]: Warnings are prioritized over errors #151

@alvaromontoro

Description

@alvaromontoro

Bug Report

Details of the bug

Working on the longdesc task (issue #108), I found that in some cases where I expected an error, a more generic warning was displayed. This happens because the selectors for error and warning have the same specificity and in checka11y.scss, we have the following code:

/*! Checka11y.css v2.0.0 | MIT License | github.com/jackdomleo7/Checka11y.css */
@use "./errors/checka11y-errors.scss";
@use "./warnings/checka11y-warnings.scss";

If specificity is the same for both selectors, the one appearing later in the code will prevail. In this case the warning. Ideally, we should swap the position of the @use in the file above.

Checka11y.css version: 2.1.0

What is the expected result?

If an element has multiple issues, errors should take precedence over warnings.

What is the actual result?

At equal specificity, the warning is displayed instead of the error.

Acceptance criteria

  • If an element has a warning and an error with equal specificity, errors should prevail

Why is fixing this bug important?

People may disregard warnings as "not priorities" and ignore them, but those warnings may be hiding an error behind them. The most restrictive message should take precedence, so if an element has an error and a warning with the same specificity, the error should be displayed. (error > warning)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working quite right

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions