From d9047978b027227b9fb7f47aae3a4a3995f6f9e5 Mon Sep 17 00:00:00 2001 From: Dhaya <154633+dhayab@users.noreply.github.com> Date: Tue, 21 May 2024 12:47:20 +0200 Subject: [PATCH] feat(recommend): set up base CSS styles for `lookingSimilar` widget (#6210) --- bundlesize.config.json | 4 +- .../instantsearch.css/src/themes/algolia.scss | 3 + .../instantsearch.css/src/themes/reset.scss | 1 + .../src/themes/satellite.scss | 7 +- .../widgets/frequently-bought-together.md | 2 +- specs/src/pages/widgets/looking-similar.md | 68 +++++++++++++++++++ specs/src/pages/widgets/related-products.md | 2 +- specs/src/pages/widgets/trending-items.md | 2 +- 8 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 specs/src/pages/widgets/looking-similar.md diff --git a/bundlesize.config.json b/bundlesize.config.json index e2dd563b99..571d82c6e2 100644 --- a/bundlesize.config.json +++ b/bundlesize.config.json @@ -58,11 +58,11 @@ }, { "path": "./packages/instantsearch.css/themes/satellite.css", - "maxSize": "4.60 kB" + "maxSize": "4.7 kB" }, { "path": "./packages/instantsearch.css/themes/satellite-min.css", - "maxSize": "4.25 kB" + "maxSize": "4.3 kB" } ] } diff --git a/packages/instantsearch.css/src/themes/algolia.scss b/packages/instantsearch.css/src/themes/algolia.scss index d99779587f..e13083b718 100644 --- a/packages/instantsearch.css/src/themes/algolia.scss +++ b/packages/instantsearch.css/src/themes/algolia.scss @@ -31,6 +31,7 @@ a[class^='ais-'] { .ais-ResultsPerPage, .ais-InfiniteHits, .ais-InfiniteResults, +.ais-LookingSimilar, .ais-Menu, .ais-MenuSelect, .ais-NumericMenu, @@ -290,6 +291,7 @@ a[class^='ais-'] { .ais-InfiniteResults-list, .ais-Hits-list, .ais-FrequentlyBoughtTogether-list, +.ais-LookingSimilar-list, .ais-RelatedProducts-list, .ais-TrendingItems-list, .ais-Results-list { @@ -307,6 +309,7 @@ a[class^='ais-'] { .ais-InfiniteResults-item, .ais-Hits-item, .ais-FrequentlyBoughtTogether-item, +.ais-LookingSimilar-item, .ais-RelatedProducts-item, .ais-TrendingItems-item, .ais-Results-item { diff --git a/packages/instantsearch.css/src/themes/reset.scss b/packages/instantsearch.css/src/themes/reset.scss index 4c714e7c4a..881b32eb54 100644 --- a/packages/instantsearch.css/src/themes/reset.scss +++ b/packages/instantsearch.css/src/themes/reset.scss @@ -5,6 +5,7 @@ .ais-HierarchicalMenu-list, .ais-Hits-list, .ais-FrequentlyBoughtTogether-list, +.ais-LookingSimilar-list, .ais-RelatedProducts-list, .ais-TrendingItems-list, .ais-Results-list, diff --git a/packages/instantsearch.css/src/themes/satellite.scss b/packages/instantsearch.css/src/themes/satellite.scss index d7b0e23746..6ae4cdba00 100644 --- a/packages/instantsearch.css/src/themes/satellite.scss +++ b/packages/instantsearch.css/src/themes/satellite.scss @@ -605,12 +605,14 @@ $break-medium: 767px; } /** - * Hits, InfiniteHits, FrequentlyBoughtTogether, RelatedProducts and TrendingItems + * Hits, InfiniteHits, FrequentlyBoughtTogether, LookingSimilar, + * RelatedProducts and TrendingItems */ .ais-Hits-item, .ais-InfiniteHits-item, .ais-FrequentlyBoughtTogether-item, +.ais-LookingSimilar-item, .ais-RelatedProducts-item, .ais-TrendingItems-item { align-items: center; @@ -626,6 +628,7 @@ $break-medium: 767px; .ais-Hits-item:first-of-type, .ais-InfiniteHits-item:first-of-type, .ais-FrequentlyBoughtTogether-item:first-of-type, +.ais-LookingSimilar-item:first-of-type, .ais-RelatedProducts-item:first-of-type, .ais-TrendingItems-item:first-of-type { border-radius: 3px 3px 0 0; @@ -634,6 +637,7 @@ $break-medium: 767px; .ais-Hits-item:last-of-type, .ais-InfiniteHits-item:last-of-type, .ais-FrequentlyBoughtTogether-item:last-of-type, +.ais-LookingSimilar-item:last-of-type, .ais-RelatedProducts-item:last-of-type, .ais-TrendingItems-item:last-of-type { border-radius: 0 0 3px 3px; @@ -642,6 +646,7 @@ $break-medium: 767px; .ais-Hits-item:only-of-type, .ais-InfiniteHits-item:only-of-type, .ais-FrequentlyBoughtTogether-item:only-of-type, +.ais-LookingSimilar-item:only-of-type, .ais-RelatedProducts-item:only-of-type, .ais-TrendingItems-item:only-of-type { border-radius: 3px; diff --git a/specs/src/pages/widgets/frequently-bought-together.md b/specs/src/pages/widgets/frequently-bought-together.md index 82291f1450..bf2b25b8f4 100644 --- a/specs/src/pages/widgets/frequently-bought-together.md +++ b/specs/src/pages/widgets/frequently-bought-together.md @@ -48,7 +48,7 @@ classes: options: - name: objectIDs description: objectIDs of the items to get the Frequently Bought Together items from - - name: maxRecommendations + - name: limit description: Number of recommendations to retrieve - name: queryParameters description: List of search parameters to send diff --git a/specs/src/pages/widgets/looking-similar.md b/specs/src/pages/widgets/looking-similar.md new file mode 100644 index 0000000000..44b55a4737 --- /dev/null +++ b/specs/src/pages/widgets/looking-similar.md @@ -0,0 +1,68 @@ +--- +layout: ../../layouts/WidgetLayout.astro +title: LookingSimilar +type: widget +html: | +