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

Feature: Use Different Class Names For Start and End Alignments #263

Open
Jordan9232 opened this issue Sep 14, 2022 · 0 comments
Open

Feature: Use Different Class Names For Start and End Alignments #263

Jordan9232 opened this issue Sep 14, 2022 · 0 comments

Comments

@Jordan9232
Copy link

Jordan9232 commented Sep 14, 2022

I am trying to apply some css styles to popovers depending on vertical/horizontal alignment and I noticed that the following alignments use the same class attributes:

Alignments Class Attribute
horizontalAlign="after"
horizontalAlign="start"
sat-popover-after
horizontalAlign="before"
horizontalAlign="end"
sat-popover-before
verticalAlign="below"
verticalAlign="start"
sat-popover-below
verticalAlign="above"
verticalAlign="end"
sat-popover-above

Because of this, I have no way of distinguishing which one was used in a css selector, I've checked all other attributes on the sat-popover-container element just to make sure there was at least one thing different and they are exactly the same. Is there any way the "start" and "end" alignments can be set in the class attribute? We'd just need two additional ones:

  • sat-popover-start
  • sat-popover-end

Some problems with these new class names:
I noticed that both horizontalAlign="center" and verticalAlign="center" both result in the class "sat-popover-center", which is all fine and everything, since you can distinguish which axis "sat-popover-center" is applying to by checking some of the other class names (like if there are both "sat-popover-center" and "sat-popover-above" in the class, you know center is applying horizontally since "sat-popover-above" is only used for verticalAlign.

This would become an issue when mixing either "start", "center", or "end" in both axis, like horizontalAlign="start" verticalAlign="center". This would result in the classes "sat-popover-start" and "sat-popover-center", and since these classes are used in both axis, it's impossible to know which styles to apply to which axis. So actually maybe you can keep the class attributes as they are currently but just append "start" or "end", like this:

Alignment Class Attributes
horizontalAlign="start" sat-popover-after-start
horizontalAlign="end" sat-popover-before-end
verticalAlign="start" sat-popover-below-start
verticalAlign="end" sat-popover-above-end

Or at least something similar to that so "start" and "end" classes are different depending on the axis

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