I'm trying to deploy my tailwind site to Netlify. I've been able to deploy it but it only comes out as plain html, no css. My guess is that its because the styles.css is in a src folder but I'm not very sure.
I used tailwind without PostCSS so that could also be a problem.
Any help is appreciated;
Github: https://github.com/JojoDuke/Insure-LandingPage-Design
Site-preview: https://naughty-ptolemy-d0f425.netlify.app/
It looks like your link tags in your HTML aren't pointing to the same location as the output of your tailwindcss build command, causing the CSS to not be pulled through.
Try recloning your repo from scratch, and running the build command you put in your netlify settings, and seeing whether that generates the file in the right location, then update the HTML to match that location.
Related
I have been searching all over for information on where django-cms is storing the CSS and SCSS data for my site, which I am working on localhost. When I go to edit the CSS file directly, it has no effect, so I'm wondering what needs to be done to edit those CSS files. Obviously they have been loaded somewhere. How can they be reloaded, or in general what is the best practice for editing the CSS files?
Apparently I had to do this with both the style.scss and style.css files, which seem to have the same css classes. But even after editing both files, I had to refresh the site on my localhost a few times before I could see the changes. Frustrating, but it does work to edit the files directly in the static folder.
#Lawrence DeSouza At first you should mention which plugins and style frameworks you use.
If you are using some sort of a frontend framework like Bootstrap 4 your should compile its css from scss separately. You can do it right on the dev server in a separate directory outside your project dir and cloned from the official repository. Normally you would only need to change variables in "/bootstrap-4.x.y/scss/_variables.scss" file. On the next step you would compile your *.css files with "npm run dist" command and then copy compiled files from "/bootstrap-4.x.y/dist" directory to your "/projectname/appname/static/css" directory. The process is well-documented here. After copying changed files to your "static" folder you should run "python manage.py collectstatic" and refresh the page. If it's not working after refreshing the page in a browser (normally it should work) - restart the server. I am a bit biased towards Bootstrap, but the logic should be the same in your case.
I've recently deployed a project on Heroku and fixed most asset pipeline issues such that my stylesheets and javascript files work. However, I have one line of code in a css file that I thought would work based on documentation and other stackoverflow topics:
background-image: image-url("giphy.gif");
I got that line directly from another stackoverflow solution, given that my original code was simply url("giphy.gif"). Loading the page with either code gives me a 404 in the console. The project is structured like a rails app, so the app->assets folder has:
images
giphy.gif
stylesheets
javascript.
I've tried asset-url, image-url, url, "images/giphy.gif", "giphy.gif". Many iterations have been tried. I figure this should be a simple switch, but I'm not sure what I'm missing. Would appreciate all assistance! Thanks
Update:
Error message: GET https://herokuappname.herokuapp.com/assets/giphy.gif 404 (Not Found)
I even tried just moving the gif so that it lies in the assets folder instead of the images subfolder.
Try background-image: url('giphy.gif');
Background images declared in CSS must be in a .css.erb file, application.css.erb, for example.
I've found this syntax works:
background-image:url('<%= asset_path("giphy.gif") %> ');
But again, it must be in an .erb file in order to properly reference the asset pipeline.
Good luck.
Have you tried manually
heroku run rake assets:precompile
Then pushing again?
Is your master branch on git up to date? Have you pushed to git git push origin master, then git push heroku master
Just listing some things I would try
I need to add a favicon to the application website.
It works perfectly in dev environment with non minified css.
But as soon as I move to test environment, the added app/favicon.ico is failing compression of css and henceforth breaking UI.
I am using gulp and have a gulpfile.js in project, any clue what could be the issue.
I Guess you are using clean-css by using gulp plugin so the plugin handles writing the files and setting a path to file. clean-css does it but when you use the binary only, see: https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L123
So I compiled my SASS into one CSS file using codekit 2 on their own localhost and the website looks perfectly fine.
However when I upload my website onto a webserver (including all my SASS and CSS) it will not show some of my images. Then when I remove the SASS from my server leaving the compiles CSS it looses my fonts as well.
Does anyone know why is this?
Here is the website: http://bubbacue.nathanpatton.co.uk/
And the GitHub Repo for all the files: https://github.com/NathanPatton/Bubbacue
Your web host is generating a bunch of 403 Forbidden and 404 Not Found errors on the assets.
In Chrome, go to View, Developer, JavaScript Console and you'll see a list of the problem files and directories. Here is how to fix it.
While building large applications with meteor, we do face the regular problem of editing the stylesheets files. Once a file is edited, the whole application reloads which takes time each time a little change is made. A large project implicitly implies complex css files. For this reason I chosen to use the sass in order to structure them and be more efficient in the development processing. What I'm looking for is a workflow where I can change the .scss files in an editor and watch the result in real time in my meteor app.
Here is what you need (it looks fastidious but do not be afraid, it worth it):
Setup your project to externalise .css files
Meteor compiles all the .css files into one monolithic one, most of the css editors are not expecting this behaviour. For the development phase, I do recommend to use the traditional approach of including the stylesheet to the html page itself. to do so:
Create a public folder in the root of your meteor project: meteorProject/public
Add a css file into this folder: meteorProject/public/style.css
Import the stylesheet in your main html code <link rel="stylesheet" type="text/css" href="/style.css" />
What you did ? You created a public repository accessible through the path localhost:3000/ then you added the stylesheet style.css to this repository, that one became available through the relative path /style.css. By using this technique, meteor will not compile neither include by itself the stylesheet to your project, you just load it manually in the regular way using the link tag. Now it is time to configure an editor.
Now that the styles are imported the way they were 10 year ago, you can use compatible tools which will override the style to allow live editing. A simple one but only for css is the well known Espresso (formerly CSSEdit), open the page and override the styles… but that one is currently not supporting .scss files.
Editing .scss files in realtime with meteor:
To achieve this, you will need to use Sublime Text 2 or 3 as the editor, you can get it here: http://www.sublimetext.com/3 it is not free but there is no feature nor time restriction. So if you continue using it, just buy it to support the developers team.
You will need the awesome tool to allow the live edition which is takana, get it here: https://github.com/mechio/takana
That takana is freaking awesome! the concept is the following: Once installed and ran it will create a server interacting with the sublimetext editor, then you are requested to add a js snippet to your code so that the browser will get connected with the takana server and reload the .css or .scss files in realtime without having to reboot meteor.
To setup the meteor project with takana just do the following:
open the terminal
sudo npm install -g takana (enter your password if requested)
start takana in another terminal by providing it the absolute path of the meteorProject/public folder created above is might look something like: takana /Users/aUser/meteorProject/public
Add to your main html page the js snippet <script type="text/javascript" src="http://localhost:48626/takana.js"></script>
You are all set, now to use it
Start your meteor project in a second terminal. command meteor from the right path…
Open any browser to your meteor page i.e. probably http://localhost:3000
Open sublimetext, try editing your style.css file, the css changes are automatically displayed on the browser page without saving anything.
This is also working with .scss file. Just rename the style.css to style.css.scss and edit it within sublime text. Here the magic happen, you are editing a scss file with live result on a meteor application without having to reload anything.
Once you are satisfied with the result you can either compile the .scss to a .css file and add it the regular way to the project, or use the meteor .scss package which will do this for you at each restart. Note: Don't forget to remove the js and style snippet one to your code once in production.
Last but not least: you can open the project in several browsers and see them be refreshed in live while you edit the file in SublimeText, also it worked fine with Safari, FF but for some reasons I had to use "Google Chrome Canary" instead of "Chrome". Please comment if you made it work on other browsers such as IE, Opera or even if it worked with the regular "Chrome" on your computer.