Skip to content

Commit

Permalink
featured category theme (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomerford authored Jan 27, 2024
1 parent f5a4115 commit c6369b7
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 3 deletions.
78 changes: 78 additions & 0 deletions assets/scss/components/stencil/_customBlocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,82 @@
&-header {
text-align: center;
}

&.theme- {
&pink {
background-color: #fac6bc;
color: #e53a46;

.card-figure {
background-color: transparent;
}

.page-heading, .card-title > a {
color: #e53a46;
}
.card-text {
color: #550000;
}
}

&cream {
background-color: #f9ebcc;

.card-figure {
background-color: transparent;
}

.page-heading, .card-title > a {
color: #1d3557;
}
.card-text {
color: #1d3557;
}
}

&navy {
background-color: #1d3557;

.card-figure {
background-color: transparent;
}

.page-heading, .card-title > a {
color: #f9ebcc;
}
.card-text {
color: #f9ebcc;
}
}

&grey {
background-color: #e4e4e4;

.card-figure {
background-color: transparent;
}

.page-heading, .card-title > a {
color: #1d3557;
}
.card-text {
color: #1d3557;
}
}

&green {
background-color: #213429;

.card-figure {
background-color: transparent;
}

.page-heading, .card-title > a {
color: #f9ebcc;
}
.card-text {
color: #f9ebcc;
}
}
}
}
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,11 @@
"hoursHeading": "Holiday Hours",
"mwn_home_category_block": true,
"mwn_home_category_block_id": "439",
"features_dynamic_locations": true,
"mwn_home_category_block_region": "home_below_featured_products",
"mwn_home_category_block_heading": "For Your Sweetheart",
"mwn_home_category_block_limit": 12,
"mwn_home_category_block_theme": "default",
"features_dynamic_locations": true,
"mwn_global_cart_emoji": true,
"styled_nav_user_bg": "#314A6D",
"pdp_sale_badge_label": "Sale",
Expand Down
14 changes: 14 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,20 @@
{ "label": "Below new products", "value": "home_below_new_products" }
]
},
{
"type": "select",
"force_reload": true,
"label": "Featured category theme",
"id": "mwn_home_category_block_theme",
"options": [
{ "label": "Default", "value": "default" },
{ "label": "Pink", "value": "pink" },
{ "label": "Navy", "value": "navy" },
{ "label": "Cream", "value": "cream" },
{ "label": "Grey", "value": "grey" },
{ "label": "Green", "value": "green" }
]
},
{
"type": "text",
"force_reload": true,
Expand Down
2 changes: 1 addition & 1 deletion templates/components/category/featured-category-block.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="mwn-block mwn-block-product padding-vertical" data-category-id="{{id}}" data-category-url="{{url}}" id="category-product-{{id}}">
<div class="mwn-block mwn-block-product padding-vertical theme-{{theme}}" data-category-id="{{id}}" data-category-url="{{url}}" id="category-product-{{id}}">
<div class="loadingOverlay"></div>
<div class="container">
<div class="mwn-block-header">
Expand Down
7 changes: 6 additions & 1 deletion templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@
{{#if theme_settings.mwn_home_category_block}}
{{#if theme_settings.mwn_home_category_block_region '===' 'home_below_featured_products'}}
{{#filter categories theme_settings.mwn_home_category_block_id property="id"}}
{{> components/category/featured-category-block category=this heading=../theme_settings.mwn_home_category_block_heading description=../theme_settings.mwn_home_category_block_description }}
{{> components/category/featured-category-block
category=this
heading=../theme_settings.mwn_home_category_block_heading
description=../theme_settings.mwn_home_category_block_description
theme=../theme_settings.mwn_home_category_block_theme
}}
{{/filter}}
{{/if}}
{{/if}}
Expand Down

0 comments on commit c6369b7

Please sign in to comment.