@@ -118,6 +118,7 @@ class StaticFileCache {
118
118
// deployment process. Normally page rendering checks their existence,
119
119
// and fails when they are missing. By listing these here, the build
120
120
// is no longer a strict requirement, and tests can be run without it.
121
+ '/static/css/dartdoc.css' ,
121
122
'/static/css/style.css' ,
122
123
'/static/js/script.dart.js' ,
123
124
};
@@ -240,11 +241,7 @@ class StaticUrls {
240
241
late final pubDevLogoSvg = getAssetUrl ('/static/img/pub-dev-logo.svg' );
241
242
late final defaultProfilePng = getAssetUrl (
242
243
'/static/img/material-icon-twotone-account-circle-white-24dp.png' );
243
- late final githubMarkdownCss = getAssetUrl ('/static/css/github-markdown.css' );
244
- late final dartdocGithubCss =
245
- getAssetUrl ('/static/dartdoc/resources/github.css' );
246
- late final dartdocStylesCss =
247
- getAssetUrl ('/static/dartdoc/resources/styles.css' );
244
+ late final dartdocCss = getAssetUrl ('/static/css/dartdoc.css' );
248
245
late final dartdocScriptJs =
249
246
getAssetUrl ('/static/dartdoc/resources/docs.dart.js' );
250
247
late final dartdochighlightJs =
@@ -331,11 +328,19 @@ Future updateLocalBuiltFilesIfNeeded() async {
331
328
332
329
final webCssDir = Directory (resolveWebCssDirPath ());
333
330
final webCssLastModified = await _detectLastModified (webCssDir);
334
- final styleCss = File (path.join (staticDir.path, 'css' , 'style.css' ));
335
- final styleCssExists = await styleCss.exists ();
336
- final styleCssLastModified =
337
- styleCssExists ? await styleCss.lastModified () : null ;
338
- if (! styleCssExists || (styleCssLastModified! .isBefore (webCssLastModified))) {
331
+
332
+ Future <bool > cssNeedsUpdate (String filename) async {
333
+ final styleCss = File (path.join (staticDir.path, 'css' , filename));
334
+ final styleCssExists = await styleCss.exists ();
335
+ final styleCssLastModified =
336
+ styleCssExists ? await styleCss.lastModified () : null ;
337
+ return ! styleCssExists ||
338
+ (styleCssLastModified! .isBefore (webCssLastModified));
339
+ }
340
+
341
+ final needsCssBuild = (await cssNeedsUpdate ('style.css' )) ||
342
+ (await cssNeedsUpdate ('dartdoc.css' ));
343
+ if (needsCssBuild) {
339
344
_logger.info ('Building pkg/web_css' );
340
345
await updateWebCssBuild ();
341
346
}
0 commit comments