-
Notifications
You must be signed in to change notification settings - Fork 133
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 icon-color prop to tip boxes #1284
Conversation
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.
This looks great! Thanks! @vig42
On the branch naming, do make PRs from separate branches though, otherwise you might have problems resolving with the upstream later. |
Good work @vig42 |
We could implement this by dynamically applying the corresponding bootstrap class (info, warning etc.) to the icon wrapper div, to override the overall bootstrap class. We would have to have a check in place if the seamless or light styles are used, otherwise both the classes would be applied to the icon wrapper div. We could similarly do this to the content wrapper if we want the same functionality for the color property. I guess the use case would be for someone who wants to combine the background or text color of 1 bootstrap style with the icon color of another. |
Doesn't sound like worth the effort. Perhaps we can provide the color codes as built-in global variables e.g., |
Do-able as @vig42 mentioned, but it's a little strange for a Color codes as built in variables would be certainly nice, but a lot of work has to be done before that similar to what's needed for #903. That and color codes are definitely worth the time / code to me though |
I agree with that. Let's not go there.
The objective is to let users use exact bootstrap colors where MarkBind syntax doesn't accept bootstrap color names (e.g., I think this is just a matter of adding a bunch of global named constants (not correct to say variables, although we can keep calling them builtin variables for simplicity). We already have some global variables https://markbind.org/userGuide/reusingContents.html#built-in-global-variables that vary the value dynamically e.g., |
unfortunately, that would be the case if we didn't have support for bootstrap themes, but even if we didn't, I don't think it's good practice to hard code these values on the development side; it's a lot of maintainence. internally, bootstrap declares it's color palette with sass variables, something like this (example from a bootswatch theme):
it may be much more extensible to have a build process automatically source the color codes from these source files, and output them as variables. This is also in line with #903 which likely requires a similar sourcing process (but from the author side). lots of things need to be done before then though, this and #903 would probably be a v3.0 feature |
Understood. In the meantime, where can I find the hex values for those 8 colors? |
I would go here https://getbootstrap.com/docs/4.0/utilities/colors/ and use inspect element to get the colors. It's a little cumbersome but it's only do-once and wysiwyg. |
Nice. Thx @ang-zeyu |
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [ ] Documentation update
• [ ] Bug fix
• [ ] New feature
• [X] Enhancement to an existing feature
• [ ] Other, please explain:
Resolves #1271
What changes did you make? (Give an overview)
Added icon-color prop to tip boxes. This allows users to change the icon color independent of text color in tip boxes.
Some examples:
Note that you will need to run
npm run build:components
in order to see the changes, as mentioned here.Is there anything you'd like reviewers to focus on?
Additions were made to packages/vue-components/src/TipBox.vue
Testing instructions:
npm run test
should passProposed commit message: (wrap lines at 72 characters)
Add icon-color prop to tip boxes