-
Notifications
You must be signed in to change notification settings - Fork 166
Tool to import parts of dart-lang/site-shared into third_party/site-shared #8233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Content and infrastructure shared across Dart and Flutter websites. | ||
|
|
||
| Vendoring resource files from: | ||
| - https://github.com/dart-lang/site-shared/tree/main/pkgs/dash_design | ||
|
|
||
| Vendored files can be updated by running: | ||
| `./update-site-shared.sh` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| Copyright 2024, the Dart project authors. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
|
|
||
| * Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| * Redistributions in binary form must reproduce the above | ||
| copyright notice, this list of conditions and the following | ||
| disclaimer in the documentation and/or other materials provided | ||
| with the distribution. | ||
| * Neither the name of Google LLC nor the names of its | ||
| contributors may be used to endorse or promote products derived | ||
| from this software without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright (c) 2024, 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. | ||
|
|
||
| /// styles.scss: | ||
| /// | ||
| /// Incorporates all styles and CSS custom properties (variables) | ||
| /// from the dash_design package. | ||
| /// | ||
| /// Most variables are added at the `:root` (the `html` element), | ||
| /// but dark mode variable overrides are added to the `body` element if | ||
| /// the class `dark-theme` is added to it. | ||
|
|
||
| @use 'styles/variables'; | ||
|
|
||
| $google-site: false !default; | ||
|
|
||
| :root { | ||
| @include variables.typography; | ||
| @include variables.shared-colors; | ||
|
|
||
| @include variables.light-theme; | ||
|
|
||
| @if $google-site { | ||
| @include variables.google-overrides; | ||
| } | ||
| } | ||
|
|
||
| body { | ||
| &.dark-theme { | ||
| @include variables.dark-theme; | ||
| } | ||
| } |
52 changes: 52 additions & 0 deletions
52
third_party/site-shared/dash_design/lib/styles/variables.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Copyright (c) 2024, 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. | ||
|
|
||
| /// styles/variables.scss: | ||
| /// | ||
| /// Mixins that can be included to load CSS custom properties (variables) | ||
| /// into any desired scope. | ||
|
|
||
| /// Shared typography CSS variables. | ||
| @mixin typography { | ||
| /// Used for body text and smaller UI elements, like labels. | ||
| --dash-default-fontFamily: 'Roboto', sans-serif; | ||
|
|
||
| /// Used for headlines, titles, and larger UI elements. | ||
| --dash-display-fontFamily: 'Roboto', sans-serif; | ||
|
|
||
| /// Used for monospace text, such as code blocks. | ||
| --dash-mono-fontFamily: 'Roboto Mono', 'Source Code Pro', 'Cascadia Mono', 'JetBrains Mono', monospace; | ||
|
|
||
| /// Used for icons, such as the magnifying glass for search. | ||
| --dash-symbol-fontFamily: 'Material Symbols', 'Material Symbols Outlined'; | ||
| } | ||
|
|
||
| /// Color-related, theme-agnostic CSS variables. | ||
| @mixin shared-colors { | ||
|
|
||
| } | ||
|
|
||
| /// Light-theme specific CSS variables. | ||
| @mixin light-theme { | ||
| /// The default text color, used for body text. | ||
| --dash-surface-fgColor: #4a4a4a; | ||
| } | ||
|
|
||
| /// Dark-theme specific CSS variables. | ||
| @mixin dark-theme { | ||
| --dash-surface-fgColor: #dcdcdc; | ||
| } | ||
|
|
||
| /// CSS variables that specify values that can only be used by Google sites, | ||
| /// such as enabling the Google Sans font families. | ||
| /// | ||
| /// These overrides should be included after all other variables are defined. | ||
| @mixin google-overrides { | ||
| // Non-Google sites, such as self-hosted API docs, | ||
| // can't use Google Sans or Google Symbols. | ||
| --dash-default-fontFamily: 'Google Sans Text', 'Google Sans', 'Roboto', sans-serif; | ||
| --dash-display-fontFamily: 'Google Sans', 'Google Sans Text', 'Roboto', sans-serif; | ||
| --dash-mono-fontFamily: 'Google Sans Mono', 'Roboto Mono', 'Source Code Pro', 'Cascadia Mono', 'JetBrains Mono', monospace; | ||
| --dash-symbol-fontFamily: 'Google Symbols', 'Material Symbols', 'Material Symbols Outlined'; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| commit c30707803572c7c7c2fd3650d8c6e2a2e61731f4 | ||
| 2024-11-06T15:44+01:00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
|
||
| TEMP_DIR=$(mktemp -d) | ||
|
|
||
| # Clone dartdoc repository | ||
| git clone https://github.com/dart-lang/site-shared "$TEMP_DIR" | ||
|
|
||
| # Delete resources/ | ||
| rm -rf "$SCRIPT_DIR/dash_design" | ||
|
|
||
| # Copy css, js, png files to dash_design/ | ||
| mkdir "$SCRIPT_DIR/dash_design" | ||
| cp -r "$TEMP_DIR"/pkgs/dash_design/lib/ "$SCRIPT_DIR/dash_design/" | ||
|
|
||
| # Copy license | ||
| cp "$TEMP_DIR/pkgs/dash_design/LICENSE" "$SCRIPT_DIR/dash_design/LICENSE" | ||
|
|
||
| # Update the last updated file: | ||
| cd "$TEMP_DIR"/pkgs/dash_design/ && git show --summary | grep commit | head -1 >"$SCRIPT_DIR/last-updated.txt" | ||
| date -Iminutes >>"$SCRIPT_DIR/last-updated.txt" | ||
|
|
||
| # Cleanup | ||
| cd "$SCRIPT_DIR" | ||
| rm -rf "$TEMP_DIR" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.