Skip to content

refactor(theme): split autocomplete CSS into functional area files#91

Merged
sarahdayan merged 5 commits intomainfrom
refactor/autocomplete-css-split
Mar 19, 2026
Merged

refactor(theme): split autocomplete CSS into functional area files#91
sarahdayan merged 5 commits intomainfrom
refactor/autocomplete-css-split

Conversation

@sarahdayan
Copy link
Member

@sarahdayan sarahdayan commented Mar 18, 2026

Summary

  • Split the monolithic autocomplete.css focused files under css/
  • Add readCssWithImports() helper in the runtime build config to resolve @import statements at build time
  • Add sync tests ensuring CSS variables, AUTOCOMPLETE_VARIABLES declarations, and preset keys stay in sync
  • Remove dead variables autocomplete-font-weight-medium and autocomplete-panel-gap (declared and preset-overridden but never referenced in CSS)

sarahdayan and others added 4 commits March 18, 2026 18:06
Add per-source noResults templates for indices and showQuerySuggestions,
and a global noResults empty state with search icon, title (with
{{query}} interpolation), description, and clear query button.

The global noResults panel is fully themeable via dedicated CSS variables
(26 variables covering layout, colors, typography, and button styling),
defined in each preset with values matching their design language.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Integrate main's detachedMediaQuery param and z-index theme variable
alongside this branch's noResults template support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split the monolithic autocomplete.css (825 lines) into 8 focused files
under css/: root, form, input, panel, sources, items, no-results, and
detached. The main file now only contains @import declarations.

Add a readCssWithImports() helper in the runtime build config to resolve
@import statements at build time, since the CSS is inlined via
readFileSync.

Add sync tests to ensure CSS variables, AUTOCOMPLETE_VARIABLES
declarations, and preset keys stay in sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…plete-panel-gap variables

These variables were declared in AUTOCOMPLETE_VARIABLES and overridden
in presets but never referenced in any CSS file, making them dead code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sarahdayan sarahdayan requested a review from dhayab as a code owner March 18, 2026 17:53
Copy link
Member

@dhayab dhayab left a comment

Choose a reason for hiding this comment

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

YES 🙇 !

Base automatically changed from feat/autocomplete-no-results to main March 19, 2026 12:11
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Mar 19, 2026

Deploy Preview for algolia-experiences-react ready!

Name Link
🔨 Latest commit 7fd8240
🔍 Latest deploy log https://app.netlify.com/projects/algolia-experiences-react/deploys/69bbe8e914f9430008a1dc52
😎 Deploy Preview https://deploy-preview-91--algolia-experiences-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Mar 19, 2026

Deploy Preview for algolia-experiences-js ready!

Name Link
🔨 Latest commit 7fd8240
🔍 Latest deploy log https://app.netlify.com/projects/algolia-experiences-js/deploys/69bbe8e96adfe50008cca7dd
😎 Deploy Preview https://deploy-preview-91--algolia-experiences-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sarahdayan sarahdayan merged commit 7e3a3b9 into main Mar 19, 2026
8 checks passed
@sarahdayan sarahdayan deleted the refactor/autocomplete-css-split branch March 19, 2026 12:16
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.

2 participants