Skip to main content

All Questions

Tagged with
10,010 questions with no upvoted or accepted answers
11 votes
0 answers
641 views

AMP style amp-custom returns empty on HTML; results in validation error

I'm using AMP on NextJs and am trying to insert in my head tag. I managed to get it into the head tag but the rendered html returns an empty <style amp-custom></style> and instead ...
claireckc's user avatar
  • 415
11 votes
4 answers
7k views

How to import .scss files anywhere in Next.js app?

I want to convert pure React app to NextJs app. In React app I'm importing .scss CSS files in multiple places of components. Once I move the code into Next.js environment it is showing error: Gobal ...
Shiva's user avatar
  • 542
10 votes
0 answers
19k views

How to get colspan=2 in grid css layout?

In my react component I am trying (first time) to use a css grid layout. The column should span 2 but it is only 1: < Value textAlign="right" gridCol={1} gridRow={index + 3} weight={'regular'}&...
bier hier's user avatar
  • 22.1k
10 votes
1 answer
4k views

React-Stripe-Elements element not rendering style as expected

I'm trying to setup React-Stripe-Elements and while I was able to get the basic form to render, it does so in a really funky looking way. I even tried to add CSS from a form I found online and it won'...
Dog's user avatar
  • 2,828
10 votes
2 answers
5k views

Apply a class in a Framer Motion tag, animate or initial prop

How do I use a Framer Motion tag, and in the animate and initial props, Apply a class. Like so. <motion.div initial={{ className: 'hidden' }} animate={{ className: 'visible' }} > <div&...
Audad's user avatar
  • 123
9 votes
2 answers
3k views

Next.js only loads global.css after manual page refresh. Another also existing styles.js is ignored

As of now the styling happens in two places: global.css + index.js via styled-components Problem After start or restart of local server + manual page refresh, all styles are applied as intended. Also ...
Josh's user avatar
  • 145
9 votes
0 answers
4k views

You forgot to add 'mini-css-extract-plugin' plugin

I'm using mini-css-extract-plugin in my webpack, version 1.3.6 but when trying to run dev build getting the below error. css and scss both are in the app. ERROR in ./src/index.css Module build failed (...
manisha_manoj's user avatar
9 votes
0 answers
1k views

React-beautiful-dnd: Prevent page from scrolling when draggable is being dragged near edge of page

I'm using react-beautiful-dnd in a project and when I'm dragging a draggable, the page auto scrolls if I drag it near the top, bottom or sides of the page. I could theoretically fix this problem by ...
Brownie Cart's user avatar
9 votes
2 answers
5k views

ag-grid webpack css not making to the website

I am using ag-grid in my react app, cannot make the css work with webpack. grid is looking like this image: const path = require("path"); var webpack = require("webpack"); let HtmlWebpackPlugin = ...
johnny's user avatar
  • 2,112
9 votes
1 answer
2k views

Using mixins in material-ui to customize components in React

I am trying to customize a textfield component in Material-ui with React. According information from this page: To customize the colors of any part of the text-field, use the following mixins. We ...
Dawn17's user avatar
  • 8,207
9 votes
1 answer
3k views

In MUI v5, how do you debug/find a specific element/style/class in the dev tools DOM?

In MUI v4, it's very easy to inspect the DOM and isolate the exact component file and style block within that file: MUI v4 way of finding a specific element/style class However, in MUI v5, this is not ...
ReactDev's user avatar
  • 111
8 votes
0 answers
2k views

Change Color flowbite-react Tabs Component (Next js)

Hi can anyone help me on how to change the color of tabs in flowbite-react component, I'm using Next js. I already setup as per doc here https://flowbite.com/docs/getting-started/next-js/ Also I ...
Muhammad Haekal's user avatar
8 votes
3 answers
1k views

How to prevent nearby text selection when pressing and holding a button on mobile?

I have an application where a user needs to press and hold a button to record audio. However, when a user holds the button on mobile, the browser tries to select nearby text (since the user is holding ...
Jordan Lewallen's user avatar
8 votes
1 answer
3k views

Not able to import css files in react

In App.js I wanted to import App.css file or any css file. import './App.css' is not working here and giving error " ERROR in ./src/shared/App.css 1:0 Module parse failed: Unexpected token (1:0) ...
Pooja Pandey's user avatar
8 votes
1 answer
457 views

How to get warnings on undefined CSS variables

Trying to use CSS variables for the first time. Doing it in a react (create-react-app) application, and works great. Only issue is that there's no warnings if I mistype a variable name or just simply ...
Svish's user avatar
  • 156k
8 votes
1 answer
6k views

Closing a react bootstrap modal with escape key

I have 6 buttons which, when clicked, activate a modal. This is written in React. //Since I have 6 different modals, giving each of them an id would distinguish them onCloseModal(id) { this....
patrickhuang94's user avatar
7 votes
1 answer
2k views

Slider does not work in react-slick with typescript

I am using the typescript version (@types/react-slick) of the react-slick library to implement carousel/slider in a Nextjs project. I am getting the following error after importing the Slider ...
Bello Shehu's user avatar
7 votes
4 answers
9k views

Open and Close Dropdown menu on by mouse hover in react js

I am new to React JS. My problem is that I want the menu to disappear if the mouse leaves that area, so I tried onMouseOut and onMouseLeave to close the menu but it seems that when this option is ...
Durai DD's user avatar
  • 187
7 votes
0 answers
2k views

ReactJS - Refused to apply inline style because it violates the following Content Security Policy directive

I get the following error in the browser inspector (Chrome, Brave, Safari) when I load my ReactJS project in Production: Refused to apply inline style because it violates the following Content ...
Sergi Juanati's user avatar
7 votes
2 answers
10k views

'outlined' not working in Material UI Select

I am implementing Material UI `Select' for which values are coming from backend. Below is my code <FormControl variant="outlined" className={classes.formControl}> <InputLabel ref={...
Lara's user avatar
  • 2,971
7 votes
1 answer
3k views

Importing CSS from node_modules with Parcel

I am currently migrating as React project built with Webpack into Parcel as an experiment to see what the hype is all about. The project uses Reactstrap, which has Bootstrap as a dependency. I have a ...
Vidya's user avatar
  • 30.2k
7 votes
2 answers
6k views

Bottom Fixed div getting pushed up with android keyboard

I have a fixed div at the bottom, but in response view, in android, it gets pushed up with the keyboard. const ContactBackgroundImage = styled.div` color: white padding: 50px height: 118px ...
Nick Bb's user avatar
  • 601
7 votes
0 answers
1k views

Compilation Failure when Making a Production Build with create-react-app v2

Creating an optimized production build... Failed to compile. Lexical error on line 1: Unrecognized text. Erroneous area: 1: $progress-size - 2 * $border-size ^..^ I encounter the above compilation ...
Khoa Nguyen's user avatar
7 votes
0 answers
7k views

Properly pushing a Canvas with Material UI Persistent Drawers

I have an application with two expandable toolbars. The left toolbar functions as intended, but I have not been able to make the right toolbar push the content properly. See the code below. I copied ...
Seth Duncan's user avatar
  • 1,280
7 votes
1 answer
3k views

Keeping sticky positioning behaviour when sticky elements are inside a container (because of React having to render a single parent element)

I have a top section above some main content. The top section comprises 5 parts: a 'main header', 3 'categories', and 'settings'. Given the user scrolls down the page, the 'main header' stays sticky ...
alanbuchanan's user avatar
  • 4,153
7 votes
3 answers
2k views

Link stylesheet with media query to React component

In an html file it is possible to link stylesheets like this: <link rel="stylesheet" media="(min-width: 768px)" href="small.css"> <link rel="stylesheet" media="(min-width: 1150px)" ...
Sunny's user avatar
  • 155
7 votes
1 answer
3k views

Using css-loader inline with Webpack + React

I'm building my React app with Webpack, and css-loader w/modules. I love it. Most of my stylesheets are very small, though, and I'd like to inline them within the same JSX file as my markup and ...
user avatar
6 votes
0 answers
737 views

Virtual keyboard in Safari causes black space under app body and scrolling outside of it

I'm creating a chatbot app in React. It works fine on other browsers but on Safari whenever the virtual keyboard is open it causes the entire body to become draggable, the scrollbar extends way below ...
FlexboxFanatic's user avatar
6 votes
2 answers
1k views

javascript - How to start update scroll percentage when element is on the top of viewport

When entering the website, this is the first UI you'll see. Then, if you scroll down to the very beginning of section B I expect the section B will become sticky and the currentPercentage state will ...
CCCC's user avatar
  • 6,213
6 votes
4 answers
3k views

Make Tailwind Classes non-Global (automatically!)

I have an application made up of two parts: (A) legacy application (AngularJs) with its own CSS classes. (B) div containing a completely new application (React). B is built with webpack, postcss and ...
Domi's user avatar
  • 23.8k

15 30 50 per page
1
2 3 4 5
334