Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/web_css/lib/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// Local styles and rules.
@use 'src/_variables';
@use 'src/_base';
@use 'src/_alerts';
@use 'src/_site_header';
@use 'src/_activity_log';
@use 'src/_detail_page';
Expand All @@ -20,6 +21,6 @@
@use 'src/_report';
@use 'src/_scores';
@use 'src/_search';
@use 'src/_staging_ribbon.scss';
@use 'src/_staging_ribbon';
@use 'src/_tags';
@use 'src/_topics';
1 change: 1 addition & 0 deletions pkg/web_css/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dependencies:

dev_dependencies:
csslib: ^1.0.0
path: ^1.9.1
test: ^1.16.5
33 changes: 33 additions & 0 deletions pkg/web_css/test/file_use_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:io';

import 'package:path/path.dart' as p;
import 'package:test/test.dart';

void main() {
test('scss files in lib/ are exactly those referenced by style.scss ',
() async {
final references = (await File('lib/style.scss').readAsLines())
.where((l) => l.startsWith(r'@use'))
.map((l) =>
l.substring(4).trim().split(';').first.replaceAll("'", '').trim())
.where((v) => v.isNotEmpty)
.toSet();
expect(references, isNotEmpty);
expect(references, contains('src/_tags'));

final files = Directory('lib')
.listSync(recursive: true)
.whereType<File>()
.where((f) => f.path.endsWith('.scss'))
.map((f) => p.relative(f.path, from: 'lib'))
.map((n) => n.substring(0, n.length - 5)) // without the .scss extension
.toSet();
files.removeAll(['dartdoc', 'style']);
expect(files, isNotEmpty);
expect(references, files);
});
}
Loading