Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Refactor header layout and optimize loading performance - #5

Merged
srgzlb merged 16 commits into
mainfrom
feature/sc-1876-set-up-basic-environment-for-small-theme
Oct 23, 2025
Merged

srgzlb merged 16 commits into
mainfrom
feature/sc-1876-set-up-basic-environment-for-small-theme

Conversation

@srgzlb

@srgzlb srgzlb commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

This PR refines the header layout and improves code quality, improving maintainability and responsiveness across devices.

Changes:

  • Centered header elements for a balanced and cohesive layout.
  • Fixed dropdown menu positioning to ensure precise alignment and consistent behavior, preventing offset issues.
  • Vertically aligned logo image for visual balance.
  • Marked non-critical JavaScript files to load asynchronously to reduce render-blocking.
  • Added responsive styles for better layout behavior on smaller screens.
  • Configured ESLint with project rules to enforce consistent coding standards.

Result:

Improved header layout consistency, faster initial page load, and a cleaner, more maintainable codebase.

…ogo image verticaly on desktop, load js files as non-critical, add responsive styles, config eslinter
@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

  • SCSS Linting: ✅ Passed
  • JavaScript Linting: ✅ Passed
  • Build Process: ✅ Passed

🎉 All checks passed! Ready for review.

@srgzlb srgzlb added review Please look at my code shop-team Shop and commerce labels Oct 17, 2025
Serhii Zlobin added 2 commits October 17, 2025 15:38
…onality

- Added header.js to manage header height and CSS variable updates.
- Integrated header component into theme.liquid for module loading.
- Updated styles to support new header interactions.
- Implemented cleanup system for efficient resource management
@dabrorius
dabrorius self-requested a review October 20, 2025 08:03
Serhii Zlobin added 3 commits October 20, 2025 11:34
…nt when needed

- Implement search.js for handling search functionality with modal overlay and URL management.
- Modify theme.liquid to conditionally load search.js based on header section configuration.
- Update header.liquid to remove the show_search setting and directly use search settings.
- Adjust settings_data.json to remove the show_search option from the search settings.
Comment thread src/layout/theme.liquid Outdated

{% comment %} Non-critical JavaScript - load after page fully loads {% endcomment %}
<script type="module">
window.addEventListener('load', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use defer here instead?

@srgzlb srgzlb Oct 21, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <script type="module"></script> tag in HTML is used to include a JS module. This signifies to the browser that the enclosed or referenced JS code should be treated as an ECMAScript module.

Key characteristics and implications of using type="module":

  • ES6 module syntax. It enables the use of import and export statements within the JS code, allowing for modular development, organizing the code into separate files, and sharing between them.
  • Default deferral. Execution of scripts with type="module" is delayed until the HTML document has been parsed and the DOM is ready. This is similar to adding the defer attribute to a classic script.
  • Single execution. If the same module (with the same src) is loaded multiple times, it will only be executed once.
  • CORS requirements. When loading external module scripts using the src attribute, cross-origin requests are subject to CORS policies.
  • Top-level await. It allows for the use of await at the top level of the module without needing to wrap it in an async function.
  • Browser support. Browsers that do not support type="module" will ignore the script, providing a way to deliver fallback content using <script nomodule> for older browsers.
  • Scope. Variables and functions declared within a module script are typically scoped to that module and are not globally accessible unless explicitly exported.

And for the best performance, instead of including a classic script with the defer attribute, it's better to use
<script type="module" src="{{ 'main.js' | asset_url }}"></script>, which provides automatic defer behavior, faster script availability, and code imports/exports between files.

@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

  • SCSS Linting: ✅ Passed
  • JavaScript Linting: ✅ Passed
  • Build Process: ✅ Passed

🎉 All checks passed! Ready for review.

srgzlb and others added 6 commits October 23, 2025 13:05
…go-transparent-header

Refactor the logo rendering
…e' of github.com:booqable/small-theme into feature/sc-1857-header-section
…small-theme into feature/sc-1857-header-section-search
…oqable/small-theme into feature/sc-1857-header-section-search
@github-actions

Copy link
Copy Markdown

🔍 Code Quality Report

  • SCSS Linting: ✅ Passed
  • JavaScript Linting: ✅ Passed
  • Build Process: ✅ Passed

🎉 All checks passed! Ready for review.

@srgzlb
srgzlb merged commit 1444e77 into main Oct 23, 2025
3 checks passed
@JKinnez JKinnez removed the review Please look at my code label Oct 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

shop-team Shop and commerce

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants