-
Notifications
You must be signed in to change notification settings - Fork 65
Allow custom colors with isColor #85
Comments
Yes, it makes sense. Right now is not allowed because the nature of
typescript definitions written in bulma.ts
I'm thinking that we can solve that by allowing a custom `ts` file to add
new colors and to be imported with Bloomer.
I haven't done anything like that because I'll be working on the new
version of Bloomer with style-components and this feature is going to be
added as a `Must Have` 😁
If you want, you can start working on something for this version and I can
help.
|
I haven't worked with typescript before, but I could certainly learn a little and try to contribute. So you're suggesting a file like |
All colors are in bulma.tsx Colors type. Maybe we can implement a export function getColorModifiers({ isColor: color }: Bulma.Color) {
return [`is-${color}`]: true;
} That way we can have Typescript intellisense (only for default ones) and we can allow new colors. The best solution should be to extend Color interface to have the custom colors in the intellisense, but I think is a little Overengineering for now. If you think of a better approach, I'm open to discuss :) This approach is better for this Bloomer Version, and what I was suggesting (a file like Can you try the snippet I showed you and test? I can check your PR if everything is good :) PS: You had a really good understanding on the suggestion, but I believe that it's going to be a pain to do it and it's going to force people to keep track of several stuff right now. |
So you're suggesting we remove the export function getColorModifiers({ isColor: color }: Bulma.Color) {
return { [`is-${color}`]: true };
} I understand now why I'll need to add a default to the Might we also want to modify getColorModifier in the same way? I think for now this is a good solution, if your new version is on its way there seems to be less incentive to make a more involved addition. If this sounds good I'll gladly update the tests and PR it. Might have a few more questions as I'm going 🙂 |
Yes, I believe that the best way should be to remove the So, if a user pass something like We should check for all So, check for those constrains, maybe we can modify another constraints until the release of the new Bloomer Library 😃 |
I noticed that the isColor prop only works with built-in colors like
primary
. But by customizing bulma's$colors
variable, you can use new colors with theis-
prefix.For example:
will style this correctly
but this does not work in Bloomer
Does this feature make sense to add? Right now, I'm having to manually set the colors like so
which removes some of the convenience of this awesome library.
The text was updated successfully, but these errors were encountered: