This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$unit: px | |
$points: 0,5,10 | |
@each $abbrs, $s in (-i:!important, '':'') | |
@each $pabbr, $p in (m:margin, p:padding) | |
@each $size in $points | |
@each $abbr,$name in (t:-top, b:-bottom, l:-left, r:-right, a:'') | |
.#{$pabbr}#{$abbr}-#{$size}#{$abbrs} | |
#{$p}#{$name}: $size#{$unit} #{$s} | |
@each $abbr, $a1, $a2 in (v,top,bottom),(h,left,right) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function useToggle(event = 'click') { | |
let ref = React.useRef(); | |
function close() { | |
// console.log('call close') | |
if(ref.current){ | |
ref.current.style.display = "none"; | |
} | |
document.removeEventListener(event, close); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function useToggle(event = 'click') { | |
let ref = React.useRef(); | |
function close() { | |
// console.log('call close') | |
if(ref.current){ | |
ref.current.style.display = "none"; | |
} | |
document.removeEventListener(event, close); |