All Questions
190
questions
0
votes
0
answers
16
views
CSS Gradient Border Not Applied to Rounded Button [duplicate]
I'm trying to create an html button with a rounded gradient colored border. I am using react css modules. However, the gradient doesn't seem to be applied when both the secondary and rounded classes ...
0
votes
1
answer
131
views
Do CSS modules work with external libraries?
I am using a Slider library (https://react-slick.neostack.com/) in my React project.
When I use regular CSS, the slider can be styled correctly, but when using css module, it doesn't work.
The tsx ...
0
votes
0
answers
78
views
CSS from third-party library, using CSS modules, is loaded in after rendering in nextJS
I created a new nextJS (v14) project using the app. Most components and styling will be done by an external React component library which is installed with npm. This library is styled using CSS ...
2
votes
2
answers
804
views
vitejs treat all .scss files as css modules
I am working with a legacy package in a monorepo and am including in the optimizeDeps array - is it possible to tell Vite to treat all .scss files it sees as CSS Modules files?
Originally asked in ...
0
votes
1
answer
29
views
NavigationBar sub-menu is not clickable
My StackBlitz
https://stackblitz.com/edit/vitejs-vite-39yyir?file=src%2Fcomponents%2FHeader%2FNavigationBar.jsx
The problem.
Sub-menu is not clickable. As soon as you move the mouse, the menu ...
1
vote
0
answers
34
views
CSS styling overridden by another component
I have a React project and a page that has the following components:
return (
<div>
<ComponentA />
<ComponentB />
</div>
);
Both ComponentA and ComponentB ...
0
votes
1
answer
44
views
Using React components with css modules, is there a way to affect a parent component's child's class (a cousin once or twice removed) on hover?
Code layout is essentially as follows.
//ComponentA.tsx
import styles from './ComponentA.module.css'
<ComponentA className="styles.componentA">
<div className="styles....
0
votes
1
answer
1k
views
CSS Modules styling is blocked by CSP wihout unsafe-inline for style-src directive
I have a React app created with CRA and I'm using CSS modules to style the components.
I create CSS files with the .module.css prefix. Example: ComponentName.module.css
Afterwards I import the CSS ...
0
votes
1
answer
422
views
Why is css/ sass modules not working with third party library?
I wonder why my sass modules is not affected when I use third party component. In particular, I use react-horizontal-scrolling-menu
<ScrollMenu
selected={selected}
scrollToSelected={true}
...
0
votes
1
answer
574
views
How to apply word-wrap to ANTD Select title and dropdown items so that it changes the height of the element?
I want my ANTD title/selected item to go to the next row and modify the height of the Select.
I have worked on this example: https://codesandbox.io/s/basic-usage-antd-4-24-7-forked-8jzp29?file=/demo....
0
votes
2
answers
257
views
multiple conditions for styling with Css modules
I am trying to set multiple conditions with ternary operator to style an element using Css modules. I can't find the exact syntax. is it even possible?
there are some boxes that have 3 sizes , their ...
0
votes
0
answers
120
views
What is the most optimal way of using media queries for responsiveness if I am using single custom created styled component
I have defined this component, and I am using it everywhere in my project to avoid repetitive style definitions:
import React from "react";
import styled from "styled-components";
...
4
votes
2
answers
1k
views
CSS modules don't privatize element type selectors
I would like to make a CSS module index.module.css as follows which will be only used by App component :
.my-class {
color: red;
}
label {
color: blue;
}
In App.js I use import style from "....
1
vote
1
answer
101
views
Advanced Search and Replace for .module.css
I was using the conventional import './App.css' and just use className to effect the styling for my react application.
I structured my react app to have a dashboard view component that renders the ...
0
votes
1
answer
766
views
css styles not applied CSS Modules react
I am using react-scripts: 5.0.1 with module.css files where I have my styles. One of my style files looks something like this.
First I have to note that some module.css works fine. It seems the ...