Skip to content

💄 Make :target elements stand out#504

Closed
vegerot wants to merge 0 commit intoquick-lint:masterfrom
vegerot:master
Closed

💄 Make :target elements stand out#504
vegerot wants to merge 0 commit intoquick-lint:masterfrom
vegerot:master

Conversation

@vegerot
Copy link
Contributor

@vegerot vegerot commented Nov 11, 2021

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:

  • There is a small layout shift with the transition. However the shift is contained within the single section you select; so impact to CLS should be small if any (note: unmeasured)
  • using the 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
rg "h4 id"
public/install/neovim/common-manual.ejs.html
18:<h4 id="manual-neovim-package">Install as a Neovim package</h4>
49:<h4 id="manual-neovim-dein-vim">Install with dein.vim</h4>
69:<h4 id="manual-neovim-packer-nvim">Install with packer.nvim</h4>
94:<h4 id="manual-neovim-vim-plug">Install with Vim-Plug</h4>

public/install/vim/common-manual.ejs.html
17:<h4 id="manual-vim-package">Install as a Vim package</h4>
49:<h4 id="manual-vim-pathogen">Install with Pathogen</h4>
72:<h4 id="manual-vim-vim-plug">Install with Vim-Plug</h4>
90:<h4 id="manual-vim-vundle">Install with Vundle</h4>

Copy link
Collaborator

@strager strager left a 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.

Comment on lines +170 to +172
h4:target::before {
content: "👉"; /*TODO(😎): localize for different layout directions (e.g. rtl)*/
}
Copy link
Collaborator

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);
Copy link
Collaborator

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).)

Comment on lines +174 to +176
transition-property: box-shadow, transform;
transition-duration: 333ms;
transition-timing-function: ease;
Copy link
Collaborator

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.

Copilot AI review requested due to automatic review settings March 22, 2026 02:41
@vegerot vegerot closed this Mar 22, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants