Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

refactor(touchtarget): Rename mdc-touch-target-component => mdc-touch-target-margin. #5245

Merged
merged 1 commit into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mdc-button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ $mdc-button-ripple-target: ".mdc-button__ripple";
}

.mdc-button--touch {
@include mdc-touch-target-component(
@include mdc-touch-target-margin(
$component-height: $mdc-button-height, $query: $query);
}
// postcss-bem-linter: end
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-checkbox/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ $mdc-checkbox-ripple-target: ".mdc-checkbox__ripple";
}

.mdc-checkbox--touch {
@include mdc-touch-target-component(
@include mdc-touch-target-margin(
$component-height: $mdc-checkbox-ripple-size,
$component-width: $mdc-checkbox-ripple-size,
$query: $query);
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-chips/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ $mdc-chip-ripple-target: ".mdc-chip__ripple";
}

.mdc-chip--touch {
@include mdc-touch-target-component(
@include mdc-touch-target-margin(
$component-height: $mdc-chip-height, $query: $query);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-fab/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $mdc-fab-ripple-target: ".mdc-fab__ripple";
}

.mdc-fab--touch {
@include mdc-touch-target-component(
@include mdc-touch-target-margin(
$component-height: $mdc-fab-mini-height,
$component-width: $mdc-fab-mini-height,
$query: $query);
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-radio/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ $mdc-radio-ripple-target: ".mdc-radio__ripple";
}

&--touch {
@include mdc-touch-target-component(
@include mdc-touch-target-margin(
$component-height: $mdc-radio-ripple-size,
$component-width: $mdc-radio-ripple-size,
$query: $query);
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-touch-target/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ Mixin | Description
--- | ---
`mdc-touch-target-wrapper` | Applied to the wrapper touch target element.
`mdc-touch-target` | Applied to the inner touch target element.
`mdc-touch-target-component` | Applied to the component root element. Adds margin to compensate for the increased touch target.
`mdc-touch-target-margin` | Applied to the component root element. Adds margin to compensate for the increased touch target.
5 changes: 3 additions & 2 deletions packages/mdc-touch-target/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@
}
}

/// Styles applied to the component with the increased touch target.
@mixin mdc-touch-target-component($component-height, $component-width: null, $query: mdc-feature-all()) {
/// Applies margin to the component with the increased touch target,
/// to compensate for the touch target.
@mixin mdc-touch-target-margin($component-height, $component-width: null, $query: mdc-feature-all()) {
$feat-structure: mdc-feature-create-target($query, structure);

$vertical-margin-value: ($mdc-touch-target-height - $component-height) / 2;
Expand Down
2 changes: 1 addition & 1 deletion test/scss/_feature-targeting-test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
// Touch Target
@include mdc-touch-target-wrapper($query: $query);
@include mdc-touch-target($query: $query);
@include mdc-touch-target-component(0, $query: $query);
@include mdc-touch-target-margin(0, $query: $query);

// Typography
@include mdc-typography-core-styles($query: $query);
Expand Down