Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive design using media queries

Ruben 210

@klabruben3

Desktop design screenshot for the Blog preview card coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

P

@scottyroges

Posted

Hi @klabruben3!

Replying here from your comment on my solution for a different challenge.

I am by no means a Vite expert and I imagine this is probably not the preferred way for any kind of production site, but the way I got this to work was to do the following:

  1. On your local machine run npm run build. This will take all your react code and compile it to js the browse can understand. It will produce a folder called dist which has the compiled code.
  2. In my vite.config.js I added the base property so that any urls to assets would be relative instead of absolute. (This might not be needed, but it was for me)
export default defineConfig({
  base: "",
  // other configs
});

3 In .gitignore I remove the line dist. This allows you to check in the dist folder when you commit you code. The annoying bit here is that to access your code you will need to go to {your handle}.github.io/{repo}/dist/index.html

Because this isn't a production site I felt this was good enough to get something that I could use for testing and to submit for a solution. But Vite actually has some documentation on how to do this properly using Github actions that is probably worth a read.

https://vitejs.dev/guide/static-deploy#github-pages

Hope this help!

  • @scottyroges

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord