-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dropdown to switch between Flutter-related sites (#11659)
Adds a dropdown to the Flutter wordmark in the navbar, as well as a badge to distinguish the docs site from the marketing site. <img width="240" alt="Flutter site switcher expanded in light mode" src="https://github.com/user-attachments/assets/4393530e-2e48-4354-9358-8ccc2ec147da" /> --- Resolves #11658
- Loading branch information
Showing
6 changed files
with
256 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,123 @@ | ||
@use '../base/mixins'; | ||
@use '../base/variables' as *; | ||
|
||
.dropdown { | ||
position: relative; | ||
display: inline-flex; | ||
justify-content: center; | ||
} | ||
|
||
button.dropdown-button { | ||
padding: 0.4rem 0.6rem; | ||
border-radius: 0.25rem; | ||
|
||
.material-symbols:last-child { | ||
margin-left: 0.4rem; | ||
color: rgba(85, 85, 85, 0.6); | ||
font-size: 1rem; | ||
width: 0.7rem; | ||
} | ||
|
||
&:hover { | ||
.material-symbols { | ||
color: rgba(85, 85, 85, 0.8); | ||
} | ||
} | ||
} | ||
|
||
.dropdown-content { | ||
display: none; | ||
position: absolute; | ||
background-color: var(--site-switcher-bg, #ffffff); | ||
box-shadow: 0 6px 18px 0 rgba(0, 0, 0, 0.2); | ||
z-index: 1060; | ||
border-radius: 0.4rem; | ||
width: max-content; | ||
top: 2.25rem; | ||
transform: scale(0.9); | ||
|
||
&.show { | ||
display: block; | ||
} | ||
|
||
.dropdown-menu { | ||
padding: 0.4rem; | ||
|
||
ul { | ||
display: flex; | ||
flex-direction: column; | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
|
||
li { | ||
padding: 0.3rem; | ||
|
||
a { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: row; | ||
|
||
text-decoration: none; | ||
} | ||
} | ||
} | ||
|
||
.dropdown-divider { | ||
background-color: #e7e8ed; | ||
border-radius: 0.5rem; | ||
height: 0.125rem; | ||
margin: 0.25rem; | ||
padding: 0; | ||
} | ||
} | ||
} | ||
|
||
.site-wordmark { | ||
padding: 0.4rem 0.6rem; | ||
border-radius: 0.25rem; | ||
align-items: center; | ||
display: flex; | ||
flex-direction: row; | ||
cursor: pointer; | ||
|
||
font-variant-ligatures: none; | ||
font-size: 1.75rem; | ||
line-height: 1.25em; | ||
letter-spacing: 0.015em; | ||
font-family: 'Google Sans', sans-serif; | ||
user-select: none; | ||
|
||
> img { | ||
width: 28px; | ||
margin-right: 0.75rem; | ||
} | ||
|
||
&.current-site { | ||
background-color: rgba(194, 229, 255, 0.4); | ||
} | ||
|
||
&:hover { | ||
@include mixins.interaction-style(4%); | ||
} | ||
|
||
&:active { | ||
@include mixins.interaction-style(6%); | ||
} | ||
|
||
span { | ||
color: #4a4a4a; | ||
} | ||
|
||
span.subtype { | ||
padding: 0 0.3rem; | ||
font-size: 1.25rem; | ||
font-weight: 500; | ||
color: $site-color-body; | ||
line-height: 1.3; | ||
border-radius: 0.25rem; | ||
background-color: rgb(194, 229, 255); | ||
margin-left: 0.4rem; | ||
letter-spacing: normal; | ||
} | ||
} |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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