Latest solutions
Latest comments
- @JT1974@renras
I usually break the page down into components when the code gets too long as it's easier for me to manage. Usually my jsx has like a maximum 100 lines of code. But only the ui elements and others that will be re-used will be stored in the
components
folder. The other page components I just store it in a page folder likepages/home
so that you wouldn't have to deal with a lot of unnecessary components in thecomponents
folderMarked as helpful - @PaliTriesToDesign@renras
I was able to recreate what you were trying to do in this codepen: https://codepen.io/renras/pen/bGaZPJx,
Or you could just put them in a parent container and do
display: flex
instead of using the::after
approach.Marked as helpful - @muyiwa99@renras
- avoid setting fixed
width
for containers - try to use
max-width
,min-width
and percentages instead - try to make your flexbox and grid layouts responsive like :
.flex { display: flex; flex-wrap: wrap; .flex-children { flex: 1 1 0; } } .grid { grid-template-columns: repeat(4, auto); }
Marked as helpful - avoid setting fixed
- @misiucodes@renras
Try wrapping your
nav
inside adiv
and apply the positioning on that instead and addoverflow: hidden
on thenav
;<main style={{position: relative}}> <div style={{position: absolute}}> <nav style={{overflow: hidden}}></nav> </div> </main>
I successfully recreated the animation you're trying implement here in this codepen: https://codepen.io/renras/pen/XWVooXg
- @rawatdev@renras
You can make a separate
nav
for mobile and desktop and make use ofdisplay: none
. This will reduce complexities in your layout. Otherwise, make yourtransition
more specific by targeting only the property you want animated. - @Holymarz@renras
You can put your icons in a container like a button and put a hover effect on that container instead. It's also fine if icons don't have a hover effect, most sites are like that.
Regarding your question about the the menu, the easy way would be making a triangular div and place it above your menu. Here's a useful link: https://css-tricks.com/snippets/css/css-triangle/
I believe you can also make use of
clip-path
. It's more complex than the first option but actually worth learning as it provides more flexibility and is often used in complex layouts.https://developer.mozilla.org/en-US/docs/Web/CSS/clip-pathMarked as helpful