Skip to content

Instantly share code, notes, and snippets.

@captenmasin
Created July 4, 2022 10:04
Show Gist options
  • Save captenmasin/1c90e87c73af385496a6d8412fca0d65 to your computer and use it in GitHub Desktop.
Save captenmasin/1c90e87c73af385496a6d8412fca0d65 to your computer and use it in GitHub Desktop.
--------------------------
Tailwind.config.js
--------------------------
const colors = require('tailwindcss/colors')
const defaultTheme = require('tailwindcss/defaultTheme')
const colorVariable = require('@mertasan/tailwindcss-variables/colorVariable')
const defaultCustom = '#005aff'
module.exports = {
mode: 'jit',
content: [
'./resources/views/**/*.blade.php', './resources/js/**/*.vue'
],
darkMode: 'class',
theme: {
variables: {
DEFAULT: {
colors: {
custom: defaultCustom
},
}
},
extend: {
colors: {
custom: {
DEFAULT: colorVariable('--colors-custom')
},
...
plugins: [
require('@mertasan/tailwindcss-variables')({
colorVariables: true
}),
//etc etc
--------------------------
Item.blade.php
--------------------------
<div class="bg-custom" style="--colors-custom-rgb: 255, 0, 0">
This is now red
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment