Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CSS styles for responsiveness (#87)
* Update logging functionality and improve CSS styles for responsiveness 1. **logger.py**: - **Issue**: Redundant file handling when logging messages. - **Old Code**: ```python if not path.exists(log_file): with open(log_file, mode="w", encoding="utf-8") as file: file.close() with open(log_file, mode="a", encoding="utf-8") as file: file.write(f"{log_msg}\n") file.close() **When checking if the log file exists, you opened it in write mode (mode="w"), which would create the file if it didn’t exist.** **However, immediately after that, you closed the file without writing anything to it.** **This is redundant because you don't need to create the file in write mode if you plan to open it again in append mode.** ``` - **New Code**: ```python # Open in append mode; this will create the file if it doesn't exist with open(log_file, mode="a", encoding="utf-8") as file: file.write(f"{log_msg}\n") # This handles both file creation and writing The **with** statement opens the file and ensures it’s properly closed when the block of code is exited, **eliminating the need for the explicit file.close() statement.** ``` - **Solution**: Removed unnecessary file close after opening the log file in write mode, utilizing append mode to handle file creation and writing efficiently. 2. **style.css**: - **Issue**: (1)- Inconsistent use of units for margin and padding, affecting responsiveness. (2)- Deprecated property value `white-space: nowrap;` in `#noticeText`, which can lead to text overflow issues if the text exceeds the container's width. - **Solution**: - Replaced percentage values for margins and paddings with `rem` units for better scalability and consistency across devices. - Removed `white-space: nowrap;` from `#noticeText` and replaced it with `white-space: normal`, allowing text to wrap within the container for improved readability and responsiveness. These changes enhance the logging functionality and improve the CSS styles for better responsiveness and usability across different devices. * change in the auto css generating function * [pre-commit.ci] auto fixes from pre-commit.com hooks * some neccesary changes as per your request * [pre-commit.ci] auto fixes from pre-commit.com hooks * Fix merge conflict * Regenerate generated files --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: CoolCat467 <[email protected]>
- Loading branch information