-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow custom bsStyle #306
Comments
if you validate less strictly, you open yourself up to typo like problems (essentially you can't validate anything reliably at all). isn't it sufficient that you can provide |
Unfortunately no, there would be className "btn btn-default btn-custom" instead of "btn btn-custom". |
you can eliminate that by specifying bsStyle of empty string |
Ok, thanks.
But it's probably nicer not to use react-bootstrap in this situation... |
@trentgrover-wf you can't rely on bootstrap draft semantics and call it "rules". |
I can see the value in doing some kind of validation against a known set of styles you support, yet I can also see the value in allowing for custom styles. I think you can add your own custom styles and still keep the existing validation by doing:
The name constants is deceiving here since nothing has been done to ensure that those values have been modified. If you did this as one of your initial tasks prior to rendering anything, then you'd have the custom options you want with the validation to support it. |
Until the day these are enforced to be constant, or the filename changes. |
We can cross that bridge when that day comes 😄. I'm not planning to change that anytime soon. |
@mtscout6 thank your for this trick, it may help. |
No problem! |
@janmarek Does the above suggestion help? Do we need to keep this issue open for any reason? |
OK, I'm closing it. |
If you set
Unfortunately, if you aren't using CommonJS/AMD, then |
@nemothekid, agree. Everyone modifies bootstrap for production. Nearly everyone adds custom class names for BS. I still hold my alredy expressed opionion that react-bootstrap devs just created a problem out of thin air with this. I don't care about class name validation at all (the cost of error is very low). |
@nemothekid I'd take a pull request to fix the problem with the constants not being available when using requirejs. |
@mtscout6's workaround for webpack (missing
It's not a perfect workaround because it has to be included before anything else includes react-bootstrap, since |
Did v0.20.0 break the workaround of modifying |
Thanks @trevorr I didn't realize that I missed that when we transitioned to using ES6 source. I just published a fix in version 0.20.1. |
Maybe it would be appropriate to implement some kind of configuration option for disabling |
I don't think that's entirely necessary. All that happens with prop validation is console warnings. No errors, and #496 really did provide a nice means to include supported values by downstream users. |
It seems that hardcoded "bottlenecks" exists only in three components now. propTypes: {
bsStyle: React.PropTypes.oneOf(['success', 'warning', 'error'])
... and Is there any value to implement something like #496 for these three components ? |
What's difficult about this is that bootstrap does not have the same set of styles for each component. For example the |
The other problem is that some folks are still able to write their own css which may add more available styles. So, for those components these users want to allow those added styles without console warnings. Having the global pool of options through the old |
+1 @nemothekid, would be great if (thanks for the great library, guys) |
Seems we don't have |
This got fully replaced now. We're not dropping validation anyway. |
Running into this also. Please update. |
Ok, looks like bsStyle={ null } suppresses the errors. |
tonyspiro - thanks, bsStyle={null} works great |
@tonyspiro 👍 thanks! |
@tonyspiro Thanks. bsStyle={null} +1 |
Now you can't add classes like btn-custom or alert-custom to your stylesheet and use them with react-bootstrap components. bsStyle property should be validated less strictly.
The text was updated successfully, but these errors were encountered: