Skip to content
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

Option to show first sticky before hitting first trigger #155

Open
jimjam-slam opened this issue Dec 13, 2024 · 2 comments
Open

Option to show first sticky before hitting first trigger #155

jimjam-slam opened this issue Dec 13, 2024 · 2 comments
Assignees

Comments

@jimjam-slam
Copy link
Collaborator

In #139 I noticed that videos are a case where you'd often want the video visible (whether or not it's playing) before you hit the first trigger. Having a block of colour there sometimes sucks, and I think even outside video there are cases where you'd want the first sticky visible upfront.

I think this can be handled with CSS (it's essentially "the first sticky, when the section does not have an active sticky"), so it's mostly a matter of whether we want an opt-out class on our .cr-section (say .hide-first-sticky) or an opt-in one (.show-first-sticky). What do you think, @andrewpbray?

@jimjam-slam jimjam-slam self-assigned this Dec 13, 2024
@jimjam-slam
Copy link
Collaborator Author

As you note, @andrewpbray, if classes on stickies were propagated from the QMD to the rendered HTML in the Lua filter, a user could simply add .cr-active to any arbitrary sticky to have it initially shown before the user scrolls into a trigger.

@jimjam-slam
Copy link
Collaborator Author

Turns out this does currently work! However, if you're also using .scale-to-fill, that doesn't kick in until you scroll over.

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

No branches or pull requests

1 participant