1.0.0 โ€ข Published 3 months ago

@bee-q/tailwindcss v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

BEEQ TailwindCSS Preset

BEEQ TailwindCSS is a preset that adds BEEQ's opinionated TailwindCSS configuration to your application.

Prerequisites ๐Ÿงฐ

Before starting to use BEEQ TailwindCSS, you need to have installed:

Make sure that Tailwind CSS directives are added to your main CSS file:

@tailwind base;
@tailwind components;
@tailwind utilities;

Installation ๐Ÿ“ฆ

npm i -D @bee-q/tailwindcss

Usage ๐Ÿš€

const beeqPreset = require('@bee-q/tailwindcss');

module.exports = {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  presets: [beeqPreset],
  ...
}

or with TypeScript:

import { default as beeqPreset } from '@bee-q/tailwindcss';

export default {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  presets: [beeqPreset],
  ...
}

CSS reset ๐Ÿงน

The preset includes a CSS reset that removes all the default browser styles. If you want to use your own reset, you can add your own CSS reset code to the @base layer of TailwindCSS:

@tailwind base;
@layer base {
  /* Your CSS reset code */
}
@tailwind components;
@tailwind utilities;

Fonts ๐Ÿ–‹

The preset does not include the fonts by default, but you can add them in your CSS entry file or use your own custom fonts:

/* BEEQ Outfit font */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100;300;400;600;700&display=swap");
/* ENDAVA Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap');

Typography ๐Ÿ“

The preset includes a typography plugin that adds a set of default typography styles to your application. It is not enabled by default, so you need to add it to your tailwind.config.js file:

const beeqPreset = require('@bee-q/tailwindcss');
const { TYPOGRAPHY_DEFAULT } = require('@bee-q/tailwindcss');

module.exports = {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  presets: [require('@bee-q/tailwindcss')],
  ...
  plugins: [
    plugin(function ({ addBase }) {
      // Use the default typography styles
      addBase({ ...TYPOGRAPHY_DEFAULT });
    }),
  ],
}

or via TypeScript:

import plugin from "tailwindcss/plugin";
import { default as beeqPreset, TYPOGRAPHY_DEFAULT } from "@bee-q/tailwindcss";
import type { Config } from "tailwindcss";

export default {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  presets: [beeqPreset],
  theme: {},
  plugins: [
    plugin(function ({ addBase }) {
      // Use the default typography styles
      addBase({ ...TYPOGRAPHY_DEFAULT });
    }),
  ],
  corePlugins: {
    preflight: false,
  },
} satisfies Config;

Note: you can always override this styles by adding your own CSS code to the @base layer of TailwindCSS.

Complete example

CodeSandbox

Documentation ๐Ÿ“™

Your can find more details about TailwindCSS presets in the official documentation.

1.0.0

3 months ago

0.13.0

3 months ago

0.12.0

3 months ago

0.11.0

4 months ago

0.10.0

6 months ago

0.6.0

6 months ago

0.5.0

6 months ago

0.4.0

6 months ago

0.3.0

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago