-
Notifications
You must be signed in to change notification settings - Fork 12
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 new custom theme properties for styling #117
Conversation
bfb4b8f
to
ff3fdcc
Compare
ff3fdcc
to
90683c5
Compare
603006b
to
51c79a4
Compare
51c79a4
to
6fee41f
Compare
Hi @eatyourpeas I would also encourage you guys to file a separate merge request after this one being merged to run eslint/prettier to format the whole project, or even better, including this task on a pipeline or precommit hooks. I had to disable all vscode formatting to be able to contribute with this MR without bloating it with this kind of changes 😬 |
8c8f017
to
222afb0
Compare
I pushed one more customization for tooltips. By the way, I'm trying to keep up with current source code naming and patterns. E.g: I'm using Let me know if I need to adjust something. |
Thanks @gdfreitas for your observations here - all very helpful. @mbarton - what do you think? if we took the fonts out we would have to ask users to import into their different environments. Otherwise, everything else sounds very sensible. I will have a look in a bit more detail. |
Hi @eatyourpeas I understand, we can move the fonts discussion to a separate to not block this PR to be reviewed and merged. It's not an issue for now. |
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.
Thanks @gdfreitas - this is very good. Looking at it now I can see that some of the naming could be better organised. I agree opting for color
rather than colour
makes more sense. The axisStyles and the nondisjunction line styles and delayed puberty line styles have become mixed.
I think if you are happy it meets your use case for the moment let's merge in but make a mental note that could use a refactor. Like many projects, it has evolved over time and needs a tidy.
@gdfreitas just seeing tests failing and a bunch of errors in the browser console. Will need to unpick this before merging - hope that is ok. |
Hi @eatyourpeas I just noticed too, seems I'll need to fill up some test parameters for the new styles because we're directly mocking for tests. I'll do that right now. |
@eatyourpeas It should be fine now, there is still some warnings that are on the live branch too, shouldn't be related to this PR. Commit 64cc9a8 |
I just want to say thank you @gdfreitas for all your contributions here - they are massively appreciated! |
Feature
This merge request turns a few styling properties public API, making some parts more flexible for consumers that are using custom themes
Changes
weight
for base TextStyles interface, which was previously documented understyle
causing some applications to not effectively work, because in CSS they're a two different properties. Also, now there's a benefit that we're not making restrictions, bold/bolder/300/400, any supported CSS values can be used. Defaults were preserved to maintain compatibility with current implementationscustomThemeStyles.axisStyle.axisThresholdLineStyle
customThemeStyles.referenceStyle
customThemeStyles.centileStyle.centileTextStyle
CustomThemeStylesChart
on RCPCH story in Storybook to be used as a more complete reference of pieces that can be customizedThoughts on Fonts for Future
I would like to share some thoughts on how the fonts are being handled by the library. Related comment #113 (comment)
Currently the library embeds a few variants of Montserrat font using base64 encoding to include in the built assets, for later injecting a global style to define the font faces in CSS.
Pros
Cons
My suggestion is to decouple fonts managing from the library, this would require:
@eatyourpeas Please, let me know your thoughts on this