Merge pull request #226 from thaw-ui/feat/menu-style

feat/menu style
This commit is contained in:
luoxiaozero 2024-08-11 23:59:52 +08:00 committed by GitHub
commit d99354f822
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 28 deletions

View file

@ -6,7 +6,7 @@
## Documentation & Community
[https://next-thawui.vercel.app](https://next-thawui.vercel.app)
[https://thawui.vercel.app](https://thawui.vercel.app)
[Discord](https://discord.com/channels/1031524867910148188/1270735289437913108)

View file

@ -5,6 +5,9 @@ use thaw::*;
pub fn SwitchVersion() -> impl IntoView {
let options = vec![
("main", "https://thawui.vercel.app"),
("0.3.3", "https://thaw-85fsrigp0-thaw.vercel.app"),
("0.3.2", "https://thaw-czldv7au5-thaw.vercel.app"),
("0.3.1", "https://thaw-bwh2r7eok-thaw.vercel.app"),
("0.3.0", "https://thaw-gxcwse9r5-thaw.vercel.app"),
("0.2.6", "https://thaw-mzh1656cm-thaw.vercel.app"),
("0.2.5", "https://thaw-8og1kv8zs-thaw.vercel.app"),

View file

@ -1,13 +1,20 @@
.thaw-menu-item{
padding: 6px 5px;
border-radius: 2px;
cursor: pointer;
.thaw-menu-item {
display: flex;
align-items: center;
padding: var(--spacingVerticalSNudge) var(--spacingHorizontalS);
color: var(--colorNeutralForeground1);
cursor: pointer;
border-radius: var(--borderRadiusMedium);
}
.thaw-menu-item:hover:not(.thaw-menu-item--disabled) {
background-color: var(--colorNeutralBackground1Hover);
color: var(--colorNeutralForeground1Hover);
}
.thaw-menu-item:active:not(.thaw-menu-item--disabled) {
background-color: var(--colorNeutralBackground1Pressed);
color: var(--colorNeutralForeground1Pressed);
}
.thaw-menu-item.thaw-menu-item--disabled {

View file

@ -1,42 +1,40 @@
.thaw-menu {
padding: 4px;
position: relative;
display: flex;
flex-direction: column;
row-gap: var(--spacingHorizontalXXS);
max-height: 80vh;
padding: var(--spacingHorizontalXS);
background-color: var(--colorNeutralBackground1);
color: var(--colorNeutralForeground1);
border-radius: var(--borderRadiusMedium);
box-shadow: var(--shadow16);
overflow-y: auto;
transform-origin: inherit;
position: relative;
}
[data-thaw-placement="top-start"] > .thaw-menu,
[data-thaw-placement="top-end"] > .thaw-menu,
[data-thaw-placement="top"] > .thaw-menu {
margin-bottom: 4px;
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
}
[data-thaw-placement="bottom-start"] > .thaw-menu,
[data-thaw-placement="bottom-end"] > .thaw-menu,
[data-thaw-placement="bottom"] > .thaw-menu {
margin-top: 4px;
box-shadow: 0 -3px 6px -4px rgba(0, 0, 0, 0.12),
0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -9px 28px 8px rgba(0, 0, 0, 0.05);
}
[data-thaw-placement="left-start"] > .thaw-menu,
[data-thaw-placement="left-end"] > .thaw-menu,
[data-thaw-placement="left"] > .thaw-menu {
margin-right: 4px;
box-shadow: 3px 0 6px -4px rgba(0, 0, 0, 0.12),
6px 0 16px 0 rgba(0, 0, 0, 0.08), 9px 0 28px 8px rgba(0, 0, 0, 0.05);
}
[data-thaw-placement="right-start"] > .thaw-menu,
[data-thaw-placement="right-end"] > .thaw-menu,
[data-thaw-placement="right"] > .thaw-menu {
margin-left: 4px;
box-shadow: -3px 0 6px -4px rgba(0, 0, 0, 0.12),
-6px 0 16px 0 rgba(0, 0, 0, 0.08), -9px 0 28px 8px rgba(0, 0, 0, 0.05);
}
.thaw-menu.dropdown-transition-enter-from,
@ -51,18 +49,8 @@
opacity: 1;
}
.thaw-menu.dropdown-transition-enter-active {
transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.15s cubic-bezier(0, 0, 0.2, 1),
transform 0.15s cubic-bezier(0, 0, 0.2, 1);
}
.thaw-menu.dropdown-transition-enter-active,
.thaw-menu.dropdown-transition-leave-active {
transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.15s cubic-bezier(0.4, 0, 1, 1),
transform 0.15s cubic-bezier(0.4, 0, 1, 1);
transition: opacity var(--durationNormal) var(--curveDecelerateMid),
transform var(--durationNormal) var(--curveDecelerateMid);
}