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

Localized <style> tags for slides #4

Open
nrdvana opened this issue Jul 15, 2023 · 2 comments
Open

Localized <style> tags for slides #4

nrdvana opened this issue Jul 15, 2023 · 2 comments

Comments

@nrdvana
Copy link
Owner

nrdvana commented Jul 15, 2023

If a slide begins and then contains a <style> tag, that style tag should be scoped to only affect the current slide. It should also probably be inlined into the HTML elements so that reloads of that slide bring the new styles.

CSS::Scopifier and CSS::Inliner can do this, but that adds a lot of dependencies...

@nrdvana
Copy link
Owner Author

nrdvana commented Jul 15, 2023

Each slide could be given a truncated SHA1 as its ID, so the styles would refer to #abcdef12345 and then after a change, a new slide with new ID would be transferred, and new css rules would not interfere with old css rules. The css rules would eventually pile up in the browser after lots of changes, but then the user could just reload the page if needed.

This might further benefit if the back end and front end exchange lists of which hashes they have and which hashes they need, kind of like rsync. This way insertion or deletion of a slide doesn't need to re-send all the slides following that point.

@nrdvana
Copy link
Owner Author

nrdvana commented Jul 2, 2024

The javascript server Vite performs hot-reloads of portions of pages using a <tag data-v-ddf60120=""> and then css rules begin with tag[data-v-299dcc96] ...

This prevents relying on global IDs

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