-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathno-manual-z-index.grit
More file actions
19 lines (15 loc) · 917 Bytes
/
no-manual-z-index.grit
File metadata and controls
19 lines (15 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
language css;
// Match the values assigned to z-index properties
`z-index: $zIndexValue;` where {
// Check that the value is using the design library for z-index values
// we negate the result as failure to comply with the design library should result in the warning
not $zIndexValue <: r"^var\(--lok-z-index-\S+\)$",
// This is generating the helpful error report that points out any violation
// it's a built in function that adds the code with arrows and a description of what's wrong
register_diagnostic(
span = $zIndexValue,
message = "lokalise/plugin/noManualZIndex :: z-index values should be set using the design library. Please use refer to https://lokalise.github.io/louis/?path=/docs/foundations-z-index--docs",
// This is only a warning for now because I can't find a way to biome-ignore the error produced by plugins
severity = "warn",
),
}