-
-
Notifications
You must be signed in to change notification settings - Fork 146
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 (flex) style to box enclosing a button #76
Comments
Yep, you have correctly identified the thing stopping you from having a stretchy button. The reason we wrap some of the basic components in a And yes, there is no way to style that box via inline styles. However, there would be a way to style it with CSS: Wrap your button in a box and give the box a CSS class and size auto:
Then create the following class:
I have not tested this at all but think it should work. Having said all this, an up and coming version of re-com will address this issue and allow you to stylr all parts of a component. |
Are you thinking of solving this in some way? In general one might want to be able to specify |
Yes, in an up and coming version of re-com, we will address this so you have the ability to style all parts. |
Maybe I do not even need to wrap ;) Just assign class to button and select the div with css. Let me try it out 💃 |
Lol right, the |
Does not work because |
Last chance suggestion until the new re-com comes out. Try adding
|
Just to note that the same happens in
[v-box
:class preset-class
:children [[:span (merge {:class (str "rc-title display-flex " preset-class " " class)
:style (merge (flex-child-style "none")
{:margin-top margin-top}
{:line-height 1} ;; so that the margins are correct
(when-not underline? {:margin-bottom margin-bottom})
style)} |
@Gregg8 can I help with this issue in some way or it will be fixed in |
Hello, I guess new version never came out. |
As of 2.12.0 this should be solved by use of the new :parts arg and the :wrapper part keyword; see https://re-com.day8.com.au/#/button 'Parts' section. |
I am basically in the need to stretch a button inside a
h-box
row.When I add
:style
to button though, nothing changes and I think I know why (but I might be wrong of course).The problem is clear from the Dev console (I hope):
The box enclosing the button does not have any style added and its
flex
isnone
. I guess this is the reason why it does not grow (or shrink for that matter). If I change thebox
'sflex
to1 0 auto
my problem is solved and the button grows.Maybe
re-com
should return a sizablebutton
?The text was updated successfully, but these errors were encountered: