UNPKG

2.94 kBSCSSView Raw
1@forward "variables";
2@forward "./components/base/DefaultProductCard";
3
4@use "variables";
5@use "components/PLP";
6@use "components/category";
7@use "components/search";
8@use "components/Placeholders";
9@use "components/Recommendations";
10@use "components/base/BaseStyle";
11@use "components/base/Buttons";
12
13/// Default theme for Search and Category pages. Calling this mixin will generate all the styling for the page specified.
14/// To configure variables, use `@use` and `with`
15/// @param {"both" | "search" | "category"} $scope - What to generate styling for. Set this to `category` if you are only using the Category page or `search` if you are only using the Search page. If you are using both, set this to `both`.
16///
17/// @example scss - Example usage for when only using the category page that disables all rounded corners.
18/// @use "@depict-ai/plp-styling" with (
19/// $border-radius: 0
20/// );
21/// @include plp-styling.default-theme("category");
22@mixin default-theme($scope) {
23 @include BaseStyle.BaseStyle();
24 .depict.plp {
25 @include BaseStyle.BaseStyle();
26 @include PLP.PLPResults();
27 @include PLP.ProductListingPage();
28 @include PLP.SelectedFilters();
29 @include PLP.ScrollStatus();
30 @include PLP.SortAndFilter();
31 @include PLP.SortAndFilterModal();
32 @include PLP.FloatingButtons();
33 // PrimaryButton gets added in BaseStyle because it's also needed for the recommendation grid
34 @include Buttons.SecondaryButton();
35 @include PLP.HighlightedText();
36 @include PLP.BreadCrumbs();
37 }
38 @if $scope != "category" {
39 // This is to get around shopify header max-width restrictions (for example in the Dawn theme)
40 body * > *:has(.depict-search-field-and-modal.nuke-mw) {
41 max-width: unset;
42 max-height: unset;
43 }
44 .depict.search {
45 @if variables.$search-modal-layout == "v2" {
46 @include search.TextSuggestions();
47 } @else if variables.$search-modal-layout == "classic" {
48 @include search.Autocomplete();
49 }
50 @include search.CategorySuggestions();
51 @include search.InstantResults();
52 @include search.InstantCard();
53 @include search.SearchField();
54 @include search.SearchModal();
55 @include search.SearchPage();
56 @include search.SearchRecommendations();
57 @include search.ShowingResultsFor();
58 @include search.ContentResults();
59 @if variables.$search-modal-layout == "v2" {
60 @include search.VisualListingSuggestions();
61 }
62 }
63 }
64 @if $scope != "search" {
65 .depict.category {
66 @include category.QuickLinks();
67 @include category.CategoryTitle();
68 @include category.CategoryPage();
69 }
70 }
71 @include PLP.Toast();
72 @include Placeholders.Placeholders();
73}
74
75/// Base styling for recommendations UI components (Slider and Grid).
76@mixin recommendations() {
77 @include BaseStyle.BaseStyle();
78 .depict.recommendations {
79 @include Recommendations.Recommendations();
80 }
81}