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

Add Thumb Label to Slider #976

Merged
merged 5 commits into from
Aug 12, 2016
Merged

Conversation

iveysaur
Copy link
Contributor

@iveysaur iveysaur commented Aug 9, 2016

Adds a thumb label (https://material.google.com/components/sliders.html#sliders-discrete-slider) to the slider. The thumb label is displayed when thumb-label is added to the slider. It will appear whenever the slider is active (a click or a slide).

R: @jelbourn @kara
CC: @hansl @robertmesserle

top: $md-slider-thumb-label-top;
width: $md-slider-thumb-label-width;
height: $md-slider-thumb-label-height;
border-radius: max($md-slider-thumb-label-height, $md-slider-thumb-label-width);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure what this line is doing. Will these ever not be equal? If so, how would we want this to look?

Copy link
Contributor

Choose a reason for hiding this comment

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

To clarify, your method would result in a sort of pill-shape when these values do not match. If this is desired, I think what you actually want is half of the smaller dimension: border-radius: min($md-slider-thumb-label-height, $md-slider-thumb-label-width) / 2. Your method will work too, but that's because the browser caps the border radius at this value.

If you wanted more of an oval shape, you can also simplify it to border-radius: 50%

@robertmesserle
Copy link
Contributor

LGTM, just a few minor comments

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 9, 2016
/** Whether or not to show the thumb label. */
@Input('thumb-label')
@BooleanFieldValue()
private _thumbLabel: boolean = false;
Copy link
Member

Choose a reason for hiding this comment

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

This can't be private if you're referencing it in a template when doing offline compile. Just remove the private and leave the underscore.

@iveysaur iveysaur force-pushed the slider-thumb-label branch from 3b78154 to 49c9391 Compare August 12, 2016 01:24
@iveysaur
Copy link
Contributor Author

@jelbourn: Addressed comments

@jelbourn
Copy link
Member

LGTM

@jelbourn jelbourn merged commit 22d70ae into angular:master Aug 12, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants