Created
December 26, 2018 23:02
-
-
Save argyleink/9f9d8ce0e7d09f1788787b25b176d1fa to your computer and use it in GitHub Desktop.
css and js doing similar tasks
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
foo { | |
color: hsl(100,80%,75%); | |
background-color: hsl(100,20%,25%); | |
} | |
foo.map(styles => ({ | |
...styles, | |
color: 'hsl(100,80%,75%)', | |
background-color: 'hsl(100,20%,25%)', | |
})) | |
foo { | |
color: hsl(100,80%,75%); | |
background-color: hsl(100,20%,25%); | |
&.primary { | |
color: hotpink; | |
} | |
} | |
foo | |
.filter(node => | |
node.classList.contains('primary')) | |
.map(styles => ({ | |
...styles, | |
color: 'hotpink' | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment