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

Add styles #540

Closed
mateBe95 opened this issue Sep 23, 2020 · 4 comments · Fixed by #688
Closed

Add styles #540

mateBe95 opened this issue Sep 23, 2020 · 4 comments · Fixed by #688
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues labeled for Hacktoberfest released

Comments

@mateBe95
Copy link

Hi, how to add own styles per image border for example... ;)?

@browniebroke
Copy link
Owner

browniebroke commented Sep 23, 2020

Depends what you want to do, I guess:

Possible solution

To enable the second option, we could add an option to the Gallery component to either pass any component to use as wrapper (a) or some extra CSS that we could inject in the current component (b).

Implementation a:

Passing down a custom component. Example:

const ImgWrapper = styled.div`
  margin: 1rem;
  border-color: black;
  border-radius: 5px;
`

<Gallery images={images} imgWrapper={ImgWrapper}>

Implementation b

Passing down custom CSS. Example:

<Gallery images={images} imgWrapperStyles={{
	margin: '1rem',
	borderColor: 'black',
	borderRadius: '5px',
}}>

@mateBe95
Copy link
Author

Seems implementation a to work well

@browniebroke browniebroke added enhancement New feature or request help wanted Extra attention is needed hacktoberfest Issues labeled for Hacktoberfest good first issue Good for newcomers and removed help wanted Extra attention is needed labels Sep 23, 2020
@github-actions github-actions bot added hacktoberfest Issues labeled for Hacktoberfest and removed hacktoberfest Issues labeled for Hacktoberfest labels Sep 24, 2020
@saintjcob
Copy link

Depends what you want to do, I guess:

Possible solution

To enable the second option, we could add an option to the Gallery component to either pass any component to use as wrapper (a) or some extra CSS that we could inject in the current component (b).

Implementation a:

Passing down a custom component. Example:

const ImgWrapper = styled.div`
  margin: 1rem;
  border-color: black;
  border-radius: 5px;
`

<Gallery images={images} imgWrapper={ImgWrapper}>

Implementation b

Passing down custom CSS. Example:

<Gallery images={images} imgWrapperStyles={{
	margin: '1rem',
	borderColor: 'black',
	borderRadius: '5px',
}}>

Hi,
it would be great if we could somehow style the wrapper as well. I would like to change the max-width and flex-basis, cause on mobile it looks quite small. Any plans for making it possible soon?

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues labeled for Hacktoberfest released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants