-
Notifications
You must be signed in to change notification settings - Fork 24
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
variable width using css custom properties #7
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good apart from some minor tweaks. Out of interest, how is browser compatibility for CSS vars?
@antony Quite good in my opinion. Definitely acceptable in for my work. |
Unfortunately lack of support for IE11 is a dealbreaker. What options do we have regarding the support for legacy (but not dead) browsers? |
The simplest way is to try using this polyfill: https://jhildenbiddle.github.io/css-vars-ponyfill/#/ Otherwise, I can also look into other workarounds/implementations. |
I also got it to work with this: https://stackoverflow.com/a/31868716/11268067 It looks more hacky, but doesnt require any polyfills/libraries. |
Short of adding ponyfills (note, it is indeed a ponyfill, you have to run it for each new element), which seems like overkill for one property, I think we'd need to look at a more static way of doing this for one very specific reason - with the code as it is now, if you were to create a 20vw notification and then an 80vw one, it would resize all elements currently on the screen when it appeared. |
I agree that could be an issue but it seems like a very specific edge case. I can't imagine a use case where a NotificationDisplay component would be created dynamically to trigger this. I also didn't plan for multiple NotificationDisplays because the existing code doesn't really support this (notify would notify all components, they would all be positioned in the top right and overlap, etc). |
@fujeffrey1 I'm not talking about multiple The code definitely doesn't support multiple |
i need this in desktop very bad show notification toast |
@mehdiraized then have a think about how we can work around the issue mentioned above and we can progress the PR. |
In a few months we can merge this, since IE11 will be truly dead! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming back to this, I think this would be better implemented as a style prop: https://svelte.dev/docs#template-syntax-component-directives---style-props
No description provided.