Skip to content

Commit

Permalink
Fix style issues, remove unused styles, remove external icons
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Jan 21, 2024
1 parent 07310ec commit b9c3da9
Show file tree
Hide file tree
Showing 28 changed files with 47 additions and 197 deletions.
2 changes: 1 addition & 1 deletion src/_includes/banner.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="banner">
<p class="banner__text">
Check out the
<a href="https://medium.com/dartlang/dart-3-2-c8de8fe1b91f" class="no-automatic-external">Dart 3.2 blog post</a>!
<a href="https://medium.com/dartlang/dart-3-2-c8de8fe1b91f">Dart 3.2 blog post</a>!
<br>
This release brings enhancements to type promotion, interop capabilities,
DevTools, and more.
Expand Down
4 changes: 2 additions & 2 deletions src/_includes/cookie-notice.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div class="container">
<p>Google uses cookies to deliver its services, to personalize ads, and to
analyze traffic. You can adjust your privacy controls anytime in your
<a href="https://myaccount.google.com/data-and-personalization" target="_blank" rel="noopener" class="no-automatic-external">Google settings</a>.
<a href="https://policies.google.com/technologies/cookies" target="_blank" rel="noopener" class="no-automatic-external">Learn more</a>.
<a href="https://myaccount.google.com/data-and-personalization" target="_blank" rel="noopener">Google settings</a>.
<a href="https://policies.google.com/technologies/cookies" target="_blank" rel="noopener">Learn more</a>.
</p>
<button id="cookie-consent" class="btn btn-primary">Okay</button>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/_includes/page-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<img src="/assets/img/shared/dart/logo+text/horizontal/white.svg" alt="Dart" width="164">
</a>
<div class="footer-social-links">
<a href="https://medium.com/dartlang" target="_blank" rel="noopener" title="Medium blog" class="no-automatic-external">
<a href="https://medium.com/dartlang" target="_blank" rel="noopener" title="Medium blog">
<svg>
<use href="/assets/img/social/medium.svg#medium"></use>
</svg>
</a>
<a href="https://github.com/dart-lang" target="_blank" rel="noopener" title="GitHub" class="no-automatic-external">
<a href="https://github.com/dart-lang" target="_blank" rel="noopener" title="GitHub">
<svg>
<use href="/assets/img/social/github.svg#github"></use>
</svg>
</a>
<a href="https://twitter.com/dart_lang" target="_blank" rel="noopener" title="X (Twitter)" class="no-automatic-external">
<a href="https://twitter.com/dart_lang" target="_blank" rel="noopener" title="X (Twitter)">
<svg>
<use href="/assets/img/social/x.svg#x"></use>
</svg>
Expand All @@ -24,14 +24,14 @@
<div class="footer-section footer-tray">
<div class="footer-licenses">
Except as otherwise noted, this site is licensed under a
<a href="https://creativecommons.org/licenses/by/4.0/" class="no-automatic-external">Creative Commons Attribution 4.0 International License</a>,
<a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>,
and code samples are licensed under the
<a href="https://opensource.org/licenses/BSD-3-Clause" class="no-automatic-external">3-Clause BSD License</a>.
<a href="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</a>.
</div>
<div class="footer-utility-links">
<ul>
<li><a href="/terms" title="Terms of use">Terms</a></li>
<li><a href="https://policies.google.com/privacy" target="_blank" rel="noopener" title="Privacy policy" class="no-automatic-external">Privacy</a></li>
<li><a href="https://policies.google.com/privacy" target="_blank" rel="noopener" title="Privacy policy">Privacy</a></li>
<li><a href="/security" title="Security philosophy and practices">Security</a></li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/_includes/page-github-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
{% capture issueTitle -%} title=[PAGE ISSUE]: '{{siteTitle}}' {%- endcapture -%}

<div id="page-github-links" class="btn-group" aria-label="Page GitHub links" role="group">
<a href="{{path}}" class="btn no-automatic-external" title="View page source" target="_blank" rel="noopener">
<a href="{{path}}" class="btn" title="View page source" target="_blank" rel="noopener">
<i class="material-icons">description</i>
</a>
<a href="{{repo}}/issues/new?template=1_page_issue.yml&{{issueTitle}}&page-url={{url}}&page-source={{path}}" class="btn no-automatic-external" title="Report an issue with this page"
<a href="{{repo}}/issues/new?template=1_page_issue.yml&{{issueTitle}}&page-url={{url}}&page-source={{path}}" class="btn" title="Report an issue with this page"
target="_blank" rel="noopener">
<i class="material-icons">bug_report</i>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/sidenav-level-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
{% endif -%}
<li class="nav-item">
<a class="nav-link {{class}}" href="{{entry.permalink}}" {%- if isExternal %} target="_blank" rel="noopener" {%- endif -%}>
{{entry.title}} {%- if isExternal -%}<span class="material-icons md-24">open_in_new</span>{%- endif -%}
{{entry.title}}
</a>
</li>
{% endif -%}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/sidenav-level-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<li class="nav-item">
<a class="{{class}}" href="{{entry.permalink}}" {%- if isExternal %} target="_blank" rel="noopener" {%- endif -%}>
{{entry.title}} {%- if isExternal -%}<span class="material-icons md-24">open_in_new</span>{%- endif -%}
{{entry.title}}
</a>
</li>

Expand Down
2 changes: 1 addition & 1 deletion src/_includes/sidenav-level-3.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<li class="nav-item">
<a class="{{class}}" href="{{entry.permalink}}" {%- if isExternal %} target="_blank" rel="noopener" {%- endif -%}>
{{entry.title}} {%- if isExternal -%}<span class="material-icons md-24">open_in_new</span>{%- endif -%}
{{entry.title}}
</a>
</li>

Expand Down
2 changes: 1 addition & 1 deletion src/_includes/sidenav-level-4.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<li class="nav-item">
<a class="{{class}}" href="{{entry.permalink}}" {%- if isExternal %} target="_blank" rel="noopener" {%- endif -%}>
{{entry.title}} {%- if isExternal -%}<span class="material-icons md-24">open_in_new</span>{%- endif -%}
{{entry.title}}
</a>
</li>
{% endif -%}
Expand Down
40 changes: 0 additions & 40 deletions src/_sass/_site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -367,26 +367,6 @@ main .content {
}
}

.break-50 {
width: 50% !important;
}

.break-60 {
width: 60% !important;
}

.break-70 {
width: 70% !important;
}

.break-80 {
width: 80% !important;
}

.break-90 {
width: 90% !important;
}

.card-grid {
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -457,13 +437,6 @@ li.card {
}
}

@include dart-style-for(good, $alert-success-bg, $alert-success-fg, 'good');
@include dart-style-for(bad, $alert-danger-bg, $alert-danger-fg, 'bad');
@include dart-style-for(passes-sa, $alert-success-bg, $alert-success-fg, '\2714 static analysis: success');
@include dart-style-for(fails-sa, $alert-danger-bg, $alert-danger-fg, '\2717 static analysis: error/warning');
@include dart-style-for(runtime-success, $alert-success-bg, $alert-success-fg, '\2714 runtime: success');
@include dart-style-for(runtime-fail, $alert-danger-bg, $alert-danger-fg, '\2717 runtime: error');

.muted {
color: $gray;
}
Expand Down Expand Up @@ -686,12 +659,6 @@ body.homepage {
padding: 0;
}

pre.prettyprint {
margin-top: 0;
height: 200px;
overflow: auto;
}

.card-grid {
justify-content: center;
margin-top: 30px;
Expand Down Expand Up @@ -856,13 +823,6 @@ body.obsolete {
.card {
width: 100%;
}
.break-50,
.break-60,
.break-70,
.break-80,
.break-90 {
width: 100% !important;
}
}

@media(max-width: 479px) {
Expand Down
30 changes: 4 additions & 26 deletions src/_sass/components/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
@use '../core/variables' as *;
@use '../core/bootstrap';

//
// Code-prettyprint overrides
//
pre {
margin-bottom: 1rem;
font-size: 0.9375rem; // 15px
font-size: 0.9375rem;
font-weight: bootstrap.$font-weight-normal;
padding: 1.25rem;

Expand Down Expand Up @@ -73,15 +70,15 @@ pre {
right: 8px;
z-index: 5;

.language-dart & {
.highlight-languages .language-dart & {
color: $brand-primary;
}

.language-js & {
.highlight-languages .language-js & {
color: #f1a85a;
}

.language-swift & {
.highlight-languages .language-swift & {
color: #f05137;
}

Expand Down Expand Up @@ -140,25 +137,6 @@ pre {
}
}

$generic-output-color: white;

@mixin console-base($color: $light-green-A700) {
background: $grey-900;
color: $color;
}

.language-console .highlight {
@include console-base;
.go { color: $generic-output-color; } /* Generic.Output */
}

pre.console-output {
@include console-base($generic-output-color)
}

// Dart-site specific style overrides
.highlight .gp { user-select: none; }

// Border and resizability for dartpad
iframe[src^="https://dartpad"]:not(#try-dart-pad) {
border: 1px solid #ccc;
Expand Down
10 changes: 6 additions & 4 deletions src/_sass/components/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,26 @@ form {
appearance: none;
min-width: 120px;
padding: 0 30px 0 10px;
margin: 0 .25rem;

&:focus {
outline: none;
}
}

&:after {
@include md-icon-content("chevron_left");
font: $site-font-icon;
content: 'expand_more';
vertical-align: bottom;
display: block;
position: absolute;
right: 12px;
top: 12px;
right: .5rem;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
font-size: 16px;
font-size: 20px;
color: $gray-dark;
pointer-events: none;
@include transition();
Expand Down
8 changes: 0 additions & 8 deletions src/_sass/components/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,6 @@


&.external {
span.material-icons {
vertical-align: middle;
margin-left: 4px;
font-size: 12px;
color: inherit;
opacity: 0.8;
}

&::after {
display: none;
}
Expand Down
11 changes: 0 additions & 11 deletions src/_sass/core/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ a, button {
&:active {
color: $flutter-color-blue-800;
}

&.external {
&:after {
@include md-icon-content("launch");
vertical-align: middle;
margin-left: 2px;
font-size: 10px;
color: inherit;
opacity: 0.5;
}
}
}

img {
Expand Down
46 changes: 0 additions & 46 deletions src/_sass/core/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@
animation-delay: ($delay);
}

// Material design icons
@mixin md-icon-content($icon-name, $width: '') {
font-family: 'Material Icons';
content: $icon-name;
@if $width {
max-width: $width; // Improves UX by minimizing flicker due to delay in font rendering
}
vertical-align: bottom;
}

@mixin md-icon-before($icon-name) {
&:before {
@include md-icon-content($icon-name);
}
}

// The left and right sidebar is dynamically repositioned as the user scrolls,
// to follow both the header's bottom and the banner's bottom position.
//
Expand All @@ -48,33 +32,3 @@
top: $site-header-with-banner-obsolete-height;
}
}

@mixin dart-style-for($kind, $bg-color, $fg-color, $msg) {
.#{$kind} {
@if $bg-color != 'inherit' {
background-color: $bg-color !important;
}
position: relative;

//&:after {
// font-family: $font-family-monospace;
// font-size: 0.8125rem;
// font-weight: 500;
// content: $msg;
// position: absolute;
// top: 6px;
// left: 8px;
// color: $fg-color;
//}

.code-block-tag {
color: $fg-color;
}
}

@if $bg-color != 'inherit' {
.#{$kind} pre {
background-color: $bg-color;
}
}
}
6 changes: 0 additions & 6 deletions src/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,6 @@ $(function() {
$(window).smartresize(fixNav);
scrollSidebarIntoView();

// Add external link indicators
$('a[href^="http"], a[target="_blank"]')
.not('.no-automatic-external')
.not('a[href^="https://dart.dev"]')
.addClass('external');

// Collapsible inline TOC expand/collapse
$(".site-toc--inline__toggle").on('click', function () {
var root = $("#site-toc--inline");
Expand Down
4 changes: 2 additions & 2 deletions src/codelabs/async-await.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ void main() {
}
```

{:.console-output}
```plaintext
Fetching user order...
Your order is: Instance of '_Future<String>'
```

</div>
<div class="col-sm">

Expand All @@ -325,11 +325,11 @@ Future<String> fetchUserOrder() =>
}
```

{:.console-output}
```plaintext
Fetching user order...
Your order is: Large Latte
```

</div>
</div>
</div>
Expand Down
Loading

0 comments on commit b9c3da9

Please sign in to comment.