-
Notifications
You must be signed in to change notification settings - Fork 2
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
New DTI Website: Use Details/Summary For FAQ Accordion #746
Changes from 1 commit
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 |
---|---|---|
|
@@ -192,3 +192,34 @@ | |
color: black; | ||
background-color: #fefefe; | ||
} | ||
|
||
summary { | ||
padding-top: 1rem; | ||
padding-bottom: 1rem; | ||
list-style: none; | ||
display: flex; | ||
align-items: center; | ||
font-weight: bold; | ||
justify-content: space-between; | ||
padding-right: 1rem; | ||
} | ||
|
||
summary::after { | ||
content: ''; | ||
width: 13px; | ||
height: 7px; | ||
background: url('/icons/dropdown.svg'); | ||
background-size: cover; | ||
} | ||
|
||
details[open] > summary::after { | ||
rotate: 180deg; | ||
} | ||
|
||
details { | ||
user-select: 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. Clicking on the accordian a few times in a row leads to some of the summary text getting highlighted, which is a regression from previous behavior. So I made the details not selectable. 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. hmmm... i'm usually wary of using This StackExchange post goes more into detail about the possible drawbacks of using this particular CSS property. I especially like when they say:
I wonder if rapidly clicking the accordion qualifies as the "primary task purpose of a control"? In my own testing when I pulled down the branch, I had to click twice pretty fast in order to have some of the summary text getting highlighted. 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. I do get ur point tho andrew and it is a shame that using but let's also make sure that this is an exception bc i dont think we want to make this behavior standard 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. Yeah, I had a feeling it was bad practice. I reverted that part! I agree with you that rapidly clicking might be something we do when testing it, but in practice, we wouldn't do that so I wouldn't consider it to be a "primary task purpose of a control". 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. ok, sounds good then! |
||
} | ||
|
||
details > *:not(summary) { | ||
user-select: text; | ||
} |
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.
yay