Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

enable ba co to match background color

Oleg Isonen51574ce925e3
diff --git a/app/designer/features/style-panel/search.tsx b/app/designer/features/style-panel/search.tsx
index f8a0ec23d7..f9670ed9b9 100644
--- a/app/designer/features/style-panel/search.tsx
+++ b/app/designer/features/style-panel/search.tsx
@@ -48,7 +48,7 @@ export const Search = ({ onSearch }: SearchProps) => {
placeholder="Search property or value"
onChange={(event) => {
const { value } = event.target;
- setSearch(value.toLowerCase().trim());
+ setSearch(value.toLowerCase());
}}
/>
<IconButton
diff --git a/app/designer/features/style-panel/settings.tsx b/app/designer/features/style-panel/settings.tsx
index 4fb149dbf3..ccce1bb380 100644
--- a/app/designer/features/style-panel/settings.tsx
+++ b/app/designer/features/style-panel/settings.tsx
@@ -13,10 +13,14 @@ import { type SelectedInstanceData } from "~/shared/component";
// Finds a property/value by using any available form: property, label, value
const filterProperties = (properties: Array<string>, search: string) => {
+ const searchParts = search.split(" ").map((part) => part.trim());
const includes = (property: string) => {
if (property.toLowerCase().includes(search)) return true;
if (hyphenate(property).includes(search)) return true;
- return false;
+ // Enables "ba co" to match "backgorund color"
+ return searchParts.every((searchPart) =>
+ property.toLowerCase().includes(searchPart)
+ );
};
return properties.filter((property) => {
for (const styleConfig of styleConfigs) {
@@ -24,10 +28,7 @@ const filterProperties = (properties: Array<string>, search: string) => {
if (includes(styleConfig.property)) return true;
if (includes(styleConfig.label)) return true;
for (const item of styleConfig.items) {
- if (
- item.name.includes(search) ||
- item.label.toLowerCase().includes(search)
- ) {
+ if (includes(item.name) || includes(item.label)) {
return true;
}
}