Skip to content

Commit

Permalink
Use background image with svg and mix-blend-mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Apr 22, 2021
1 parent 4ca3b5c commit b27149a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 44 deletions.
2 changes: 1 addition & 1 deletion quadrat/assets/rotated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions quadrat/assets/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 13 additions & 37 deletions quadrat/sass/blocks/_cover.scss
Original file line number Diff line number Diff line change
@@ -1,40 +1,16 @@
.is-style-quadrat-cover-diamond{

&,
&.wp-block-cover-image.has-background-dim,
&.wp-block-cover.has-background-dim {

&:before {
background: #000;
width: 280px;
height: 280px;
margin: auto;
mix-blend-mode: soft-light;
transform: rotate(18deg);
// opacity: 1;
// z-index: 1;
// background-color: inherit;
// -webkit-mask-image: url(rotated.svg);
// -webkit-mask-size: contain;
// -webkit-mask-repeat: no-repeat;
// -webkit-mask-position: center;
// mask-image: url(rotated.svg);
// mask-size: contain;
// mask-repeat: no-repeat;
// mask-position: center;
// margin: auto;
}

&:after {
background-image: url(rotated.svg);
background-position: center;
background-repeat: no-repeat;
background-size: contain;
content: "";
mix-blend-mode: soft-light;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 0 !important; //this avoids weird interactions on the editor
}

// &:after {
// content: "";
// position: absolute;
// top: 0;
// left: 0;
// bottom: 0;
// right: 0;
// z-index: 0 !important; //this avoids weird interactions on the editor
// background-color: var(--wp--custom--color--background);
// }
}

0 comments on commit b27149a

Please sign in to comment.