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

fix: use css imports instead of separate postcss processing of each file #159

Merged
merged 2 commits into from
Feb 22, 2021
Merged

fix: use css imports instead of separate postcss processing of each file #159

merged 2 commits into from
Feb 22, 2021

Conversation

Theiaz
Copy link
Contributor

@Theiaz Theiaz commented Feb 19, 2021

Description
Instead of merging css files by npm scripts a better way would be to use @import inside css files.

I've also unminimized the atom-one-dark.min.css, because it should be human readable. Minification should only be done for main.min.css files which is the only included css file.

Related issue(s)
fixes #157
fixes #158

This was referenced Feb 19, 2021
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@derberg derberg changed the title feat: use css imports fix: use css imports instead of separate postcss processing of each file Feb 19, 2021
@derberg
Copy link
Member

derberg commented Feb 19, 2021

@Theiaz
Copy link
Contributor Author

Theiaz commented Feb 20, 2021

Separate css file for tailwind styles like tailwind.min.css is not necessary. As you can see in main.min.css all the needed utility classes of tailwind are generated (like px-2, text-gray-100, ...).

This is because of the @tailwind base/components/utility directives inside main.css (see here). Tailwind scannes the css class declarations inside the html files. Files which needs to be be scanned are declared inside tailwind.config.js.

module.exports = {
  purge: ["./template/**/*.html", "./partials/**/*.html"], 
  ...
}

Tailwind then automatically wires the necessary style inside main.css. The resulting css file has the following structure:

/* atom-dark theme */
/* tailwind utility classes */
/* custom css declared after @tailwind utilities; */

@derberg
Copy link
Member

derberg commented Feb 22, 2021

@Theiaz perfect, thanks for the patience and detailed explanation 🙏🏼

@derberg derberg merged commit 742a164 into asyncapi:master Feb 22, 2021
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.18.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Theiaz Theiaz deleted the 158-use-css-imports branch February 22, 2021 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use css imports for merging css files 0.18.0 is missing hljs css
3 participants