Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version and license #3255

Merged
merged 4 commits into from Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,
])
}
}