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
Component padding and spacing updates #4861
Component padding and spacing updates #4861
Conversation
@willhuang1997 Thanks for approving! I don't have the privileges to merge this PR, do you need anything else from me before merging it? Thanks! |
I did a quick check as well. Do you know why the expander is reverted back to the old version in the snapshots (referring to this update: #4801)? |
…nto component-updates-06012022
@LukasMasuch Thanks for taking a closer look, and sorry about the |
@imjuangarcia thanks for updating this! Btw. if you remove outdated snapshots and let the CI pipeline run, you can also download the updated snapshots directly from CircleCI. I also have a small script which I use to bulk download multiple screenshots at once. This is sometimes more convenient compared to other methods for updating the e2e snapshots :) : from urllib.request import Request, urlopen
import json
from tqdm import tqdm
import os
BASE_PATH = "circle-ci-artifacts"
CIRCLE_CI_TOKEN = "<CIRCLE_CI_TOKEN>"
FILTER = "st_legacy_empty_dataframes"
CIRCLE_CI_URL = (
"https://circleci.com/api/v1.1/project/github/streamlit/streamlit/44028/artifacts"
)
req = Request(CIRCLE_CI_URL)
req.add_header("Circle-Token", CIRCLE_CI_TOKEN)
req.add_header("Accept", "application/json")
artifacts = json.loads(urlopen(req).read().decode("utf-8"))
for artifact in tqdm(artifacts):
path = os.path.join(BASE_PATH, artifact["path"])
if FILTER not in path:
continue
req = Request(artifact["url"])
req.add_header("Circle-Token", CIRCLE_CI_TOKEN)
file = urlopen(req)
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, "wb") as output:
output.write(file.read()) |
I think this file was added by mistake and needs to be removed: https://github.com/streamlit/streamlit/blob/668b8514eff8c08db937e74cd4aba60bd7c31bbf/examples/run_on_save.pybak |
@LukasMasuch Thanks for the script! It's definitively helpful. Just deleted the |
📚 Context
This PR starts to adjust some of our components (namely
st.selectbox
,st.multiselect
,st.text_input
,st.number_input
,st.text_area
,st.time_input
, andst.date_input
), to their ideal counterparts in this Figma file.The adjustments are mostly related to paddings and margins, so they adapt to Tailwind's default spacing scale, but it also introduces adjustments on some other component states, such as the disabled variant for
st_multiselect
.Only added screenshots for this disabled state change because the rest of the changes are smaller and harder to compare, but let me know if you want me to add those as well!
What kind of change does this PR introduce?
🧠 Description of Changes
st.selectbox
:paddingBottom
andpaddingTop
onVirtualDropdown
ControlContainer
,IconsContainer
,ValueContainer
, andPopover
overridesst.multiselect
:StyleUISelect
styled component, to adjust the background color for tags in disabled states forst_multiselect
itemsUISelect
overridestheme/utils.ts
st.text_input
:marginBottom
onStyledWidgetLabel
borderWidth
,padding
andlineHeight
onTextInput
fontSize
onStyledWidgetInstructions
theme/utils.ts
st.number_input
:st.text_input
]: UpdatedmarginBottom
onStyledWidgetLabel
.padding
,borderWidth
andlineHeight
onNumberInput
CONTROLS_WIDTH
andheight
for controls in/NumberInput/styled-components.ts
st.text_area
:st.text_input
]: UpdatedmarginBottom
onStyledWidgetLabel
.padding
andlineHeight
onTextArea
<StyledTextAreaContainer>
component, and added a rule to the newly createdstyled-components.ts
file to override theborderWidth
propertyst.time_input
:selectOverrides
onTimeInput
mostly to adjustpadding
,margin
andborderWidth
st.date_input
:Updated
overrides
onInput
nested component, mostly to adjustpadding
, andborderWidth
Revised:
Current:
🧪 Testing Done
🌐 References
Does this depend on other work, documents, or tickets?
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.