-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 inputClassName to InputGroup props #5860
Comments
@viveleroi do you mean on the What are you trying to do exactly that is not possible with the existing APIs? It helps to provide a code sandbox demonstrating your exact scenario. |
Yes, the input. Sorry it was a typo saying "icon". I was jumping around the docs so much this weekend as I was using so many pieces. I think the answer to my issue though is to use |
Nevermind the close, there is no |
@viveleroi you don't need |
If you want to target the input in CSS: <InputGroup className="my-input" /> .my-input .bp4-input {
// styles here
} |
We're using CSS modules as well as utility classes for typography and I need to apply two classnames directly to the element. |
So how do you forward a prop that exists on the InputGroup? I need |
That sounds like a limitation of your CSS architecture. Whatever CSS authoring language or tooling you choose to use on top of Blueprint, we're using plain CSS so it should be trivial to generate selectors with enough specificity to override Blueprint's styles. Which text input styles are you specifically trying to override? Again, it would really help if there was a code sandbox or something we can look at together here. Are you trying to override typography in all Blueprint inputs? Then you should likely be writing plain CSS and applying vendor overrides in a file that is not a CSS module. Even with CSS modules, you can do this: .my-input :global(.bp4-input) {
// styles here
} |
I don't understand why it's just "I have limited architecture" when your other components offer exactly what I'm after, this one doesn't. I'm not setting up a codepen because this isn't a debate about my architecture, it's just one missing prop that I've seen you use elsewhere. For example Select2 has My use case is that I need to apply a classname to the |
Yes, it's true that we offer many customization points for Blueprint components so that you can apply overrides & attributes to nested elements and components. We try to design these in a predictable way. Select2 has With I would accept a PR to add a new prop
Yes, this is to be expected for Blueprint's architecture as it stands now. We've been using simple, global CSS for many years and it's not something we can easily change. There is some discussion around this in #248. Gilad's comment in particular (#248 (comment)) illustrates some potential approaches / ways to think about styling on top of Blueprint. |
Given how many different architectures there are these days it's hard to make assumptions. Sure, simple CSS can override stuff. It's odd that some architectures make this harder than it needs to be, but the benefits outweigh these issues. I would expect css modules and css-in-js to grow more popular and likely soon exceeded by some new concept. CSS Modules is great for us but it's far from perfect - conceptually and technically. For example it runs as a postcss plugin but it's own import system doesn't, meaning we can't use other postcss plugins. We're building a new app with a brand new architecture so we're ditching SASS, so it would be nice to someday see source files that are modular and accept CSS variables, that way I can pick and choose what elements I want in your lib. StorybookJS complicates this because it has css that leaks into stories and overrides fonts we usually inherit, so we also need to be able to set font classes more specifically than traditional css. It's all just a big mess! Allowing custom classes/props/even DOM for some of these elements really help bp be flexible. |
I need a way to add a specific class name to the
input
inside of anInputGroup
but I don't see a way to do that. I've seen other component exposes a prop like this, so I'd like to see it here too.Environment
Examples
The text was updated successfully, but these errors were encountered: