Skip to content

Conversation

@kyledurand
Copy link
Member

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}

🎩 checklist

@kyledurand kyledurand self-assigned this Jun 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2022

size-limit report 📦

Path Size
cjs 154.14 KB (+0.06% 🔺)
esm 90.78 KB (+0.1% 🔺)
esnext 146.22 KB (+0.18% 🔺)
css 42 KB (+0.4% 🔺)

@kyledurand kyledurand force-pushed the cell_add-column-row-props branch from 8aa7c1a to fe3ebdb Compare June 7, 2022 13:21
@kyledurand kyledurand force-pushed the cell_add-column-row-props branch from fe3ebdb to 500e443 Compare June 7, 2022 13:27
@kyledurand kyledurand marked this pull request as ready for review June 8, 2022 15:04
Comment on lines +4 to +13
--pc-row-xs: initial;
--pc-row-sm: var(--pc-row-xs);
--pc-row-md: var(--pc-row-sm);
--pc-row-lg: var(--pc-row-md);
--pc-row-xl: var(--pc-row-lg);
--pc-column-xs: initial;
--pc-column-sm: var(--pc-column-xs);
--pc-column-md: var(--pc-column-sm);
--pc-column-lg: var(--pc-column-md);
--pc-column-xl: var(--pc-column-lg);
Copy link
Member

@alex-page alex-page Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is pretty confusing. Are we setting everything to initial? I don't see a lot of values in the --pc- approach here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's hard to understand at first but I think it's better than doing this even though that might be easier to understand?

It was @aaronccasanova 's suggestion and I liked it better than calling var() a ton of times in what is essentially just as hard to read css

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so you only have to set things like row, column, grid-template-areas at xs and lg as a minimum vs having to set them all. xs = 6 column, lg is where we switch to 12 and they cascade from a mobile up perspective

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-page See this comment and associated demo of the behavior:
#5966 (comment)

As Kyle mentioned, this enables the mobile first props strategy used throughout the component.
Before:

<Grid columns={{xs: 4, sm: 4, md: 4, lg: 6, xl: 6}} />

After:

<Grid columns={{xs: 4, lg: 6}} />

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we leave a little comment above this css that explains what it is doing. It makes sense to me but took a while to understand what is going on.

kyledurand and others added 2 commits June 9, 2022 09:36
Co-authored-by: Aaron Casanova <32409546+aaronccasanova@users.noreply.github.com>
@kyledurand kyledurand merged commit 4d4891b into main Jun 9, 2022
@kyledurand kyledurand deleted the cell_add-column-row-props branch June 9, 2022 14:19
@github-actions github-actions bot mentioned this pull request Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants