-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
💄 Make :target
elements stand out
#504
base: master
Are you sure you want to change the base?
Conversation
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.
I like the idea, but not the implementation.
h4:target::before { | ||
content: "👉"; /*TODO(😎): localize for different layout directions (e.g. rtl)*/ | ||
} |
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.
I think we should add a background to the h4
instead. Maybe rgba(0,0,0,0.1)
for light mode and rgba(255,255,255,0.1)
for dark mode.
transition-duration: 333ms; | ||
transition-timing-function: ease; | ||
box-shadow: 0 0.8rem 1.0rem 0.1rem rgba(0, 0, 0, 0.2); | ||
transform: translateY(-0.4rem); |
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.
I'm very confused about the styling here. It feels very out of place.
- Why a box shadow? It looks uncanny having a shadow surrounding text and extending to the right (in the middle of nowhere).
- Why does the text move location? (I could understand the pointer moving (sliding into view).)
transition-property: box-shadow, transform; | ||
transition-duration: 333ms; | ||
transition-timing-function: ease; |
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.
Minor: If we have an animation, we should respect prefers-reduced-motion.
On a tall monitor (where you can fit the content of the whole screen without scrolling), it can be difficult seeing where a particular in-page link takes you. This commit makes these elements stand out more
On a tall monitor (where you can fit the content of the whole screen
without scrolling), it can be difficult seeing where a particular in-page
link takes you. This commit makes these elements stand out more
Video demonstration:
quick-lint-js_.find.JavaScript.bugs.and.22.more.pages.-.Personal.-.Microsoft.Edge.2021-11-10.20-02-52.mp4
Notes for reviewer:
h4
selector may be too broad. A quick grep shows right now there is no leakage, but it may be prudent to add a class to these elements to prevent this behavior showing up in unexpected places in the future