input-moment | React datetime picker powered by momentjs | Date Time Utils library
kandi X-RAY | input-moment Summary
kandi X-RAY | input-moment Summary
React datetime picker powered by momentjs
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of input-moment
input-moment Key Features
input-moment Examples and Code Snippets
Community Discussions
Trending Discussions on input-moment
QUESTION
I am trying to figure out how I get CSS to be successfully applied to components that I import from an npm library.
The core of my issue seems to be that I'm using css-loader as part of the react starter kit (https://github.com/kriasoft/react-starter-kit) and don't fully understand how it works.
I have looked at a couple of datepicker libraries - for example https://github.com/YouCanBookMe/react-datetime and https://github.com/wangzuo/input-moment.
In each case, the source code is applying local class names to the HTML. The formats that are embedded in the libraries aren't automatically applied. I've tried importing them manually from /node_modules in the component that uses the library component. I've also tried copying the relevant styles to a local css file and importing that.
The issue appears to be that css-loader is converting any imported styles class names to be module-specific class names which then don't match the actual class names in the resulting HTML.
Am I approaching this wrong? What's the preferred way to import components and apply custom styling to them?
Thanks!
...ANSWER
Answered 2018-Mar-01 at 21:42It appears all I needed to do was add :global() around the classnames in the css file. For example:
QUESTION
I have been trying to search on the topic but it seems that I might be using the wrong terms as I cannot find any information....
I am trying to get this package to work..(https://github.com/wangzuo/input-moment)
I have succeeded in getting the calendar to work, it saves the date, but it will not switch to the time tab and it also does not style correctly, even though I have imported the .less files into my react component.. the file looks like this...
...ANSWER
Answered 2017-Apr-11 at 13:04You probably aren't getting the styles provided by the package. If you used npm to install the package, then your import statement could look like this:
require('input-moment/dist/input-moment.css')
Also, compare your App.css to the CSS used by the package author in the example, which can be found at https://github.com/wangzuo/input-moment/blob/master/example/app.less, source is repeated below
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install input-moment
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page