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

refactor: remove styles from slidem-slide-base #46

Open
bennypowers opened this issue May 11, 2023 · 4 comments
Open

refactor: remove styles from slidem-slide-base #46

bennypowers opened this issue May 11, 2023 · 4 comments

Comments

@bennypowers
Copy link
Collaborator

Users that extend slidem-slide-base should be able to apply their own styles and DOM without having to cascade over slidem's styles.

There are different ways to accomplish content scaling than the one used in slidem-slide, so let's give users the choice by moving the constructed stylesheet from base to slidem-slide

@ruphin
Copy link
Owner

ruphin commented May 11, 2023

I originally designed the separation between slidem-slide-base and slidem-slide based on this reasoning;

Slidem-slide

Should contain only things that are additional features to style text and make basic slides using HTML only. The main functionality is enabling basic layout and styling through attributes of specific child elements. It is meant to provide an "easy" way to quickly make a slide without having to touch any CSS, so a user can quickly make a deck with nothing but an HTML file.

Slidem-slide-base

Contains all the fundamental things that are required to make slides work. This includes slide-specific behaviours like steps. The main reason it contains some styles, is that the zoom animation is really difficult to implement from the slidem-deck, and it relies on some HTML structure and layout in slidem-slide-base. Another reason is that it was difficult to implement the automatic scaling of slides without having some sort of container for the slide content. Currently this container is created in slidem-slide-base, and the relevant styles also live there. If I remember correctly the main issue is that if a slide doesn't have a container for the content like it does currently, you cannot simultaneously have a fullscreen background while scaling the content.


I consider the zoom animation and the automatic scaling of content to be core functionalities of Slidem, and unfortunately the only way I was able to implement them is by enforcing a bit of structure in slidem-slide-base. If you can find a way to implement the zoom animation and the scaling in slidem-deck, and make it work completely agnostic of the html structure of the slides, then that opens a possibility of removing the styles from slidem-slide-base.

@bennypowers
Copy link
Collaborator Author

it's not that slidem's solution is bad, it's just that sometimes an author wants to bring their own. So i'm not advocating to remove the current solution, just to give authors an escape hatch in case they have special needs.

@bennypowers
Copy link
Collaborator Author

to clarify the intent here: for regular users nothing should change they would still import deck and slide and get the same behavior that they have now.

But "advanced" or "escape hatch" users would get a DOM-less experience, at least as far as slide is concerned. We should consider the possibility of providing a DOM-less base deck as well.

Wherever the base class is coupled to the DOM, we can provide overridable getters, or some default configuration.

@ruphin
Copy link
Owner

ruphin commented May 15, 2023

I understand, and I think we're in agreement here. I just don't have an idea on how to facilitate this from a technical point of view, other than just exposing more internals.

If you have a proposal on how to implement this change I'm happy to take a look

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

2 participants