Skip to content

Instantly share code, notes, and snippets.

@averydev
Created February 22, 2019 02:49
Show Gist options
  • Save averydev/a14db34626cb42db80c27102d8000e9e to your computer and use it in GitHub Desktop.
Save averydev/a14db34626cb42db80c27102d8000e9e to your computer and use it in GitHub Desktop.
export default () => {
let foo = [1,2,3]
let output = foo.map( f => `.rule-${f}: { border-width:${f}px;});
return output;
}
/** Result
* [".rule-1: { border-width: 1px };",
* ".rule-2: { border-width: 2px };"
* ".rule-3: { border-width: 1px };"]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment