This file contains hidden or 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
.userSummary { | |
/* element rules */ | |
&.--compact { | |
/* modifier rules */ | |
} | |
} | |
.image { | |
/* element rules */ |
This file contains hidden or 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
.image { | |
/* element rules */ | |
&.-loading { | |
/* state rules */ | |
} | |
&.-loaded { | |
/* state rules */ | |
} |
This file contains hidden or 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
/* vars.css */ | |
$off-black: hsl(0, 0%, 14%); | |
$serif-family: "Charter BT", "Times New Roman", serif; | |
/* component style.css */ | |
@import 'vars.css'; | |
.firstName { |
This file contains hidden or 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
<article styleName="userSummary --compact"> | |
<img styleName="image -loading" src="/low-res.jpg" /> | |
<div styleName="firstName">Mr. Jim</div> | |
<div styleName="lastName">Business</div> | |
</article> |
This file contains hidden or 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
/* type.css */ | |
@import 'vars.css'; | |
@define-mixin header { | |
font-family: $font-sans; | |
font-weight: 600; | |
letter-spacing: -0.01em; | |
} |
This file contains hidden or 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
<article styleName='userList'> | |
<h1 styleName='title'>Friends</h1> | |
<ul styleName='users'> | |
<li styleName='user'> | |
<UserPreview user={1} compact={true} /> | |
</li> | |
<li styleName='user'> | |
<UserPreview user={2} compact={true} /> | |
</li> | |
<li styleName='user'> |
This file contains hidden or 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
.userPreview { | |
border: 5px solid $off-black; | |
font-size: 1.5rem; | |
background: $light-gray; | |
&.--compact { | |
border: 1px solid $off-black; | |
font-size: 1rem; | |
background: transparent; | |
} |
This file contains hidden or 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
.userPreview { | |
border: solid $off-black; | |
&.--default { | |
border-width: 5px; | |
font-size: 1.5rem; | |
background: $light-gray; | |
} | |
&.--compact { |
This file contains hidden or 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
// Takes two strings. | |
// Returns true if they're anagrams, false if not. | |
function isAnagram (a, b) { | |
const remove = (string, pattern) => string.replace(new RegExp(pattern, 'ig'), ''); | |
// Discard whitespace; anagrams can be different numbers of words | |
let lettersA = remove(a, '\\s'); | |
let lettersB = remove(b, '\\s'); |
This file contains hidden or 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
#!/bin/bash | |
# Remove all settings in the .npmrc except the required auth token setting. | |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc | |
# Create a new .yarnrc that specifies the npm registry, or append to an existing one. | |
echo 'registry: https://registry.npmjs.org/' >> .yarnrc | |
# Remove and regenerate the yarn.lock. This should be identical to running `yarn upgrade`. | |
# If you are uncomfortable regenerating the yarn.lock file, you can comment out the next |