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

How do I style svelte-image images? #66

Open
rchrdnsh opened this issue Aug 16, 2020 · 3 comments
Open

How do I style svelte-image images? #66

rchrdnsh opened this issue Aug 16, 2020 · 3 comments

Comments

@rchrdnsh
Copy link

Dunno how to style the images once they are in a component.

img {...}

...does not seem to work, and:

.Image {...}

...also does not seem to work:

.image {...} with that class added to the component...

...also does not work.

soooooo, how do i style these?

@brittneypostma
Copy link

Also, using tailwind and styles are not applying, being overridden by a default class put on the svelte Image tag?

@DukeRupert
Copy link

You have to make your style global in order for it to apply to the Image component :

:global(.your-style){
position: relative;
width: 100%;
etc.
}

Also, you may have to apply it to the class, wrapperClass and placeholderClass depending on what your doing.

@rchrdnsh
Copy link
Author

rchrdnsh commented Dec 6, 2020

k, sort of working, but now how do i apply a conditional class? Like this:

class:playing-border={currentTitle === post.title}

?

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

3 participants