Skip to content

Conversation

@chazdean
Copy link
Contributor

WHY are these changes introduced?

Fixes #7285

WHAT is this pull request doing?

Adds ability for Tile to use breakpoints

Tile breakpoints example Description of what the gif shows

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

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

import {Page, Tile, Text} from '../src';

const styles = {
  background: 'var(--p-surface)',
  border: 'var(--p-border-base)',
  borderRadius: 'var(--p-border-radius-2)',
  padding: 'var(--p-space-4)',
};

export function Playground() {
  const children = Array.from(Array(10)).map((ele, index) => (
    <div key={index} style={styles}>
      <Text as="h2" variant="headingMd">
        Sales
      </Text>
      <Text as="p" variant="bodyMd">
        View a summary of your online store’s sales.
      </Text>
    </div>
  ));

  return (
    <Page title="Playground">
      <Tile columns={{xs: 2, sm: 3, md: 4, lg: 5, xl: 6}} gap={{xs: '2'}}>
        {children}
      </Tile>
    </Page>
  );
}

🎩 checklist

@chazdean
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @chazdean! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2022

size-limit report 📦

Path Size
polaris-react-cjs 204.85 KB (+0.07% 🔺)
polaris-react-esm 131.29 KB (+0.1% 🔺)
polaris-react-esnext 186.6 KB (+0.13% 🔺)
polaris-react-css 41.48 KB (+0.26% 🔺)

@chazdean chazdean self-assigned this Sep 27, 2022
@chazdean chazdean changed the title [WIP][Layout foundations] Add breakpoint configuration to Tile component [Layout foundations] Add breakpoint configuration to Tile component Sep 27, 2022
@chazdean chazdean marked this pull request as ready for review September 27, 2022 14:29
Copy link
Contributor

@laurkim laurkim left a comment

Choose a reason for hiding this comment

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

💯

@chazdean chazdean force-pushed the add-tile-breakpoints branch from 021e0eb to 92432bd Compare September 29, 2022 18:10
@chazdean chazdean merged commit 9c3910e into layout-foundations-prototype Sep 29, 2022
@chazdean chazdean deleted the add-tile-breakpoints branch September 29, 2022 18:39
laurkim pushed a commit that referenced this pull request Sep 30, 2022
…#7286)

<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes #7285  <!-- link to issue if one exists -->

<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?

Adds ability for `Tile` to use breakpoints

<details>
      <summary>Tile breakpoints example</summary>
<img
src="https://user-images.githubusercontent.com/59836805/192546149-89e03625-0d1f-433b-a756-b277df415c85.gif"
alt="Description of what the gif shows">
    </details>

<!--
  Summary of the changes committed.

Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.

If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:

    <details>
      <summary>Summary of your gif(s)</summary>
      <img src="..." alt="Description of what the gif shows">
    </details>
-->

<!-- ℹ️ Delete the following for small / trivial changes -->

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';

import {Page, Tile, Text} from '../src';

const styles = {
  background: 'var(--p-surface)',
  border: 'var(--p-border-base)',
  borderRadius: 'var(--p-border-radius-2)',
  padding: 'var(--p-space-4)',
};

export function Playground() {
  const children = Array.from(Array(10)).map((ele, index) => (
    <div key={index} style={styles}>
      <Text as="h2" variant="headingMd">
        Sales
      </Text>
      <Text as="p" variant="bodyMd">
        View a summary of your online store’s sales.
      </Text>
    </div>
  ));

  return (
    <Page title="Playground">
      <Tile columns={{xs: 2, sm: 3, md: 4, lg: 5, xl: 6}} gap={{xs: '2'}}>
        {children}
      </Tile>
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
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