My Tailwind CSSV does not work after installation, no idea why it isnt working.
I followed all the steps exactly as per the docs.
No styles apply to any component and there are no error messages in the console.
Does Tailwind work with react scripts 4.0.3? I had to downgrade because react scripts 5.0.0 does not work with polyfills and that error seems unfixable.
My file sturucture:
index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
app.js
import React, { useState } from 'react'
import QrReader from "react-qr-scanner";
import base45 from 'base45'
import pako from 'pako'
import cbor from 'cbor'
import './index.css'
window.Buffer = window.Buffer || require("buffer").Buffer;
const App = () => {
const [showScanner, setShowScanner] = useState(false);
const [scanData, setScanData] = useState("Scan your Green Pass and your raw data will appear here")
const [decodedScanData, setDecodedScanData] = useState("Scan your Green Pass and decoded data will appear here")
const handleScan = (data) => {
if (data) {
setScanData(data.text);
//Take off HC1: from string and then decode from Base45 into compressed Bytes
const greenpassBody = data.text.substr(4);
const decodedData = base45.decode(greenpassBody);
setDecodedScanData(decodedData);
//Decompress into CBOR bytes
const decompressedData = pako.inflate(decodedData)
//COSE to CBOR to JSON
const cbordata = cbor.decodeAllSync(decompressedData)
const [headers1, headers2, cbor_data, signature] = cbordata[0].value;
const greenpassData = cbor.decodeAllSync(cbor_data)
const finalDataObject = greenpassData[0].get(-260).get(1)
}
}
return (
<div>
{showScanner ? (
<div>
<QrReader
delay={300}
onError={(e) => console.log(e)}
style={{ width: "50%" }}
onScan={(data) => handleScan(data)}
/>
<br />
<button
onClick={() => {
setShowScanner(false);
}}
>
<strong>Click to close QR Code Scanner</strong>
</button>
</div>
) : (
<div>
<button
onClick={() => {
setShowScanner(true);
}}
>
<strong>Click to open QR Code Scanner</strong>
</button>
</div>
)}
<h2>Here is the raw version of what your Green Pass looks like before decompression and decoding</h2>
{scanData}
<h2>Here is your decompressed Green Pass Data looks like in bytes</h2>
{decodedScanData}
<h2>Here are the full details encoded in your Green Pass</h2>
<h1 className="text-5xl red font-bold underline">
Hello world!
</h1>w
</div>
)
}
export default App