Skip to content

Commit 8723424

Browse files
authored
Extracting some base CSS to be shared between dash sites. (#8568)
1 parent bb13f34 commit 8723424

File tree

4 files changed

+57
-13
lines changed

4 files changed

+57
-13
lines changed

pkg/web_css/lib/dartdoc.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
@use 'src/_staging_ribbon.scss';
1616

17+
// Included after dartdoc/resources in order to make sure we will be able to migrate to it.
18+
@use 'src/base_dash';
19+
1720
// This is meant for a temporary override for highlight.js. We need to
1821
// figure out a better way to customize the syntax highlights for dark
1922
// mode, both in dartdoc and on pub.dev pages.

pkg/web_css/lib/src/_base.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
@use 'variables';
1010

11-
* {
12-
box-sizing: border-box;
13-
}
14-
1511
body {
1612
background-color: var(--pub-neutral-bgColor);
1713
color: var(--pub-neutral-textColor);
@@ -20,11 +16,8 @@ body {
2016
margin: 0;
2117
padding: 0;
2218
overflow-wrap: anywhere;
23-
}
2419

25-
body, input, button, select {
2620
font-family: var(--pub-font-family-body);
27-
-webkit-font-smoothing: antialiased;
2821
// we don't use font ligatures, and Google Sans fonts would otherwise change text in surprising ways
2922
font-variant-ligatures: none;
3023
font-feature-settings: "liga" 0;
@@ -109,9 +102,7 @@ button {
109102
}
110103

111104
a {
112-
text-decoration: none;
113105
color: var(--pub-link-text-color);
114-
cursor: pointer;
115106

116107
// TODO: fix style to not use bgColor as text and text color as background
117108
&.link-button {
@@ -121,10 +112,6 @@ a {
121112
padding: 4px 12px;
122113
}
123114

124-
&:hover {
125-
text-decoration: underline;
126-
}
127-
128115
@include variables.brightness-on-hover;
129116
}
130117

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
// NOTE: These styles are to be shared in
6+
// https://github.com/dart-lang/site-shared/tree/main/pkgs/dash_design
7+
8+
// *** Layout ****
9+
10+
*, *::before, *::after {
11+
// Need to set borders around elements explicitly.
12+
border-width: 0;
13+
14+
// Sets the percived size of the element in the DOM to include its border.
15+
box-sizing: border-box;
16+
}
17+
18+
body {
19+
// The body should take up all the vertical space.
20+
min-height: 100vh;
21+
}
22+
23+
// **** Typography ****
24+
25+
// TODO: consider standardizing line-height in body
26+
27+
html {
28+
// Prevents the text inflation algorithm used on some smartphones and tablets.
29+
// https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust
30+
-moz-text-size-adjust: none;
31+
-webkit-text-size-adjust: none;
32+
text-size-adjust: none;
33+
}
34+
35+
body {
36+
-webkit-font-smoothing: antialiased;
37+
}
38+
39+
// Inherit fonts for inputs and buttons.
40+
button, input, textarea, select {
41+
font-family: inherit;
42+
font-size: inherit;
43+
}
44+
45+
// Links are underlined when hovered.
46+
a {
47+
cursor: pointer;
48+
text-decoration: none;
49+
50+
&:hover {
51+
text-decoration: underline;
52+
}
53+
}

pkg/web_css/lib/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@use 'src/_third_party';
88

99
// Local styles and rules.
10+
@use 'src/_base_dash';
1011
@use 'src/_variables';
1112
@use 'src/_base';
1213
@use 'src/_alerts';

0 commit comments

Comments
 (0)