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 <adam.wathan@gmail.com>
  • Loading branch information
RobinMalfait and adamwathan committed Jan 29, 2021
1 parent adfb49e commit 46a3300
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 46a3300

Please sign in to comment.