content icon indicating copy to clipboard operation
content copied to clipboard

fix(css): elaborate how gap percentage values behave

Open OnkarRuikar opened this issue 1 year ago • 1 comments

  • fixes https://github.com/mdn/content/issues/24933

OnkarRuikar avatar Jun 08 '24 12:06 OnkarRuikar

Preview URLs

External URLs (1)

URL: /en-US/docs/Web/CSS/gap Title: gap

(comment last updated: 2024-07-04 04:09:53)

github-actions[bot] avatar Jun 08 '24 12:06 github-actions[bot]

It feels a little wonky to use 24px here instead of 20px as with the others. What do you think about this:

https://codepen.io/bsmth/pen/mdYNyJb

i.e.:

body > div {
  background-color: #ccc;
  width: 200px;
  height: 200px;
  flex-flow: column;
}

#grid {
  display: inline-grid;
  gap: 12.5%;
}

#flex {
  display: inline-flex;
  gap: 12.5%;
}

#grid > div,
#flex > div {
  background-color: coral;
  width: 20px;
  height: 20px;
}

Or with four items and some even values

<span>Grid</span>
<div id="grid">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>
<span>Flex</span>
<div id="flex">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>
body > div {
  background-color: #ccc;
  width: 200px;
  height: 200px;
  flex-flow: column;
}

#grid {
  display: inline-grid;
  gap: 20%;
}

#flex {
  display: inline-flex;
  gap: 20%;
}

#grid > div,
#flex > div {
  background-color: coral;
  width: 20px;
  height: 20px;
}

bsmth avatar Jul 01 '24 16:07 bsmth

It feels a little wonky to use 24px here instead of 20px as with the others. What do you think about this:

Yes, 20px is easy to explain.

OnkarRuikar avatar Jul 02 '24 10:07 OnkarRuikar

Yes, 20px is easy to explain.

Looks better!

bsmth avatar Jul 02 '24 12:07 bsmth

I'm so sorry for dragging out this review... I've read through the description again and it can do with a reword because it's already describing percentage values. This branch has a suggested edit: https://github.com/OnkarRuikar/content/compare/css_gap...bsmth:content:css_gap_description?expand=1

Then the paras have these functions:

## Description

* what it is 
* how it works / looks
* use in grid
* use in flex
* use in multi-col
* percentage values
* history

I'm happy to merge after this!

bsmth avatar Jul 03 '24 07:07 bsmth

I've read through the description again and it can do with a reword because it's already describing percentage values.

Yes, the text made sense when it was a separate section. Now in the description section, it looks repetitive.

I've done the changes.

OnkarRuikar avatar Jul 04 '24 04:07 OnkarRuikar