0. 사용환경
windows 10
python 3.10
pycharm 2024.3.1
streamlit 1.41.1
1. 목적
Streamlit 의 테마를 사용자가 아닌 서버에서 다크모드와 라이트모드를 디폴트 값으로 변경
2. .streamlit 폴더 만들어 주기
Streamlit 라이브러리를 설치 하더라도 .streamlit 폴더는 생성되지 않기 때문에 개발자가 개발환경 root 에 직접 생성해야 한다
아래는 pycharm 개발환경에서 반든 예제
3. config.toml 파일 만들기
.streamlit 폴더에 config.toml 파일도 만들어 주고 다음과 같이 텍스트 입력을 할경우 간단하게 darkmode와 lightmode를 변경할 수 있다.
[theme]
base = "dark"
또는
[theme]
base = "light"
해당 파일 입력 후 streamlit을 재기동하면 다크모드 또는 라이트모드가 기본 적용이 된다.
커스텀한 테마도 만들수 있는데 해당 내용은 아래 참조 링크를 참고~
참조링크: https://discuss.streamlit.io/t/set-default-theme-on-load/13397
'Streamlit' 카테고리의 다른 글
[Streamlit] (File Uploader Error) AxiosError: request failed with status code 413 (0) | 2025.01.01 |
---|