Layout Grid
2K Views
51 Downloads - 8 API calls
30 Lines - 508 Bytes
Apr 23, 2020 design content interface
1 .gg-layout-grid { 2 transform: scale(var(--ggs,1 ))
3 } 4 5 .gg-layout-grid,
6 .gg-layout-grid::after ,
7 .gg-layout-grid::before { 8 box-sizing: border-box;
9 position: relative;
10 display: block;
11 width: 10px ;
12 height: 10px 13 } 14 15 .gg-layout-grid::after ,
16 .gg-layout-grid::before { 17 content: "";
18 position: absolute;
19 height: 4px ;
20 border-left: 4px solid;
21 border-right: 4px solid
22 } 23 24 .gg-layout-grid::before { 25 top: 0 26 } 27 28 .gg-layout-grid::after { 29 bottom: 0 30 }
1 <svg 2 width="24 " 3 height="24 " 4 viewBox="0 0 24 24 " 5 fill="none" 6 xmlns="http://www.w3 .org/2000 /svg" 7 > 8 <path d="M11 7 H7 V11 H11 V7 Z" fill="currentColor" /> 9 <path d="M11 13 H7 V17 H11 V13 Z" fill="currentColor" /> 10 <path d="M13 13 H17 V17 H13 V13 Z" fill="currentColor" /> 11 <path d="M17 7 H13 V11 H17 V7 Z" fill="currentColor" /> 12 </svg>
1 import React from 'react' 2 import styled from 'styled-components' 3 4 const StyledLayoutGrid = styled.i` 5 & { 6 transform: scale(var(--ggs, 1 ));7 } 8 &, 9 &::after , 10 &::before { 11 box-sizing: border-box;12 position: relative;13 display: block;14 width: 10px ;15 height: 10px ;16 } 17 &::after , 18 &::before { 19 content: '';20 position: absolute;21 height: 4px ;22 border-left: 4px solid;23 border-right: 4px solid;24 } 25 &::before { 26 top: 0 ;27 } 28 &::after { 29 bottom: 0 ;30 } 31 ` 32 33 export const LayoutGrid = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>( 34 (props, ref) => { 35 return ( 36 <> 37 <StyledLayoutGrid { ...props} ref={ ref} icon-role="layout-grid" /> 38 </> 39 ) 40 } , 41 ) 42
Layout Grid turned into a 100% CSS icon made by adopting attributes as follows: transform, width, height, border-left, border-right, .gg-layout-grid, Fun facts, it has: 30 Lines of code at 508b & 380b after compiling. Quite awesome 🙆♂️ don't you think ?.