Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@astrojs/tailwind
Advanced tools
@astrojs/tailwind is an integration package for Astro that allows you to easily set up and use Tailwind CSS in your Astro projects. It simplifies the process of configuring Tailwind CSS with Astro, enabling you to quickly start styling your components with Tailwind's utility-first CSS framework.
Setup Tailwind CSS
This command installs the @astrojs/tailwind package along with Tailwind CSS, setting up the necessary dependencies for using Tailwind in your Astro project.
npm install @astrojs/tailwind tailwindcss
Add Tailwind Integration
This code snippet shows how to add the Tailwind integration to your Astro configuration file. By including `tailwind()` in the `integrations` array, you enable Tailwind CSS in your Astro project.
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
export default defineConfig({
integrations: [tailwind()]
});
Configure Tailwind
This is a basic Tailwind CSS configuration file (`tailwind.config.js`). It specifies the paths to all of your template files so Tailwind can tree-shake unused styles in production.
module.exports = {
content: ['./src/**/*.{astro,html,js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
};
The core Tailwind CSS package. It provides the utility-first CSS framework that you can use in any project, not just Astro. You need to manually configure it with your build tools.
PostCSS is a tool for transforming CSS with JavaScript plugins. Tailwind CSS itself is a PostCSS plugin. You can use PostCSS to add other plugins for additional functionality, but it requires more manual setup compared to @astrojs/tailwind.
A Vite plugin for integrating Windi CSS, which is a utility-first CSS framework similar to Tailwind CSS. It offers faster build times and a similar feature set, but is not specifically tailored for Astro.
This Astro integration brings Tailwind's utility CSS classes to every .astro
file and framework component in your project, along with support for the Tailwind configuration file.
Read the @astrojs/tailwind
docs
Get help in the Astro Discord. Post questions in our #support
forum, or visit our dedicated #dev
channel to discuss current development and more!
Check our Astro Integration Documentation for more on integrations.
Submit bug reports and feature requests as GitHub issues.
This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! These links will help you get started:
MIT
Copyright (c) 2023–present Astro
FAQs
Use Tailwind CSS to style your Astro site
The npm package @astrojs/tailwind receives a total of 115,304 weekly downloads. As such, @astrojs/tailwind popularity was classified as popular.
We found that @astrojs/tailwind demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.