Skip to content

Commit

Permalink
Check if taipy.css can be used (#1598)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienLelaquais authored Jul 31, 2024
1 parent 89053d4 commit fb771de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion taipy/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2374,12 +2374,16 @@ def _set_frame(self, frame: t.Optional[FrameType]):
self.__default_module_name = _get_module_name_from_frame(self.__frame)

def _set_css_file(self, css_file: t.Optional[str] = None):
script_file = Path(self.__frame.f_code.co_filename or ".").resolve()
if css_file is None:
script_file = Path(self.__frame.f_code.co_filename or ".").resolve()
if script_file.with_suffix(".css").exists():
css_file = f"{script_file.stem}.css"
elif script_file.is_dir() and (script_file / "taipy.css").exists():
css_file = "taipy.css"
if css_file is None:
script_file = script_file.with_name("taipy").with_suffix(".css")
if script_file.exists():
css_file = f"{script_file.stem}.css"
self.__css_file = css_file

def _set_state(self, state: State):
Expand Down

0 comments on commit fb771de

Please sign in to comment.