Skip to content

Commit 1f3eab2

Browse files
authored
Fix styles.scss to include alert block styles + test. (#8476)
1 parent 2b0b5c4 commit 1f3eab2

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

pkg/web_css/lib/style.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// Local styles and rules.
1010
@use 'src/_variables';
1111
@use 'src/_base';
12+
@use 'src/_alerts';
1213
@use 'src/_site_header';
1314
@use 'src/_activity_log';
1415
@use 'src/_detail_page';
@@ -20,6 +21,6 @@
2021
@use 'src/_report';
2122
@use 'src/_scores';
2223
@use 'src/_search';
23-
@use 'src/_staging_ribbon.scss';
24+
@use 'src/_staging_ribbon';
2425
@use 'src/_tags';
2526
@use 'src/_topics';

pkg/web_css/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ dependencies:
1010

1111
dev_dependencies:
1212
csslib: ^1.0.0
13+
path: ^1.9.1
1314
test: ^1.16.5
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'dart:io';
6+
7+
import 'package:path/path.dart' as p;
8+
import 'package:test/test.dart';
9+
10+
void main() {
11+
test('scss files in lib/ are exactly those referenced by style.scss ',
12+
() async {
13+
final references = (await File('lib/style.scss').readAsLines())
14+
.where((l) => l.startsWith(r'@use'))
15+
.map((l) =>
16+
l.substring(4).trim().split(';').first.replaceAll("'", '').trim())
17+
.where((v) => v.isNotEmpty)
18+
.toSet();
19+
expect(references, isNotEmpty);
20+
expect(references, contains('src/_tags'));
21+
22+
final files = Directory('lib')
23+
.listSync(recursive: true)
24+
.whereType<File>()
25+
.where((f) => f.path.endsWith('.scss'))
26+
.map((f) => p.relative(f.path, from: 'lib'))
27+
.map((n) => n.substring(0, n.length - 5)) // without the .scss extension
28+
.toSet();
29+
files.removeAll(['dartdoc', 'style']);
30+
expect(files, isNotEmpty);
31+
expect(references, files);
32+
});
33+
}

0 commit comments

Comments
 (0)