@@ -408,6 +408,53 @@ describe('table filter accessibility', () => {
408408 }
409409} ) ;
410410
411+ // Hamburger toggle (mobile view): mvp.css paints every button's text in
412+ // var(--color-bg), and .menu-toggle only overrode background/border, so the
413+ // ☰ glyph rendered in the page background color and the 1px --input-border
414+ // edge fell below 3:1 on the menu surface. Both must be re-driven from a
415+ // per-palette variable.
416+ describe ( 'menu toggle contrast' , ( ) => {
417+ /**
418+ * Concatenates every declaration block for a selector: the rules map keeps
419+ * only the last occurrence (the responsive block) for repeated selectors,
420+ * so assertions must run against all of them together.
421+ *
422+ * @param {string } selector - CSS selector to collect.
423+ * @returns {string } Combined declarations.
424+ */
425+ function combinedRule ( selector ) {
426+ const bodies = [ ] ;
427+ const ruleRe = / ( [ ^ { } ] + ) \{ ( [ ^ { } ] * ) \} / g;
428+ let match ;
429+ while ( ( match = ruleRe . exec ( noComments ) ) !== null ) {
430+ if ( match [ 1 ] . trim ( ) === selector ) bodies . push ( match [ 2 ] ) ;
431+ }
432+ return bodies . join ( ';' ) ;
433+ }
434+
435+ it ( 're-drives the glyph and border from the palette' , ( ) => {
436+ const toggle = combinedRule ( '.menu-toggle' ) ;
437+ expect ( toggle ) . toMatch ( / (?: ^ | ; ) \s * c o l o r : \s * v a r \( - - m e n u - t o g g l e - c o l o r \) / ) ;
438+ expect ( toggle ) . toMatch ( / b o r d e r : \s * 1 p x s o l i d v a r \( - - m e n u - t o g g l e - c o l o r \) / ) ;
439+ } ) ;
440+
441+ for ( const [ name , palette ] of [ [ 'light' , lightPalette ] , [ 'dark' , darkPalette ] ] ) {
442+ it ( `declares a ${ name } palette color for the toggle` , ( ) => {
443+ expect ( palette . get ( '--menu-toggle-color' ) ) . toBeTruthy ( ) ;
444+ } ) ;
445+
446+ it ( `the glyph keeps AA text contrast on the menu surface (${ name } , SC 1.4.3)` , ( ) => {
447+ expect ( contrastOf ( palette , '--surface-color' , '--menu-toggle-color' ) )
448+ . toBeGreaterThanOrEqual ( 4.5 ) ;
449+ } ) ;
450+
451+ it ( `the border is perceivable on the menu surface (${ name } , SC 1.4.11)` , ( ) => {
452+ expect ( contrastOf ( palette , '--surface-color' , '--menu-toggle-color' ) )
453+ . toBeGreaterThanOrEqual ( 3 ) ;
454+ } ) ;
455+ }
456+ } ) ;
457+
411458describe ( 'report CSS selector boundaries' , ( ) => {
412459 it ( 'themes only graph edges and arrowheads, preserving red cycles and node glyphs' , ( ) => {
413460 const fixture = document . createElement ( 'div' ) ;
0 commit comments