Skip to content

Commit

Permalink
new test and minor fixes (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshdoesdev authored Oct 27, 2023
1 parent 35ed74d commit 2980af8
Show file tree
Hide file tree
Showing 3 changed files with 623 additions and 92 deletions.
18 changes: 9 additions & 9 deletions fastn-js/js/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ class Node2 {
const maskDarkImageString = maskDarkImageValues.join(", ");

if(maskLightImageString === maskDarkImageString) {
this.attachCss(propertyWithPrefix, maskLightImageString, false);
this.attachCss(propertyWithPrefix, maskLightImageString, true);
} else {
let lightClass = this.attachCss(propertyWithPrefix, maskLightImageString, true);
this.attachCss(propertyWithPrefix, maskDarkImageString, true, `body.dark .${lightClass}`);
Expand Down Expand Up @@ -1306,19 +1306,19 @@ class Node2 {
this.attachMaskSizeCss(value, vendorPrefix);
const maskRepeatValue = fastn_utils.getStaticValue(value.get("repeat"));
if(fastn_utils.isNull(maskRepeatValue)) {
this.attachCss("mask-repeat", maskRepeatValue);
this.attachCss("-webkit-mask-repeat", maskRepeatValue);
this.attachCss("mask-repeat", maskRepeatValue, true);
this.attachCss("-webkit-mask-repeat", maskRepeatValue, true);
} else {
this.attachCss("mask-repeat", maskRepeatValue);
this.attachCss("-webkit-mask-repeat", maskRepeatValue);
this.attachCss("mask-repeat", maskRepeatValue, true);
this.attachCss("-webkit-mask-repeat", maskRepeatValue, true);
}
const maskPositionValue = fastn_utils.getStaticValue(value.get("position"));
if(fastn_utils.isNull(maskPositionValue)) {
this.attachCss("mask-position", maskPositionValue);
this.attachCss("-webkit-mask-position", maskPositionValue);
this.attachCss("mask-position", maskPositionValue, true);
this.attachCss("-webkit-mask-position", maskPositionValue, true);
} else {
this.attachCss("mask-position", maskPositionValue);
this.attachCss("-webkit-mask-position", maskPositionValue);
this.attachCss("mask-position", maskPositionValue, true);
this.attachCss("-webkit-mask-position", maskPositionValue, true);
}
}
attachExternalCss(css) {
Expand Down
53 changes: 21 additions & 32 deletions ftd/t/js/68-mask.ftd
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
-- ftd.container:
background.solid: red
mask.image: https://mdn.github.io/css-examples/masking/star.svg
width.fixed.px: 300
height.fixed.px: 300

-- ftd.color red-orange:
light: red
dark: orange

-- ftd.color yellow-blue:
light: yellow
dark: blue

-- ftd.linear-gradient lg:
direction: bottom-left
colors: $color-values
-- ftd.mask-multi mi:
image: https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg
repeat: no-repeat
position: center
size: cover

-- ftd.linear-gradient-color list color-values:
-- component icon:
caption ftd.color color:

-- ftd.linear-gradient-color: $red-orange
stop-position.percent: 40
-- ftd.container:
background.solid: $icon.color
mask.multi: $mi
width.fixed.px: 48
height.fixed.px: 48

-- ftd.linear-gradient-color: $yellow-blue
-- end: icon

-- end: color-values
-- ftd.color list colors: red, orange, yellow, green, blue, indigo, violet, cyan, magenta, lime, olive, maroon, purple, white, #e5e5e5, #ccc, #b2b2b2, #999, #7f7f7f, #666, #4c4c4c, #333, #191919, black

-- ftd.row:
width: fill-container
align-content: center
wrap: true

-- ftd.mask-multi mi:
image: https://mdn.github.io/css-examples/masking/star.svg
size.fixed.rem: 2
repeat: no-repeat
position: center
-- icon: $color
for: $color in $colors

-- ftd.container:
background.solid: red
mask.multi: $mi
width.fixed.px: 300
height.fixed.px: 300
-- end: ftd.row
Loading

0 comments on commit 2980af8

Please sign in to comment.