File tree 2 files changed +42
-1
lines changed
assets/scss/layouts/products
templates/components/products/options
2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,44 @@ $position_of_x : str-index($value_of_swatch_size, "x");
12
12
$first_value : str-slice ($value_of_swatch_size , 0 , $position_of_x - 1 );
13
13
$second_value : str-slice ($value_of_swatch_size , $position_of_x + 1 );
14
14
15
+ [data-product-attribute ] .form-option.form-option-swatch {
16
+ overflow : visible ;
17
+ }
18
+
15
19
.form-option-variant--color ,
16
20
.form-option-variant--pattern {
17
21
height : $second_value + " px" ;
18
22
width : $first_value + " px" ;
19
23
}
24
+
25
+ .form-option-expanded {
26
+ background-color : stencilColor (" body-bg" );
27
+ border : 1px solid stencilColor (" input-border-color-active" );
28
+ left : calc (100% + 55px );
29
+ opacity : 0 ;
30
+ padding : 3px ;
31
+ position : absolute ;
32
+ top : calc (100% + 5px );
33
+ transition : opacity 0.3s cubic-bezier (0.25 , 0.46 , 0.45 , 0.94 );
34
+ visibility : hidden ;
35
+ }
36
+
37
+ .form-option :hover {
38
+ .form-option-expanded {
39
+ opacity : 1 ;
40
+ transform : translate (-50% , 0 );
41
+ visibility : visible ;
42
+ z-index : 5000 ;
43
+ }
44
+ }
45
+
46
+ .form-option-image {
47
+ background : {
48
+ position : 50% ;
49
+ repeat : no-repeat ;
50
+ size : cover ;
51
+ }
52
+ display : block ;
53
+ height : 100px ;
54
+ width : 100px ;
55
+ }
Original file line number Diff line number Diff line change 10
10
11
11
{{#each this.values}}
12
12
< input class ="form-radio " type ="radio " name ="attribute[{{../id}}] " value ="{{id}} " id ="attribute_{{id}} " {{#if selected}}checked{{ /if}} {{#if ../required}}required{{/if}}>
13
- < label class ="form-option " for ="attribute_{{id}} " data-product-attribute-value ="{{id}} ">
13
+ < label class ="form-option form-option-swatch " for ="attribute_{{id}} " data-product-attribute-value ="{{id}} ">
14
14
{{#if image}}
15
15
< span class ='form-option-variant form-option-variant--pattern ' title ="{{this.label}} " style ="background-image: url('{{getImage image "swatch_option_size "}}');"> </ span >
16
16
{{/if}}
28
28
{{/if}}
29
29
{{/if}}
30
30
{{/if}}
31
+ {{#if pattern}}
32
+ < span class ="form-option-expanded ">
33
+ < span class ="form-option-image " style ="background-image: url('{{getImage image 'core-swatch'}}'); "> </ span >
34
+ </ span >
35
+ {{/if}}
31
36
</ label >
32
37
{{/each}}
33
38
</ div >
You can’t perform that action at this time.
0 commit comments