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

max()

when i put this into the inline-size: max(var(--_calc), 100%), it overflows but if i just use in the max-inline-size var(—_calc) it works fine? selector is .slider-list. i want it to choose whichever is larger (i think...) so if there is room in the parent it will stretch out to fill the available space but otherwise just take up the room that is in the --_calc. i use min() often and i think this may be my first time using max() so i dont know what im doing wrong. please excuse the mess, im not done with the grid but this is driving me crazy. ...
No description

How to Develop a Google Docs-like Text Editor in React with Real-time Collaboration and ImageResize?

I am planning to develop a feature-rich text editor similar to Google Docs using React. I need the following features: * Real-time collaboration for multiple users with live cursors to show the cursor position of each user. * Image upload and resize functionality within the text editor. * Paged text editor to give the feel of pages similar to Google Docs....

svg queries

Hey, i have a few questions about how svgs behave regarding my codepen: 1. what causes the space underneath the svg? I've heard that svgs are inline-block/inline in some browsers however i've given it a display: block; and this still occurs. This disappears and appears when the svg is different widths. 2. in the second example what causes the svg to be a different height to the path adding extra space above it? ...

Tailwind CSS shadow classes

So in your experience, what are the most notable differences between the classes "drop-shadow-X" and "shadow-X". Something that I encounter is that with the drop-shadow it also creates a shadow for an inner container (You can see the shadows in the images)?...
No description

100vh on a grid

(Solution index and css files are here: https://github.com/TheOdinProject/css-exercises/tree/main/grid/03-grid-layout-3/solution) Hello, i added border-box to * element, height: 100vh to html, body element and height: 100% to container element in solution.css. But still, i have a small vertical scrolling and if i remove 4 px gap. The problem solved. So, does border-box behave differently here for gap in grid and how to fix it? And i know using fix height is not a good thing but, in this context should it be a problem that much? If answer is yes, how? Thank you for your answers....

grid item size when using fr in rows

Hey, if i'm not mistaken, when there's no specific height on a grid container and there are rows set using fr, each row is set to the height of the tallest child no matter the height of the content of the individual children. When i tell a child to span two rows, it distributes it's size between the two rows rather than doubling in size as it theoretically should. In the first image, before making it span two rows, at first glance it looks like the height of the card should be the size of the red outline however in the second image, after making it span two rows, it distributes itself between the two instead. Why is this it's behavior? I'd like to understand how all this stuff works in depth a little more, thanks in advance. https://codepen.io/deerCabin/pen/QWXbgpm...
No description

how to do this animation

https://www.instagram.com/reel/C7bSLL1gOk3/?igsh=MWo1ZTNrd3JwdnJ5aw== I saw this design and i like the opening animation so much , how can i do it ?...

Navbar Flexbox Issue

Hi everyone, I'm doing this exercise in this video https://www.youtube.com/watch?v=DB34becnGSA&list=PLkC56g8fboI0QgD6VvH5TN0Nm1i5dVITH&index=10 I tried to push myself not only follow along the video and copy the example code but try to implement by myself first. After my first try, I watched the video and studied the sample code to see what's the difference with mine and improve it. So my code structure is slightly different with the example. ...
No description

Px, em, or rem?

Hi there - I haven't decided which unit I should use... Do you recommend px, em, or rem? I've read several articles about this topic but they just go over my head... Basically my question is: why shouldn't I use em for absolutely everything?

CSS Grid cell highlighting without HTML elements

Probably question for the experts, given the below JS fiddle, is there a way to create the border around each cell without creating any HTML elements in the grid container div? https://jsfiddle.net/jdwsv8ho/2/...

Inline style attribute nesting

Is it possible to somehow use nesting within an inline style, to get something like this to work?
<div style="width: 50px; height: 50px; background-color: red; transition: background-color 500ms; &:hover {background-color: blue;}"></div>
<div style="width: 50px; height: 50px; background-color: red; transition: background-color 500ms; &:hover {background-color: blue;}"></div>
...

Loading a WebApp with XCODE

I am not an xcode developer, but I am trying to use the WebView object in xcode to create an app which is literally just a browser instance of my webapp. I can't get it to scale correctly at all. Any help at all would be appreciated....

Arrays

Consider an example
const myArray = [1,'hi',true,{name:'socks'},[1,2]]
console.log(type of([1,2])) //object
console.log(myArray.isArray[1,2])//true
const myArray = [1,'hi',true,{name:'socks'},[1,2]]
console.log(type of([1,2])) //object
console.log(myArray.isArray[1,2])//true
What is the difference here in typeof and isArray can anyone pls help....

SOLVED: select element not respecting grid cell- heights gonna height

Edit: Heights will cause overflow have you heard?? 🤦🏻‍♀️ it can’t be a block size of 100% when it has a sibling taking half ##New Problem: i have html {color-scheme: dark } and if iset the select background-color to transparent, the dropdown is white and i cant see the options. is there a way to make the trigger button/box transparent but see the dropdown options? ...
No description

any one experts is responsiveness here and willing to help?

hi guys i have created a website that has a grid layout when i try its responsiveness to shrink the screen it works until it get to 954 width and it stop there the responsiveness, what is the problem with this?
No description

<div> spanning 2 sections with different backgrounds and container set in each.

I have one .container class in my CSS with max-width: 1400px property. Now I have a layout in which there are two different sections with 2 columns and the first column of first section is spanning 2 rows (refer the image). In the image the dashed line (---) is the .container with max-width. Now the issue with this layout is that I want background (gradient and image both) in the first section and white background in the second section. The red box in the design (i.e. the column that spans 2 rows) should adjust it's height if the content of the second section gets longer. I can easily achieve this layout using CSS Grid but how do I set the background of the first section?...
No description

Best practise @use @forward for deeply nested folder structure?

In a large C#/Blazor Wasm code base and a deeply nested sass folder structure, what is the best approach when transitioning from @import to @forward and @use? Working with Sass in a Blazor Wasm app the main.scss needs to reside outside the sass folder, because of the set up we have for sass:watch. We can call it global-main.scss. From the global-main.Scss there are then two other files (one for each project) that imports this global-main....

Does tailwind reset padding, margin, box-sizing?

Does tailwindCSS add these out of the box? I learned I should always add these styling to global css. After adding tailwind I added these to index.css but nothing happened. But I also didn't find in the code if it's added out of the box? ```css *, *::before,...