HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/stafa/stafa.nl/resources/sass/site/5-Components/_components.hexShape.scss
/*
 * Hex shape (image):
 * Based on an 6x7 aspect ratio (480w x 560h)
 */

.c-hex-shape {
  display: inline-block;
  position: relative;
}

// Show decorative hexagon beside image when clip-path is supported
.c-hex-shape--ornament {
  @supports (clip-path: inset(50%)) {
    &::before {
      content: '';
      display: block;
      position: absolute;
      bottom: 25%;
      left: 0;
      width: percentage(10/25);
      height: percentage(10/25);
      background: linear-gradient(to top, palette(primary, 700), palette(primary, 500));
      transform: translate(-50%, 50%);
      clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    }

    &[data-pos~="right"] {
      &::before {
        right: 0;
        left: auto;
        transform: translate(50%, 50%);
      }
    }
  }
}

.c-hex-shape__image {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.c-hex-shape__image--heart {
  clip-path: polygon(50% 25%, 75% 12.5%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%, 25% 12.5%);
}