Skip to content

Commit

Permalink
test: Share a function between blue and black
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Jul 25, 2022
1 parent e0402b8 commit 8c8bc43
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
13 changes: 6 additions & 7 deletions playground/css/async-modules-and-css/black.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import styles from './black.module.css'
import { makeText } from './make-text'
import './hotpink.css'
import styles from './black.module.css'

const div = document.createElement('div')
div.className = `base ${styles.black} async-modules-and-css-black`
document.body.appendChild(div)
div.textContent = `async css modules and normal css (black) ${
getComputedStyle(div).color
}`
makeText(
`hotpink ${styles.black} async-modules-and-css-black`,
'async css modules and normal css (black)'
)
11 changes: 5 additions & 6 deletions playground/css/async-modules-and-css/blue.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { makeText } from './make-text'
import './hotpink.css'
import styles from './blue.module.css'

const div = document.createElement('div')
div.className = `base ${styles.blue} async-modules-and-css-blue`
document.body.appendChild(div)
div.textContent = `async css modules and normal css (blue) ${
getComputedStyle(div).color
}`
makeText(
`hotpink ${styles.blue} async-modules-and-css-blue`,
'async css modules and normal css (blue)'
)
6 changes: 6 additions & 0 deletions playground/css/async-modules-and-css/make-text.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function makeText(className, content) {
const div = document.createElement('div')
div.className = `base hotpink ${className}`
document.body.appendChild(div)
div.textContent = `${content} ${getComputedStyle(div).color}`
}

0 comments on commit 8c8bc43

Please sign in to comment.