primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.79k stars 1.04k forks source link

Column: how to eliminate inline style for Column in data table to avoid CSP style-src unsafe-inline directive #4809

Closed bharatdixitibm closed 1 year ago

bharatdixitibm commented 1 year ago

Describe the bug

I have added styling in my ccm.module.css like this .columnCss { width: "25%"; }

and i'm using this in my module like this

import ccmStyle from '../style/ccm.module.css';

return (

onSelectionChange(e)} >

);

But css is not working, please help

Reproducer

No response

PrimeReact version

^9.5.0

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

melloware commented 1 year ago

Please provide a Code Sandbox minimal reproducer. Start with this one: https://stackblitz.com/edit/react-q1mrnn

bharatdixitibm commented 1 year ago

https://stackblitz.com/edit/react-q1mrnn-x4pzme?file=src%2FApp.js I have added the code

melloware commented 1 year ago

@bharatdixitibm you were doing it wrong. I fixed it: https://stackblitz.com/edit/react-q1mrnn-4cb1tl

Please see https://css-tricks.com/different-ways-to-write-css-in-react/ on how to use CSS Modules.