Skip to content

Commit

Permalink
add version and license (#3255)
Browse files Browse the repository at this point in the history
* add current version & license

* generate fixtures

* update changelog

Co-authored-by: Adam Wathan <[email protected]>
  • Loading branch information
RobinMalfait and adamwathan committed May 7, 2021
1 parent 2c81a35 commit 7ad9a54
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Add version comment to Preflight ([#3255](https://github.com/tailwindlabs/tailwindcss/pull/3255))
- Ensure sourcemap input is deterministic when using `@apply` in Vue components ([#3356](https://github.com/tailwindlabs/tailwindcss/pull/3356))
- Ensure placeholder opacity is consistent across browsers ([#3308](https://github.com/tailwindlabs/tailwindcss/pull/3308))
- Add `cursor-help` by default ([#3199](https://github.com/tailwindlabs/tailwindcss/pull/3199))
Expand Down
2 changes: 2 additions & 0 deletions __tests__/fixtures/tailwind-output-flagged.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*! tailwindcss v2.0.2 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

/*
Expand Down
2 changes: 2 additions & 0 deletions __tests__/fixtures/tailwind-output-important.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*! tailwindcss v2.0.2 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

/*
Expand Down
2 changes: 2 additions & 0 deletions __tests__/fixtures/tailwind-output-no-color-opacity.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*! tailwindcss v2.0.2 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

/*
Expand Down
2 changes: 2 additions & 0 deletions __tests__/fixtures/tailwind-output.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*! tailwindcss v2.0.2 | MIT License | https://tailwindcss.com */

/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

/*
Expand Down
10 changes: 9 additions & 1 deletion src/plugins/preflight.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import fs from 'fs'
import postcss from 'postcss'
import packageJson from '../../package.json'

export default function () {
return function ({ addBase }) {
const normalizeStyles = postcss.parse(
fs.readFileSync(require.resolve('modern-normalize'), 'utf8')
)
const preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8'))
addBase([...normalizeStyles.nodes, ...preflightStyles.nodes])

addBase([
postcss.comment({
text: `! tailwindcss v${packageJson.version} | MIT License | https://tailwindcss.com`,
}),
...normalizeStyles.nodes,
...preflightStyles.nodes,
])
}
}

0 comments on commit 7ad9a54

Please sign in to comment.