Kevin Powell - Community

KPC

Kevin Powell - Community

A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.

Join

front-end

resources

back-end

ui-ux

os-and-tools

having trouble wrapping my head around mobile menus

hi all, i really love doing front end work, enjoy really getting into the gritty with SCSS, but my big road block is mobile menu design. I have watched videos from KP of course, and codewithsadee and for whatever reason I just blank when it comes time to implement my own. conceptually I understand that (in a mobile first context) i am structuring the nav items in a container, making an off screen nav and in JS targetting the off screen nav and placing it's zindex above all but scaling out into bigger sizes and implementing it overall on my own without just following someone for whatever reason throws me off. if anyone could advise on how they got comfortable and fluid with making these menus i would greatly appreciate any and all pointers!...

flow utility issue

Hey, If I have a div with another div as it's child both utilizing a flow utility with each of their flow-space custom properties having different values, setting a value for the custom property on the child div, aiming to create space for it's children, updates it's flow-space value in the primary div also, resulting in a larger/smaller space above it. What would be recommended to avoid this sort of behavior and allow this to work as expected? If i didn't explain the structure so well, here is what the html and css looks like: ```html <div class="flow">...

Need CSS help to create a container for a list of items (requirements below)

Hi all~ I've been trying to create a 2-column list container and am curious if anyone could come up a CSS solution for this. Requirements are to create a 2-column list container component that is given an object like this: { recipeCategory: "Breakfast", recipeTitleList: ["Avocado Toast", "Egg and Ham"] // alphabetically sorted startingPage: 1...
No description

align-content:center does not work!

Hi,why align-content :center; does not work in this css code? .parent{ background-color: gray; display:flex; flex-direction:row;...
No description

Using JS to redirect instead of anchor tag

```js function setCard(){ const main = document.querySelector("main"); for(let i = 0; i < projectData.length; i++){...

Display certain li elements in a single row

```html <div class="hamburguer"> <button><i class="fa-solid fa-bars"></i></button> <ul class="more"> <li><a class="info" href="#about">About</a></li>...
No description

Responsive columns

Hi, I thought I could quite easily make a layout where I have two columns in a grid, whereby the first column (which is wider) would shrink at a slower rate than the second column, and when there was no room left for the second column, it would just pop underneath. Basically this responsive layout, but with different rates of shrinking for the columns:...

Mouse hover animation

Hey guys, How are you?? I am trying to create a mouse effect like this https://www.alecbabala.com/?ref=godly. But I dont know from where to start. Any advices, tips or resources to check out?...

Is it advisable to start using CSS nesting?

When I code side projects I tend to follow the professional methods and I've been wondering if using CSS nesting is professional.

Is this how @apply works in tailwind?

I'm not a tailwind person but I recall seeing somewhere that there it has something called @apply, which might be something I have been wishing were possible in css for a long time. Namely, I would like to be able to say: ```css...

What code pattern/approach should I take for this numeric input?

Hey all, our UI/UX designer has come to me with a custom numeric input and I'm not sure what approach to take. (see Figma screen shot) I know semantically <input type="number" /> is how you make these in HTML traditionally, but it gives the tiny little spin up/down arrows and seems like we're off to a poor start for using CSS to mash a square peg into a round hole using webkit to target those arrows etc. I was thinking of making my own component (our tech stack is Blazor but it does the same thing as the major JS front end frameworks) with a bound integer value, and custom buttons and all of that but want to make sure I'm not losing a ton of accessibility features from not doing the numeric input control with the built in spin buttons. Also things like arrow keys up/down to increment/decrement the value. Set a min and max limit etc....
No description

SCSS color elements from data-attr

Hi All, I have an<svg> world map with countries grouped by 4 areas : data-region="". Each area <g> has several countries inside them as <path>. On hover, all area is turning blue.
On top of map, I have 4 buttons, with same data-region as in svg. ...

CSS how to select first element of consecutive same elements

Is it possible to select the first element of consecutive same elements and maybe change the background-color. Only the first element should be selected if there are multiple elements. If there is only one element it should also be selected. I prepared an example where I want to highlight all first p elements of consecutive p element sequences in the div. ...

Hi everyone,

I am following KP's tutorial on the Front-End Mentor product card challenge, but when I open the page in live server initially, the container containing the text is much wider than the image - would someone know what step I have missed here? Also, when I open the page with the 'toggle' button in the 'responsiveness view', I am unable to see the full width of the page (part of is is 'clipped'). Would someone be able to point me in the right direction so that I can fix these two issues please?...

css counter use cases

Hey, if there's a design such as the one in the image where there's a number incrementing depending on how many sections there are, in this case it would be the number in the milestone text. Would it be appropriate to use a css counter? Thanks in advance.
No description

Show picture on mouseenter

HI everybody I want achieve this
this is my work ...

background image transitions

Hey guys, i have a simple carousel that cycles through images whenever a button is clicked. One issue is, i'm unable to figure out why my images aren't performing a transition when switched from one to another. I'm using sveltekit with tailwind css here is how my script tag looks like: ```ts let currentImgPage = 0;...

How to keep tooltips inside the page?

So, I understand the basic principle of tooltips - you basically create the tooltip element next to the trigger element, and then you make it visible when the cursor passes over the trigger element. But if the trigger element is on the edge of the page, then the tooltip will be "outside". How can I avoid that? I'm so sorry for not using the proper technical terms, I'm only an occasional enjoyer 😅

Contain and scrollports

```html <div class="scrollport container"> I'm just a scrolling container. <div class="fixed-position">I'm completely off the page and do not contribute to the scrollable size of my parent. My margin doesn't do anything.</div> </div>...