Custom Search Styles
Adapt Lay Theme's existing search to your own design while keeping its native search behavior.
Open AI Mode → Custom Search Styles. The page uses the same editor as Custom Header Styles and Custom Shop Styles: a Search card with General and Design & Code tabs, a CSS editor and a responsive website preview.
The Existing Search
Search is built into Lay Theme and opens when a visitor follows a link to #search. There is no separate activation switch. See Search for adding the link, choosing searchable content and configuring result layouts.
Custom Search Styles covers the overlay background, input, suggestions, close icon, result titles, snippets and images. Keep using Customize → Search for native options such as List or Thumbnail Grid display, and Lay Options → Search for search behavior and content coverage.
From Figma to Custom Search Styles
Design your search in Figma, including desktop and phone layouts, suggestions and result states. Connect Claude to your website as explained in the AI Mode tutorial and share the Figma Dev Mode link.
Use Custom Style
Enable Use Custom Style in the Search card's General tab when your CSS is ready. Inside Search, Lay's native visual rules and result Text Format classes give way to your CSS. Native positioning, scrolling, visibility, close-icon glyph and result layout options remain active. Plugin styles and CSS you wrote yourself keep their normal priorities.
Turn the switch off to restore the native appearance. Your CSS stays saved. Existing websites keep their original appearance until this switch is enabled.
Design & Code and Responsive Preview
Use Desktop, Tablet and Phone to edit and review each version. Search follows the page Phone breakpoint and Tablet breakpoint, independently of the Phone Menu breakpoint. Desktop CSS applies above the Phone breakpoint; Tablet overrides it within the Tablet range.
The General tab offers Empty input, Suggestions, Results, No results and Loading preview states. These administrator-only visual fixtures use the real frontend and native result renderer with published example content. They do not change search settings or the search index.
Click Save Changes to publish your CSS. Also test the real search: typing, selecting suggestions, Enter, clearing the input, closing, scrolling long results and following result links. With Gridder content search enabled, Enter starts the full-content search. Mobile viewport previews help check layout; check the software keyboard on your phone too.
Styling the Native Components
Selectors are automatically limited to #search-region. Use :scope for this root. The visible background belongs to .search-view; the close control .close-search is its sibling inside the root, so it stays fixed while results scroll.
/* Overlay and input */
.search-view {
background: #f5f3ec;
color: #243125;
}
#search-query {
font-size: 28px;
border-bottom: 1px solid #9caa9a;
}
#search-query:focus-visible {
outline: 2px solid #627251;
outline-offset: 5px;
}
/* Keep the native close control and its icon font. */
.close-search { color: #243125; }
Results use the configured List or Thumbnail Grid layout; page-only text results can also appear above the grid. Empty input and no matches currently share a native state class. There is no built-in no-results message element.
Saved Styles and Theme Updates
Search Styles are saved in the WordPress database and remain intact during Lay Theme updates. Transfer them with Tools → Export / Import → Custom Search Styles. AI changes also participate in the existing Change History and Undo checks.
For Coding Assistants
Read GET /wp-json/laytheme/v1/ai/search-styles first. It describes the current CSS, target, selectors, state classes, breakpoints, preview URLs and interaction checks. Submit search_styles.update through the existing validate → confirm → apply workflow and read the result back. The resource requires an authorized AI Mode connection; visitors cannot change the site's styles.
{
"changes": [{
"action": "search_styles.update",
"definition": {
"styles": {
"search": {
"enabled": true,
"css_desktop": ".search-view { background: #f5f3ec; }",
"css_tablet": "",
"css_phone": "#search-query { font-size: 24px; }"
}
}
}
}]
}