You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css] css.lint.hexColorLength seems to be now irrelevant #81808
Yes, best is probably to create a HexColor for all values matching #[1-9A-Fa-f]+
We'd then need to make sure all consumers of HexColor can handle invalid length.
changed the title [-]css.lint.hexColorLength seems to be now irrelevant[/-][+][css] css.lint.hexColorLength seems to be now irrelevant[/+]on May 5, 2020
I've opened a fix in microsoft/vscode-css-languageservice#580. The cause is that _parseHexColor only accepted 3, 4, 6 or 8 hex digits, so a color with any other length never became a hex color node and the hexColorLength lint rule could not see it.
Activity
octref commentedon Oct 22, 2019
Martin Aeschlimann (@aeschli) What do you think would be a good fix? Do we parse invalid colors as
HexColorso this linting rule could work?aeschli commentedon Oct 23, 2019
Related entry on stackoverflow: https://stackoverflow.com/questions/57640557/when-is-vs-codes-setting-css-lint-hexcolorlength-fired
aeschli commentedon Oct 23, 2019
Yes, best is probably to create a HexColor for all values matching
#[1-9A-Fa-f]+We'd then need to make sure all consumers of HexColor can handle invalid length.
andrecasal commentedon Oct 23, 2019
Would also be good to update the setting's description.
[-]css.lint.hexColorLength seems to be now irrelevant[/-][+][css] css.lint.hexColorLength seems to be now irrelevant[/+]UsmanQT commentedon Nov 24, 2026
I've opened a fix in microsoft/vscode-css-languageservice#580. The cause is that
_parseHexColoronly accepted 3, 4, 6 or 8 hex digits, so a color with any other length never became a hex color node and the hexColorLength lint rule could not see it.