-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 vertical alignment parameter to st.columns
#8568
base: develop
Are you sure you want to change the base?
Conversation
st.columns
st.columns
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
st.columns
st.columns
st.columns
st.columns
st.columns
st.columns
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.
I'd prefer to not impact the CSS of the checkbox example. I think it's worth talking more about how checkboxes are supposed to take up space. Can we not reflect the height of the checkbox to be equivalent to the height of a text input/button and center the text within it? I imagine that might add a tiny bit more space in markdown, but I think it will be much easier to reason about the height of elements if it's consistent?
@@ -113,10 +113,11 @@ export const StyledElementContainer = styled.div<StyledElementContainerProps>( | |||
interface StyledColumnProps { | |||
weight: number | |||
gap: string | |||
verticalAlignment?: "top" | "center" | "bottom" |
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.
nit: Should probably centralize the type for vertical alignment.
let verticalAlignment: "top" | "bottom" | "center" = "top" | ||
if ( | ||
node.deltaBlock.column.verticalAlignment === | ||
BlockProto.Column.VerticalAlignment.CENTER |
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.
nit: Perhaps we can alias for easier reading?
const { column } = node.deltaBlock
const { VerticalAlignment } = BlockProto.Column
if (column.verticalAlignment = VerticalAlignment.CENTER)
...
I think it will simplify a little below too.
// Add margin to the last checkbox within the column to align it | ||
// better with other input widgets. This is a temporary (ugly) fix | ||
// until we have a better solution for this. | ||
"& .element-container:last-of-type > .stCheckbox": { |
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.
I don't understand this, can I see an example with images or something.
I don't prefer to target classes in favor of referencing Emotion components. Perhaps we should discuss the problem and find a better solution.
// better with other input widgets. This is a temporary (ugly) fix | ||
// until we have a better solution for this. | ||
"& .element-container:last-of-type > .stCheckbox": { | ||
marginBottom: 9, |
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.
Should be "9px" right?
Describe your changes
Adds a
vertical_alignment
parameter tost.columns
that allows tobottom
,top
, orcenter
align the items vertically.GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.