Skip to content

Commit ed52338

Browse files
committed
Fix styles.scss to include alert block styles + test.
1 parent 2b0b5c4 commit ed52338

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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('all scss files are used from style.scss', () async {
12+
final references = (await File('lib/style.scss').readAsLines())
13+
.where((l) => l.startsWith(r'@use'))
14+
.map((l) =>
15+
l.substring(4).trim().split(';').first.replaceAll("'", '').trim())
16+
.where((v) => v.isNotEmpty)
17+
.toSet();
18+
expect(references, isNotEmpty);
19+
expect(references, contains('src/_tags'));
20+
21+
final files = await Directory('lib')
22+
.list(recursive: true)
23+
.where((f) => f is File && f.path.endsWith('.scss'))
24+
.cast<File>()
25+
.map((f) => p.relative(f.path, from: 'lib'))
26+
.map((n) => n.substring(0, n.length - 5)) // without the .scss extension
27+
.toSet();
28+
files.removeAll(['dartdoc', 'style']);
29+
expect(files, isNotEmpty);
30+
expect(references, files);
31+
});
32+
}

0 commit comments

Comments
 (0)