Tighten the design guard's application-CSS check on real stylesheets
Plan step 41 review, check (iii): calc() hid every literal inside it and now only one built on a var() does (min(), max() and clamp() too), so calc(8px + 4px) and clamp(1rem, 2vw, 2rem) are reported. Declarations are read whole, so a last one without a semicolon is seen and a custom property named --card-border-radius is not mistaken for border-radius; the font shorthand is checked; a 0s duration is fine. Media queries read only width features: a height or prefers-* condition is not a breakpoint, and (600px <= width < 840px) passes. The type hints no longer suggest font-size: var(--md-sys-typescale-*), which is a font shorthand value. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Opus 5
parent
c0c71ef16c
commit
2073480da4
@@ -510,13 +510,19 @@ it('finds every literal design value and off-scale media query in the applicatio
|
||||
'app-css/app.css:25 literal colour `#fff` — use `var(--md-sys-color-*)`',
|
||||
'app-css/app.css:5 literal radius `border-radius: 12px` — use `var(--md-sys-shape-corner-*)`',
|
||||
'app-css/app.css:6 literal shadow `box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2)` — use `var(--md-sys-elevation-*)`',
|
||||
'app-css/app.css:7 literal font size `font-size: 14px` — use `var(--md-sys-typescale-*)`, which sets size, line height and weight together',
|
||||
'app-css/app.css:8 literal font weight `font-weight: 600` — use `var(--md-sys-typescale-*)` or `var(--md-sys-typescale-emphasized-*)`',
|
||||
'app-css/app.css:9 literal line height `line-height: 1.4` — use `var(--md-sys-typescale-*)`, which sets it with the size',
|
||||
'app-css/app.css:7 literal font size `font-size: 14px` — set the whole style with `font: var(--md-sys-typescale-*)` and its `-tracking`, or an `md-type-*` class',
|
||||
'app-css/app.css:8 literal font weight `font-weight: 600` — use an `md-type-emphasized-*` class, or `var(--md-ref-typeface-weight-regular|medium|bold)`',
|
||||
'app-css/app.css:9 literal line height `line-height: 1.4` — set the whole style with `font: var(--md-sys-typescale-*)`, or an `md-type-*` class',
|
||||
'app-css/app.css:10 literal letter spacing `letter-spacing: 0.02em` — use `var(--md-sys-typescale-*-tracking)`',
|
||||
'app-css/app.css:11 literal easing in `transition: opacity 200ms ease-in-out` — use `var(--md-sys-motion-spatial-*)`/`var(--md-sys-motion-effects-*)`, paired with its `-duration`',
|
||||
'app-css/app.css:11 literal duration in `transition: opacity 200ms ease-in-out` — use `var(--md-sys-motion-…-duration)`, paired with its easing',
|
||||
"app-css/app.css:34 media query width `700px` is not one of M3's breakpoints — use 600, 840, 1200 or 1600px (medium, expanded, large, extra-large)",
|
||||
'app-css/app.css:43 literal radius `border-top-left-radius: calc(8px + 4px)` — use `var(--md-sys-shape-corner-*)`',
|
||||
'app-css/app.css:46 literal font `font: 600 14px/20px sans-serif` — use `font: var(--md-sys-typescale-*)` with its `-tracking`, or an `md-type-*` class',
|
||||
'app-css/app.css:47 literal font size `font-size: clamp(1rem, 2vw, 2rem)` — set the whole style with `font: var(--md-sys-typescale-*)` and its `-tracking`, or an `md-type-*` class',
|
||||
'app-css/app.css:48 literal line height `line-height: 1.5` — set the whole style with `font: var(--md-sys-typescale-*)`, or an `md-type-*` class',
|
||||
"app-css/app.css:34 media query width `700px` is not one of M3's breakpoints — use 600, 840, 1200 or 1600px (medium, expanded, large, extra-large) with `>=` or `<`",
|
||||
"app-css/app.css:51 media query width `839px` is not one of M3's breakpoints — use 600, 840, 1200 or 1600px (medium, expanded, large, extra-large) with `>=` or `<`",
|
||||
"app-css/app.css:53 media query width `40rem` is not one of M3's breakpoints — use 600, 840, 1200 or 1600px (medium, expanded, large, extra-large) with `>=` or `<`",
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -36,3 +36,19 @@
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.edges {
|
||||
--card-border-radius: 12px;
|
||||
border-radius: min(var(--md-sys-shape-corner-lg), 50%);
|
||||
border-top-left-radius: calc(8px + 4px);
|
||||
transition: opacity 0s;
|
||||
animation: pulse var(--md-sys-motion-effects-slow-duration) var(--md-sys-motion-effects-slow) infinite;
|
||||
font: 600 14px/20px sans-serif;
|
||||
font-size: clamp(1rem, 2vw, 2rem);
|
||||
line-height: 1.5
|
||||
}
|
||||
|
||||
@media (width > 839px) and (max-height: 500px) { .edges { display: none; } }
|
||||
@media (600px <= width < 840px), (prefers-reduced-motion: reduce) { .edges { display: block; } }
|
||||
@media (max-width: 40rem) { .edges { display: grid; } }
|
||||
@container (width > 400px) { .edges { display: flex; } }
|
||||
|
||||
Reference in New Issue
Block a user