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 #3490

Closed
wants to merge 0 commits into from
Closed

feat(shape): Added new Shape APIs #3490

wants to merge 0 commits into from

Conversation

abhiomkar
Copy link
Collaborator

No description provided.

@mdc-web-bot
Copy link
Collaborator

All 357 screenshot tests passed for commit 6c6ccc1 vs. master! 💯🎉

@kfranqueiro kfranqueiro self-assigned this Sep 7, 2018
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.

I don't think there's enough here to justify approving/merging yet. Moreover, I think we should keep this on a feature branch until we have updates for all components, so we avoid pushing a release without all components supported depending on how far we get with this by 0.40.0.

.mdc-shape-container__corner--bottom-left {
transform: rotate(-135deg);
}
// Nothing here ¯\_(ツ)_/¯
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there intended to be anything here eventually, or should we remove this file if it's going to be nothing but mixins?

If the latter, we might also need to make some tweaks to the package check script and the material-components-web package since there will be nothing to include to emit styles for shape.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed this file.

@import "@material/button/mixins";

.my-custom-button {
@include mdc-button-shape-radius(pill);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't actually exist in this branch, and I'm unsure OOC whether this is still how pill is expected to work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated README with relevant usage. PTAL.

@function mdc-shape-has-pill-radius($radius) {
@if type-of($radius) == "list" {
@each $corner in $radius {
@if $corner == pill {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does pill make sense at all in list format? Pill applies to both top/bottom corners of a side at once, typically...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pill just translates to component-height / 2 that is 50%. It is also possible for component to have curve on one side and sharp corners on remaining 3 sides.

$diagonal-length: $size * 1.4142135623730951;
@mixin mdc-shape-radius($radius, $rtl-reflexive: false) {
@if mdc-shape-has-pill-radius($radius) {
@error "Invalid radius: '#{$radius}' is not supported for this component";
Copy link
Contributor

Choose a reason for hiding this comment

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

How are we supporting pill? Currently it just unconditionally fails here. I'm a little confused since I vaguely recall seeing more to this in previous prototypes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This mixin accepts $radius which is absolute value only. Where as resolve-pill mixin accepts radius of absolute and literal.

Simplified this a bit in my following PR.

top: $outline-width;
border-bottom: $outline-width $outline-style $outline-color;
@mixin mdc-shape-flip-radius($radius) {
@if length($radius) == 4 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this also correctly support 2-3?

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.

@abhiomkar
Copy link
Collaborator Author

Moved this to feature branch. Please see PR #3541 for following changes.

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.

4 participants