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

feat(shape): Added new Shape APIs #3541

Merged
merged 27 commits into from
Sep 20, 2018
Merged

feat(shape): Added new Shape APIs #3541

merged 27 commits into from
Sep 20, 2018

Conversation

abhiomkar
Copy link
Collaborator

@abhiomkar abhiomkar commented Sep 10, 2018

Previously on PR #3490

Fixes #3175

BREAKING CHANGE: The previous contents of the mdc-shape package have been removed and replaced with mixins implementing the Shape system. This system implements only rounded corners to provide a straightforward CSS-only solution.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@williamernest williamernest changed the base branch from feat/shape to master September 11, 2018 21:57
@williamernest williamernest changed the base branch from master to feat/shape September 11, 2018 21:57
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

@googlebot
Copy link

CLAs look good, thanks!

@function mdc-shape-prop-value($radius) {
@if type-of($radius) == "list" {
@if length($radius) > 4 {
@error "Invalid radius: '#{$radius}' radius is not supported";
Copy link
Contributor

Choose a reason for hiding this comment

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

This error message could be more specific for what it's being raised for

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

packages/mdc-shape/_variables.scss Show resolved Hide resolved
packages/mdc-shape/_functions.scss Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Sep 12, 2018

Codecov Report

❗ No coverage uploaded for pull request base (feat/shape@b0877d7). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             feat/shape    #3541   +/-   ##
=============================================
  Coverage              ?   98.41%           
=============================================
  Files                 ?      120           
  Lines                 ?     5036           
  Branches              ?      620           
=============================================
  Hits                  ?     4956           
  Misses                ?       80           
  Partials              ?        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 b0877d7...b55ee00. Read the comment docs.

@abhiomkar
Copy link
Collaborator Author

Updated this branch to support percentage value for $radius (Removed usage of pill everywhere). Throws error when percentage is used for dynamic height components.

packages/mdc-shape/_functions.scss Outdated Show resolved Hide resolved
@@ -36,74 +35,50 @@ applying angled corners to unelevated surfaces.
npm install @material/shape
```

## Basic Usage
## Usage
Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed offline: let's bring this back in line with the readme standards/template.

@mdc-web-bot
Copy link
Collaborator

All 389 screenshot tests passed for commit 3a3afc6 vs. feat/shape! 💯🎉

packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/_functions.scss Show resolved Hide resolved

@function mdc-shape-resolve-percentage-for-corner_($component-height, $radius) {
@if type-of($radius) == "number" and unit($radius) == "%" {
// Converts the percentage to number without unit. Example: 50% => 50.
Copy link
Contributor

Choose a reason for hiding this comment

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

My request for a comment here was to explain why this works, not what it's doing. Add another line here:

// This is accomplished by dividing the value by itself to cancel out units, while resulting in a denominator of 1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I feel documenting what this accomplishes is important than explaining implementation details. Developer would figure out how this works once he know what it does.

Copy link
Contributor

Choose a reason for hiding this comment

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

In general that's probably true, but this is basically taking advantage of specific Sass behavior to workaround what basically amounts to a missing API. I was able to surmise what it accomplished almost immediately, but it looked mysterious and took me a minute to rationalized why it worked. My request was to save others that minute.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved this to a private function so it won't clobber the code.

packages/mdc-shape/_functions.scss Outdated Show resolved Hide resolved
packages/mdc-shape/_functions.scss Outdated Show resolved Hide resolved
@mdc-web-bot
Copy link
Collaborator

All 389 screenshot tests passed for commit b3067cd vs. feat/shape! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 389 screenshot tests passed for commit b5dc384 vs. feat/shape! 💯🎉

packages/mdc-shape/README.md Outdated Show resolved Hide resolved
@mdc-web-bot
Copy link
Collaborator

All 389 screenshot tests passed for commit 6241ada vs. feat/shape! 💯🎉

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

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

Doc/format nits, otherwise LGTM

packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/README.md Outdated Show resolved Hide resolved
packages/mdc-shape/_functions.scss Outdated Show resolved Hide resolved
@mdc-web-bot
Copy link
Collaborator

All 389 screenshot tests passed for commit b55ee00 vs. feat/shape! 💯🎉

@abhiomkar abhiomkar merged commit 7658b03 into feat/shape Sep 20, 2018
@kfranqueiro kfranqueiro deleted the feat/shape_api branch October 8, 2018 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants