-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: wp-791 dropdown menu #1028
base: main
Are you sure you want to change the base?
Changes from all commits
ff8cc9e
bb73411
1b644ed
a678c6f
d6f820b
2840e42
1d0317b
5a54861
958069b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,32 +42,15 @@ | |
padding-left: var(--horizontal-buffer); | ||
} | ||
|
||
/* Nested to prevent styles from affecting CMS header dropdown */ | ||
/* HACK: Using ID to increase specificity (until source of problem is fixed) */ | ||
/* HELP: Why does DataFilesSidebar not need such specificity? */ | ||
/* .go-to-button-dropdown { */ | ||
#go-to-button-dropdown { | ||
/* To fix menu not showing */ | ||
/* HELP: Why does DataFilesSidebar not need this fix? */ | ||
.go-to-button-dropdown { | ||
.dropdown-menu { | ||
opacity: 1 !important; | ||
pointer-events: auto !important; | ||
} | ||
/* To restyle */ | ||
.dropdown-menu { | ||
margin-top: 38px; | ||
/* To push menu down by the height of its button */ | ||
/* FAQ: Required because `tag={Button}` loses auto-position of menu */ | ||
top: 28px !important; /* to override `inset` from Popper via Reactstrap */ | ||
} | ||
.dropdown-menu::before, | ||
.dropdown-menu::after { | ||
left: 23px; | ||
margin-left: 0; | ||
} | ||
.dropdown-menu::after { | ||
top: -9px; | ||
} | ||
|
||
.dropdown-item { | ||
display: inline-block; | ||
} | ||
} | ||
|
||
|
@@ -85,12 +68,12 @@ | |
padding-left: 20px; | ||
} | ||
|
||
#go-to-button-dropdown .complex-dropdown-item-root, | ||
.complex-dropdown-item-root, | ||
.complex-dropdown-item-project { | ||
display: flex !important; | ||
display: flex; | ||
} | ||
Comment on lines
-88
to
74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
#go-to-button-dropdown .link-hover:hover { | ||
.go-to-button-dropdown .link-hover:hover { | ||
text-decoration: none; | ||
} | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why?
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why?
Footnotes
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,5 @@ | |
|
||
.add-button-item { | ||
padding-bottom: 20px; | ||
padding-left: 20px; | ||
padding-inline: var(--global-space--section-left); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why delete so much? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,70 +10,29 @@ | |
border-radius: 0; | ||
} | ||
|
||
#add-button-wrapper { | ||
padding-left: var(--horizontal-buffer); | ||
} | ||
#data-files-add { | ||
width: 174px; | ||
width: 100%; | ||
} | ||
Comment on lines
-13
to
15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What did I do? Match design:
|
||
|
||
.data-files-nav { | ||
padding-top: 20px; | ||
} | ||
|
||
/* Nested to prevent styles from affecting CMS header dropdown */ | ||
.data-files-sidebar { | ||
.dropdown-menu { | ||
border-color: var(--global-color-accent--normal); | ||
border-radius: 0; | ||
margin: 11px 3px 0; | ||
width: 200px; | ||
vertical-align: top; | ||
} | ||
.dropdown-menu::before { | ||
position: absolute; | ||
top: -10px; | ||
left: 67px; | ||
border-right: 10px solid transparent; | ||
border-bottom: 10px solid var(--global-color-accent--normal); | ||
border-left: 10px solid transparent; | ||
margin-left: 20px; | ||
content: ''; | ||
/* To make menu wider than button yet still centered */ | ||
width: calc(100% + var(--global-space--section-left)); | ||
left: calc( | ||
var(--global-space--section-left) / -2 | ||
) !important; /* to override `inset` from Popper via Reactstrap */ | ||
} | ||
.dropdown-menu::before, | ||
.dropdown-menu::after { | ||
top: -9px; | ||
left: 68px; | ||
border-right: 9px solid transparent; | ||
border-bottom: 9px solid #ffffff; | ||
border-left: 9px solid transparent; | ||
margin-left: 20px; | ||
content: ''; | ||
} | ||
|
||
.dropdown-item { | ||
padding: 10px 6px; | ||
color: var(--global-color-primary--x-dark); | ||
font-size: 14px; | ||
i { | ||
padding-right: 19px; | ||
font-size: 20px; | ||
vertical-align: middle; | ||
} | ||
&:hover { | ||
color: var(--global-color-primary--x-dark); | ||
} | ||
} | ||
.dropdown-item:focus, | ||
.dropdown-item:hover { | ||
/* FAQ: Before FP-1083, value was #E6E0FB, which matched Design | ||
and was `--global-color-accent` at 25% opacity on white… | ||
which is what `--global-color-accent--weak` is now */ | ||
background-color: var(--global-color-accent--weak); | ||
left: calc(50% - var(--arrow-size)); | ||
} | ||
} | ||
|
||
.complex-dropdown-item { | ||
border-top: 1px solid #707070; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why?
|
||
display: flex; | ||
} | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What did I do?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did I do?
dropdown-menu.css
manages.top
notmargin-top
.Margin is for space between items. Positioning uses specific properties.