Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self contained styles (+pptr) #387

Merged
merged 13 commits into from
Jan 7, 2019
Merged

Self contained styles (+pptr) #387

merged 13 commits into from
Jan 7, 2019

Conversation

montezume
Copy link
Contributor

@montezume montezume commented Jan 4, 2019

Summary

  • Adds pptr-testing-library), which allows us to do dom-testing-library (think RTL) style queries with puppeteer.
  • Encapsulates all styles (Closes Self-contained styles #185)
  • Bug fix: Text.Detail no longer "jumps" down when you set it to inline. (this lead to some tiny vrt diffs)

Copy link
Member

@emmenko emmenko left a comment

Choose a reason for hiding this comment

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

💯

@@ -9,24 +9,9 @@
html,
body {
color: var(--color-black);
font-family: 'Open Sans', sans-serif;
font-size: 13px;
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated but should we consider using rem for sizes instead of hard-coded pixels?

@@ -186,6 +186,7 @@
"postcss-preset-env": "6.5.0",
"postcss-reporter": "6.0.0",
"postcss-safe-parser": "4.0.1",
"pptr-testing-library": "0.3.1",
Copy link
Member

Choose a reason for hiding this comment

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

Nice 🎉

await expect(page).toMatch('A label text');
const doc = await getDocument(page);
const button = await getByLabelText(doc, 'A label text');
expect(button).toBeTruthy();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

feels a bit more like our style of testing 😆

Copy link
Contributor

@tdeekens tdeekens left a comment

Choose a reason for hiding this comment

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

Nice.

@montezume montezume self-assigned this Jan 4, 2019
Copy link
Contributor

@dferber90 dferber90 left a comment

Choose a reason for hiding this comment

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

pptr 🔥

body {
margin: 0;
padding: 0;
height: 100vh;
Copy link
Contributor

@dferber90 dferber90 Jan 4, 2019

Choose a reason for hiding this comment

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

Is this height: 100vh needed? As far as I remember it is something the MC needs which somehow ended up in ui-kit, but our playground should not need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure, I just added it so it looked the same as before 🤷‍♂️

@montezume
Copy link
Contributor Author

Going to do more encapsulate in this PR since I'm on a roll.

@montezume montezume added the 🚧 Status: WIP Work in progress label Jan 4, 2019
@@ -1,6 +1,5 @@
/* This is the entry point of the public package interface */

import '../materials/internals/reset.mod.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate how we can be sure that no app-code implicitly depends on these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😄

@montezume montezume changed the title feat: add pptr, encapsulate more styles Self contained styles (+pptr) Jan 4, 2019
@montezume montezume removed the 🚧 Status: WIP Work in progress label Jan 4, 2019
@montezume
Copy link
Contributor Author

Okay this is ready for review again 🗡

@montezume montezume merged commit fa2a1cd into master Jan 7, 2019
@montezume montezume deleted the ml-encap-styles branch January 7, 2019 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Self-contained styles
4 participants