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

Is it possible to create a custom theme that can be applied to both Rails and React libraries? #328

Closed
malonecj opened this issue May 17, 2022 · 2 comments

Comments

@malonecj
Copy link

Context
We are looking to try out Primer to see if it can be a suitable choice both for our applications built in Rails as well as React. While the React project looks like it has the right level of customisation that we need, the Rails view components seem less customisable, at least from the documentation side.

Ideally it would be great to customise in a single place, and have that feed into both Rails and React libraries. However, customising the Rails library separately could also be an option if this was not possible.

I have only found this issue so far which alludes to plans to write some documentation to help achieve this.

Is there any updates on this?

@malonecj malonecj changed the title Is it possible to create custom themes for both Rails and React libraries? Is it possible to create a custom theme that can be applied to both Rails and React libraries? May 17, 2022
@lesliecdubs
Copy link
Member

Tagging in @primer/reviewers to get this on the radar of our First Responders 😄

@siddharthkp
Copy link
Member

siddharthkp commented May 17, 2022

Is it possible to create a custom theme that can be applied to both Rails and React libraries?

Yes, but I would start with saying Primer is built for GitHub first, so it might not be very straightforward to customise it for another brand.

That said, primer/view-components (rails) depends on primer/css for styling.

Both primer/css and primer/react depend on primer/primitives for theme tokens. Refer to this chart. (some of the tokens are imported from primitives, while some are kept in sync with primitives)

For use outside of GitHub, you could fork primer/primitives, create a new theme, build it to get the artefacts and use the custom theme with primer/css for primer/view-components and in primer/react. For primer/css, you could also take the path of overriding css variables instead of maintaining a fork of primitives.

Once again, it's not built with this use case in mind, but it might just work out!

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

4 participants