File size: 1,568 Bytes
a18878f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project      : Python.
# @File         : 994_自定义style
# @Time         : 2022/10/17 上午11:45
# @Author       : yuanjie
# @WeChat       : meutils
# @Software     : PyCharm
# @Description  : 


import streamlit as st
from streamlit.components.v1 import html

st.button('button背景色?换一个吧')
st.text_area('del', placeholder='Label多余?删了就好')
st.radio('想放大label字号, 修改字体吗?', ['想', '很想'])

st.markdown('''<style>
/* radio label字号、字体 */
#root > div:nth-child(1) > div > div > div > div > section > div > div:nth-child(1) > div > div:nth-child(3) > div > label {
     font-size: 50px;
     font-family: "Times New Roman", serif;
}
/* button背景色 */ 
#root > div:nth-child(1) > div > div > div > div > section > div > div:nth-child(1) > div > div:nth-child(1) > div > button {
    background-color: black;
    color: white;
}
/* radio选中项颜色 */
#root > div:nth-child(1) > div > div > div > div > section > div > div:nth-child(1) > div > div:nth-child(3) > div > div > label:nth-child(1) > div.st-co.st-cs.st-ct.st-cu.st-cv.st-cw.st-az.st-b4.st-cx.st-cy.st-cz.st-d0.st-d1.st-d2.st-c4.st-d3.st-d4.st-d5.st-b2.st-bl {
     background-color: black;
}
</style>''', unsafe_allow_html=True)

js_delete = '''window.parent.document.querySelector("#root > div:nth-child(1) > div > div > div > div > section > div > div:nth-child(1) > div > div:nth-child(2) > div > label").remove()'''
html(f'''<script>{js_delete}</script>''',
     width=0,
     height=0)