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
2 changes: 1 addition & 1 deletion app/lib/dartdoc/dartdoc_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ extension DartDocPageRender on DartDocPage {
final dataBaseHref = p.relative('', from: p.dirname(options.path));
return d.element('body', classes: [
'light-theme',
if (activeConfiguration.isStaging) 'staging-banner',
], attributes: {
'data-base-href':
baseHref ?? (dataBaseHref == '.' ? '' : '$dataBaseHref/'),
'data-using-base-href': usingBaseHref ?? 'false',
if (activeConfiguration.isStaging) 'data-staging': '1',
}, children: [
if (activeConfiguration.isStaging)
d.div(classes: ['staging-ribbon'], text: 'staging'),
Expand Down
4 changes: 3 additions & 1 deletion app/lib/frontend/templates/views/shared/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ d.Node pageLayoutNode({
requestContext.experimentalFlags.isDarkModeDefault
? 'dark-theme'
: 'light-theme',
if (activeConfiguration.isStaging) 'staging-banner',
],
attributes: {
if (activeConfiguration.isStaging) 'data-staging': '1',
},
children: [
// The initialization of dark theme must be in a synchronous, blocking
// script execution, as otherwise users may see flash of unstyled content
Expand Down
2 changes: 1 addition & 1 deletion pkg/web_css/lib/dartdoc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@use '../../../third_party/dartdoc/resources/github.css';
@use '../../../third_party/dartdoc/resources/styles.css';

@import 'src/_staging_ribbon.scss';
@use 'src/_staging_ribbon.scss';

// This is meant for a temporary override for highlight.js. We need to
// figure out a better way to customize the syntax highlights for dark
Expand Down
11 changes: 5 additions & 6 deletions pkg/web_css/lib/src/_staging_ribbon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
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. */

body.staging-banner {
border: 4px solid red;
}

body.staging-banner .staging-ribbon {
body[data-staging] {
border: 4px solid red;

.staging-ribbon {
position: fixed;
top: 35px;
right: -35px;
Expand All @@ -23,4 +22,4 @@
opacity: 0.8;
pointer-events: none;
}
}
Loading