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

How can I achieve this design in the hero section and have it responsive

I am a frontend developer and I have always admired the hero section design (on the left and right) l, the email, blog, website etc sections. I cannot think of a way to have it look like this on desktop and have it responsive for all screens. I usually style using TailwindCSS Would really appreciate all the help on how to achieve this...
No description

Grid question

Hello, I created to my mom a family tree website. It have a grid layout. Under 700px born, death, partnership, family going under each other: ```.born {...
No description

What's the best way to style 45 bevel corners?

Tried a few ways, but they mostly seem like hacks. Solution should achieve the following results: - consistent border width, even along angled corner - require only one div/class (no inner+outer containers) - use either the outline or border attribute...
No description

animation on every click

I am trying to create an animation for every dice roll, but it only occurs once and then stops. How can I fix this? https://codepen.io/etrbbr/pen/azoKQrx...

Font behaving different in browser

The same font family with the same size, and same height but renders different, one is in Figma, and second is in the browser
No description

Horizontal Scroll Snapping with Framer Motion

Hello! I'm following an example of a sticky horizontal scroll with NextJs and Framer Motion as a base to make something for my project https://www.hover.dev/components/carousels#horizontal-scroll-carousel here you can see the complete example code And here is a stackblitz I made for reference of my code:...

SASS and SCSS (.scss)

i got a question ive got introduced to sass but in the tutorials they use index.scss file but they keep calling it sass ,as far i know sass and scss are different which got me confused can someone explain it to me pls .

Override existing CCSS

Please don't mock me, but I'm using a wordpress page builder for the development of a family history website based around photographs of the family members. The backend uses Advanced Custom Fields for the data storage and data input. So I have number of forms gathering details of the photographs and the family members, these are generated by ACF and I have little control over the presentation of the forms. I can add IDs and Classes to the input fields but little else....

pinned element on scroll

hey, i've been trying to get this card pin scroll stack animation effect to work for a while now (hours) i was able to get somethings off the internet but that only worked for my mobile screen, tho it wasn't so smooth. but i've been having a hard time doing it on desktop screen
No description

Classes: private variables

Hey, i don’t really understand the use of private variables inside of classes e.g. #example. Mdn says that it means they can’t legally be referenced outside of the class but isn’t that the default behaviour anyway since it’s defined within the class scope? Thanks in advance...

Flex shrinking priority

In creating a webpage, I'd like for it to respond to display widths by overflowing in a specific way. This is my simplified HTML: <div class="container"> <span class="left">text inside the left span</span> <span class="right">text inside the right span</span>...

Is there something like `object-fit: contain` for non-replaced elements?

Hello Kevil Powell community! I'm a bit of a noob with HTML and CSS, but I'd really like to learn. Recently, I've been trying to create a centered div with an aspect ratio of 3 / 7 that fills its parent the best can, acting something like object-fit: contain. Unfortunately, object-fit: contain doesn't seem to work for non-replaced elements. Here's a visualization of what I want to achieve in Flutter, which is something I have slightly more experience in....

how to position arrows

https://codepen.io/etrbbr/pen/ZYzowKB Hello everyone! Could you please tell me how to position the arrows in the center of my div (image)?...

Positioning popver element

Hello, I am trying to use the popver api, but my problem is, that an element with the popover attribute positions itself differently. Example: https://jsfiddle.net/tjn592mk/2/ Notice how the popover is at the bottom of the page, but when you remove the popover attribute, it positions directly beneath the buttons, which is what I want to happen....

Promise questions

Hey, I have a couple questions about promises- 1) how does the promise object pass in the values to the resolve and reject parameters in const example = new Promise((resolve, reject) => {…})? I understand they are methods within the promise object so does that mean the function you pass in is a callback and that callback is used within the object somewhere and they pass them in via that? 2) I see people chain on promise methods to a function that returns a promise e.g. fetch(…).then(…). How is fetch for example able to use that promise method since it isn’t a promise object or assigned a promise object such as a variable? I understand it returns one but that doesn’t mean it’s equal to one right? Unless it does?...

tailwind setup issue

I am getting warning this when I setup simple react project with Vite project. why does this happen?
No description

What's the best way to build this layout responsively?

The text overlaps over the images, so I don't know how I should go about this... I don't yet have a mobile version, but I struggle figuring out the ideal way to make this layout shrink/wrap on smaller screen sizes. Should I use negative margins, absolute positioning (which I doubt) or something else that may be escaping me... And the backgound text, how would I get it to resize while still using position absolute to position it at the back?
No description

scss help I need help understanding something with functions

I have 4 files. all partials and I do this in my ```scss // _mixins.scss @mixin button-style($style) { background-color: map-get($style, background);...
Next