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

fix(infrastructure): Ensure grid pattern renders correctly in IE #2729

Merged
merged 3 commits into from
May 16, 2018

Conversation

acdvorak
Copy link
Contributor

How to test

export CBT_USERNAME='...'
export CBT_AUTHKEY='...'
export MDC_GCLOUD_SERVICE_ACCOUNT_KEY_FILE_PATH='...'

npm run screenshot:build
npm run screenshot:test

echo '.mdc-button:not(:disabled){color:red}' >> packages/mdc-button/mdc-button.scss
echo '.mdc-button:disabled{margin-left:10px}' >> packages/mdc-button/mdc-button.scss
npm run screenshot:build
npm run screenshot:test -- --mdc-include-url=button/classes/ --mdc-include-browser=ie@11

What it does

  • Uses PNG background-image instead of linear-gradient
  • Adds Webpack loader base64-inline-loader to base64-encode data: URIs from background images in Sass

IE occasionally renders the linear-gradient version incorrectly, shifting it 1px to the left, which generates noisy, flaky diffs.

```bash
export CBT_USERNAME='...'
export CBT_AUTHKEY='...'
export MDC_GCLOUD_SERVICE_ACCOUNT_KEY_FILE_PATH='...'

npm run screenshot:build
npm run screenshot:test

echo '.mdc-button:not(:disabled){color:red}' >> packages/mdc-button/mdc-button.scss
echo '.mdc-button:disabled{margin-left:10px}' >> packages/mdc-button/mdc-button.scss
npm run screenshot:build
npm run screenshot:test -- --mdc-include-url=button/classes/ --mdc-include-browser=ie@11
```

- Uses PNG `background-image` instead of `linear-gradient`
- Adds Webpack loader `base64-inline-loader` to base64-encode `data:` URIs from background images in Sass

IE occasionally renders the `linear-gradient` version incorrectly, shifting it 1px to the left, which generates noisy, flaky diffs.
linear-gradient(to bottom, #{$test-ruler-color} 1px, transparent 1.01px); // fraction for IE 11

background-size: #{$test-ruler-granularity} #{$test-ruler-granularity};
background-image: url("images/ruler-grid.png");
Copy link
Contributor

Choose a reason for hiding this comment

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

Inline the base64 image so you can drop the b64 webpack dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - good call 😄

@codecov-io
Copy link

codecov-io commented May 10, 2018

Codecov Report

Merging #2729 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2729   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files          98       98           
  Lines        4230     4230           
  Branches      537      537           
=======================================
  Hits         4166     4166           
  Misses         64       64
Impacted Files Coverage Δ
packages/mdc-dialog/foundation.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fb2f5b...5e3fe27. Read the comment docs.

@acdvorak acdvorak merged commit 34f73e8 into master May 16, 2018
@acdvorak acdvorak deleted the fix/infra/ruler-grid-ie branch May 16, 2018 16:21
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