Skip to content
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

PR: Fix Flash of Unstyled Content (FOUC) and Enhancements #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

m-naeem66622
Copy link
Contributor

Pull Request: Fix Flash of Unstyled Content (FOUC) and Enhancements

Description:

This pull request introduces enhancements and fixes aimed at improving the user experience and optimizing the development workflow. The changes primarily focus on refining the handling of styles, restructuring the development directory, and addressing the flash of unstyled content (FOUC) issue.

Changes:

  1. Minimize Flash of Unstyled Content (FOUC) with Theme Colors:

    • Addressed the FOUC issue by optimizing the injection of CSS at the start of document loading.
    • Ensured rapid application of styles to mitigate the brief appearance of original colors before dark mode styles are applied, enhancing user experience.
  2. Restructure Dev Directory and Remove Generated CSS Files:

    • Moved the logic.js file to the dev/script directory for better organization.
    • Removed unnecessary CSS files from the css-minified directory, including koochi-koochi.css, as they can be generated dynamically, eliminating redundancy in repository tracking.
  3. Update Merge Script for Styles Directory Handling:

    • Updated the merge script to accommodate the styles directory, utilized by the manifest for managing the theme and mitigating FOUC.
    • The script now ensures the creation of necessary files and directories if they don't exist, streamlining the merging process.

Additional Notes:

  • These changes aim to enhance the maintainability and performance of the project.
  • Please review the modifications thoroughly, particularly the script changes and FOUC fix, to ensure compatibility and effectiveness.
  • Feedback and suggestions for further improvements are welcome.

Screenshots:

With FOUC Issue

with_fouc_error

Minimized FOUC Issue

without_fouc_error

This commit reduces the flash of unstyled content (FOUC) by injecting the CSS at document start. This ensures that the styles are applied as soon as the document begins to load, reducing the brief flash of original colors before the dark mode styles are applied.
This commit moves the log.js file to the dev/script directory and removes the CSS files from the css-minified directory and koochi-koochi.css file. These CSS files can be generated using the script, so they don't need to be tracked in the repository.
This commit updates the merge script to handle the styles directory, which is now used by the manifest to handle the theme for the Flash of Unstyled Content (FOUC). The script has also been updated to handle file and directory creation if doesn't already exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant