Code Sandbox style is different than Chrome style - css

I tested a React app design using css and bootstrap in Code Sandbox (online editor).
The problem is, when I copied the files to a real react app in my computer, the page styling is different than what I designed in code Sandbox.
Is there anything missing I have to add to my code?
The style in Sandbox..
The style in my computer browser..

I found the solution.
The problem is when uploading the files from CodeSandBox, the css file has the line,
#import url("https://cdnjs.cloudflare.com/ajax/libs/meyer-
reset/2.0/reset.min.css");
removing it solved my problem.

Related

Material-ui - The style in local and production is different

I have had a big problem for some time now.
I'm working on ReactJS with Material-UI, I have a library (which I build with webpack) and then use it on my projects.
The problem is that in local or on StoryBook, the style renders perfectly well. But when the library is built and added to my project via my package.json my style does not apply.
I override the style directly on my css file and I don't go through withStyle/useStyle/makeStyle. I know this is the right way to do it but unfortunately the project was already like that when I got it back
On StoryBook:
And prod:
If anyone has a solution or has seen this somewhere?
Thanks

FOUC in NextJS using Tailwind Css

I have a FOUC on the production page of a site I'm working on using NextJS and TailwindCSS. It exists in varying degrees across browsers, but it seems to be worst on Desktop Firefox. You can view it here: Bretton Does Nails
From what I've found I may be able to fix it by configuring a _document.js file, but I'm not sure how to set that up to work with Tailwind specifically.
Does anyone have any suggestions of how to fix this or resources I can check out to figure out how to try the custom document?

Use of Ant Design Icons While Offline

I am working on a reactJS application that uses ant design for the UI. Recently we released this application to production where the computers are pretty locked down. This application is an intranet application and these computers have no internet access. So, because of that, the ant design icons on the modals were showing up as empty boxes. I did some digging and saw that the icons are using CSS classes.
For example, this is the CSS class for the red error "X" on the error modal:
.anticon-cross-circle:before
{
content:"\E62E"
}
I'm not too familiar with the CSS content attribute so I went to www.w3schools.com and read up on it a bit and tested this particular content value on their Try It page for this attribute and I got the empty box that I got in my production environment.
Does anyone know what needs to be done to import these icons into my project so that they can be used offline?
Thanks
What I think is happening is that Ant Design is defining the CSS font definition with a URL to the corresponding font-file. Since the computers are offline, it cannot find those definitions.
In the documentation I see that they also provide SVG Icons, which should work completely offline. I think this is worth a try. The steps to implement this can be found here and it should be available from version 3.9.0: https://ant.design/components/icon/#SVG-icons
Have you tried downloading the icon library into your project folder?
https://github.com/ant-design/ant-design-icons/tree/master/packages/icons-react. Looks like they have assigned their own codes to their own icons so you'll need to have them offline.
You will nessd the css file tabler-icons.css and the woff file tabler-icons.woff and assign a font-family named tabler-icons within your style.css using #font-face

rails and bootstrap - selectively/randomly works

I'm a beginner coder and am trying to integrate my css into my app. Using Rails 4 + Bootstrap 3.
I wrote out the html + css for the front-end of my app prior and it all worked fabulously. I moved everything to my folder and edited my V + C accordingly.
I have installed the bootstrap-sass gem successfully. Have updated my assets application and js. I have a .scss file importing bootstrap and my Google fonts.
Bootstrap, Bootstrap js, and Google fonts are working selectively/randomly on certain pages, but not fully on a page or they just don't work at all or they are there but all messed up now. (ex. modal not working on one page, but js element on another page works) I am trying to call the css files from where they are locally stored.
My questions:
1. Is there something I would need to edit to integrate the two in addition to the above?
2. Do I have to transition my css into another file?
3. If there is no easy way to fix this, should I just start over with my css?
Would appreciate any tips. Thanks!
A good starting point would be to check your sources under the inspector, to make the that the css and javascript are both being required. Also check the console for whether there are any javascript errors.
Assuming you are on google chrome, and on a mac, that would be cmd+alt+i, and ctrl+alt+i on windows.
You can also check which files are being included through checking page source by right clicking most parts of the page.
If they are being required and styles are not being applied then something else is probably getting in the way( i.e. bootstrap javascript files are being required twice, css is being overwritten because of load order, etc)

Phonegap xcode jquery mobile css dont load it

i installed phonegap on xcode and i create a new project. I included jquery mobile in my project but when i start it on the simulator it's not load the css files. When i open the same code in a Browser then it loads the css files of jquery mobile.
Thank you in advance!
The only way I've found to counter this is to include the styles as a <style> tag in the header of all of your HTML pages for the app.
There must be a better way, but I've never gotten linked CSS files to work properly.

Resources