File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 233233 bottom : 0 ;
234234 left : 0 ;
235235 width : 80% ;
236- background : var (pub-site_header_popup-background-color );
236+ background : var (-- pub-site_header_popup-background-color );
237237 transform : translateX (-100% );
238238 transition : transform 0.3s ease ;
239239 z-index : $z-index-nav-mask + 1 ;
Original file line number Diff line number Diff line change @@ -75,5 +75,28 @@ void main() {
7575
7676 expect (unused, isEmpty);
7777 });
78+
79+ test ('all variables used have definition' , () async {
80+ final files = await Directory ('lib' )
81+ .list (recursive: true )
82+ .where ((f) => f is File && f.path.endsWith ('.scss' ))
83+ .cast <File >()
84+ .toList ();
85+ final varRegExp = RegExp (r'var\((.*?)\)' );
86+ for (final file in files) {
87+ final content = await file.readAsString ();
88+ for (final m in varRegExp.allMatches (content)) {
89+ final name = m.group (1 )! .trim ();
90+ if (! variables.contains (name)) {
91+ // exempt Material Design variables
92+ if (name.startsWith ('--mdc-' )) {
93+ continue ;
94+ }
95+
96+ fail ('${file .path } references `$name ` without definition.' );
97+ }
98+ }
99+ }
100+ });
78101 });
79102}
You can’t perform that action at this time.
0 commit comments