score:0
you can have conditional css by using plain javascript. create a style element and append a cssrule. like this :
const usercolor = "green" //get from db of course
var style = document.createelement("style");
style.appendchild(document.createtextnode(""));
document.head.appendchild(style);
style.sheet.insertrule(".thirdpartydiv { color:"+usercolor+"; }", 0);
it will insert a styledomelement to your page. load the file when you start your app.
edit: doc - https://developer.mozilla.org/fr/docs/web/api/cssstylesheet/insertrule
Source: stackoverflow.com
Related Query
- Styling third party elements with React inline styles
- Setting a backgroundImage With React Inline Styles
- with react final-form why is meta.touched always false with third party components?
- Setting a dynamic backgroundImage With React inline styles
- How can we implement an Open with Postman button to open a postman collection link sent from a third party react application?
- Inline styling with React
- React with Svg vertical stacked barchart (no third party library)
- React: Flexbox using inline styles with react router
- How to create multiple empty elements inline with React
- Add text over images next to each other with react inline styles
- How do I apply my React styles inline with a ternary operator?
- React: style all elements with inline styles
- Include a third party script in a functional component of react with server side rendering
- How to force third party React components to follow styling rules?
- React inline styling with multiple inputs
- How to change multiple style elements through React without using a third party library?
- REACT Cant convert my styling to inline styles
- Styling some parts of my React JSX rendered elements with CSS
- Using a third party SDK with React + Redux
- Using third party library with react js giving error
- Unable to get data of third party API with Token attached to it in react
- Using Hex colors with inline Styles with React from a graphQL query
- React inline styling not working on elements
- Webpack HMR with React and third party library
- How to apply global styles with CSS modules in a react app?
- !important inline styles in react
- Setting Complex react inline styles such as hover, active on react components such as button
- React pseudo selector inline styling
- React Native inline styles and performance
- Focusing div elements with React
More Query from same tag
- How to select parent components variant in styled components?
- How to prevent non-deterministic state updation in Redux?
- Material ui / typography and button on the same line
- React useEffect loop
- Reactjs, class component to hooks
- Array mapping is always not a function
- How to create dynamic meta tags from client side in react node js project?
- Submit Form Using React Redux
- Delete an item from an Array that is inside an object (redux/typescript/react)
- React JS - How do I pass variables (parameters) to the API URL?
- How to display/call the icons dynamically based on the array data in react
- How to hide AG-Grid once I click button to show some popup (modal)
- Using mern.io scaffolder tool - What is the .need method all about?
- How to bind React-csv with props which are empty initially?
- How to loop through validation errors from server
- Compute the parents state based on the data of the child components: ReactJS
- How to NOT delete existing translations with "react-intl-translations-manager"?
- Making webpack 5 asset loader work with webpack-dev-server
- In React how to get a property value of an object using another property value?
- React component type in TypeScript
- Trying to work with the mapping function and it keeps gives me this error?
- Sort the state (array of objects) by date in React
- React big-calendar events not loading
- react setState doesn't update array value by index
- React: get data after form submit using async/await
- From previous state version to hooks
- Dynamic Dropdown from Database
- Some of the tailwind classes doesn't apply
- React: getting value from state object by index
- React problem with array - component not loading?