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

Commit

Permalink
Fix or remove lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jathak committed Jan 9, 2020
1 parent b7204e2 commit 81809c4
Show file tree
Hide file tree
Showing 56 changed files with 89 additions and 105 deletions.
14 changes: 5 additions & 9 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ plugins:
- stylelint-order
rules:
# Wrap lines greater than 120 characters
max-line-length: 120
max-line-length:
- 120
- ignorePattern: '/^@forward ".*"( as mdc-.*)? hide/'
# Override stylelint-config-standard - we only use CSS comments for annotations that don't warrant an empty line
comment-empty-line-before: null
# Follow best practices
Expand Down Expand Up @@ -236,11 +238,13 @@ rules:
- else
- error
- for
- forward
- function
- include
- if
- mixin
- return
- use
- warn
# Disallow "@extend" in scss.
# http://csswizardry.com/2016/02/mixins-better-for-performance/
Expand Down Expand Up @@ -313,14 +317,6 @@ rules:
- ^fieldset
- ^\[aria\-disabled=(?:.+)\]

# SCSS naming patterns, just like our CSS conventions above.
# (note for $-vars we use a leading underscore for "private" variables)
scss/dollar-variable-pattern:
- ^_?mdc-.+
-
ignore: local
scss/at-function-pattern: ^mdc-.+
scss/at-mixin-pattern: ^mdc-.+
# Prevents unneeded nesting selectors
scss/selector-no-redundant-nesting-selector: true
# Since leading underscores are not needed, they can be omitted
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"cross-env": "^5.0.0",
"css-loader": "^2.0.0",
"cssom": "^0.3.2",
"dart-sass": "^1.15.2",
"dart-sass": "^1.24.3",
"debounce": "^1.1.0",
"del": "^4.0.0",
"detect-port": "^1.2.3",
Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-button/mdc-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
@include mixins.theme-baseline;
2 changes: 0 additions & 2 deletions packages/mdc-card/mdc-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-checkbox/mdc-checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
//

@use "./mixins";

@forward "functions";
@forward "keyframes";
@forward "mixins";
@forward "variables";

@include mixins.core-styles;
6 changes: 5 additions & 1 deletion packages/mdc-chips/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,11 @@ $ripple-target: ".mdc-chip__ripple";
}
}

@mixin outline-width($width, $horizontal-padding: variables.$horizontal-padding, $query: feature-targeting-functions.all()) {
@mixin outline-width(
$width,
$horizontal-padding: variables.$horizontal-padding,
$query: feature-targeting-functions.all()
) {
$feat-structure: feature-targeting-functions.create-target($query, structure);

// Note: Adjust padding to maintain consistent width with non-outlined chips
Expand Down
6 changes: 5 additions & 1 deletion packages/mdc-chips/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
@use "@material/density/variables" as density-variables;
@use "@material/theme/variables" as theme-variables;

$fill-color-default: color.mix(theme-variables.prop-value(on-surface), theme-variables.prop-value(surface), 12%) !default;
$fill-color-default: color.mix(
theme-variables.prop-value(on-surface),
theme-variables.prop-value(surface),
12%
) !default;
$ink-color-default: rgba(theme-variables.prop-value(on-surface), .87) !default;
$horizontal-padding: 12px !default;
$height: 32px !default;
Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-chips/chip-set/mdc-chip-set.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "../mixins";

@forward "../mixins";
@forward "../variables";

@include mixins.set-core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-chips/chip/mdc-chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "../mixins";

@forward "../mixins";
@forward "../variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-data-table/mdc-data-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
@include mixins.theme-baseline;
2 changes: 0 additions & 2 deletions packages/mdc-dialog/mdc-dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-drawer/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-drawer/dismissible/mdc-drawer-dismissible.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "../mixins";

@forward "../mixins";
@forward "../variables";

@include mixins.dismissible-core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-drawer/modal/mdc-drawer-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "../mixins";

@forward "../mixins";
@forward "../variables";

@include mixins.modal-core-styles;
14 changes: 12 additions & 2 deletions packages/mdc-elevation/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@
/// @param {Number} [$height] - The height of the elevation overlay
/// @param {Boolean} [$has-content-sizing] - Set to false if the container has no content sizing
///
@mixin overlay-dimensions($width, $height: $width, $has-content-sizing: true, $query: feature-targeting-functions.all()) {
@mixin overlay-dimensions(
$width,
$height: $width,
$has-content-sizing: true,
$query: feature-targeting-functions.all()
) {
$feat-structure: feature-targeting-functions.create-target($query, structure);

@include overlay-selector_ {
Expand Down Expand Up @@ -170,7 +175,12 @@
// The $z-value must be between 0 and 24.
// If $color has an alpha channel, it will be ignored and overridden. To increase the opacity of the shadow, use
// $opacity-boost.
@mixin elevation($z-value, $color: variables.$baseline-color, $opacity-boost: 0, $query: feature-targeting-functions.all()) {
@mixin elevation(
$z-value,
$color: variables.$baseline-color,
$opacity-boost: 0,
$query: feature-targeting-functions.all()
) {
@if meta.type-of($z-value) != number or not math.is-unitless($z-value) {
@error "$z-value must be a unitless number, but received '#{$z-value}'";
}
Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-elevation/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
//

@use "./mixins";

@forward "functions";
@forward "mixins" hide elevation;
@forward "variables";

@include mixins.overlay-common;
2 changes: 0 additions & 2 deletions packages/mdc-elevation/mdc-elevation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
//

@use "./mixins";

@forward "functions";
@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-fab/mdc-fab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// THE SOFTWARE.

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
1 change: 0 additions & 1 deletion packages/mdc-floating-label/mdc-floating-label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

@use "@material/base/mixins" as base-mixins;
@use "./mixins";

@forward "mixins";
@forward "variables";

Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-form-field/mdc-form-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-grid-list/mdc-grid-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
7 changes: 6 additions & 1 deletion packages/mdc-icon-button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@
/// This mixin provides too much of low level customization.
/// Please use mdc-icon-button-size instead.
///
@mixin icon-size($width, $height: $width, $padding: math.max($width,$height)/2, $query: feature-targeting-functions.all()) {
@mixin icon-size(
$width,
$height: $width,
$padding: math.max($width,$height)/2,
$query: feature-targeting-functions.all()
) {
$feat-structure: feature-targeting-functions.create-target($query, structure);

@include feature-targeting-mixins.targets($feat-structure) {
Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-icon-button/mdc-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-image-list/mdc-image-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// THE SOFTWARE.

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
1 change: 0 additions & 1 deletion packages/mdc-layout-grid/mdc-layout-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
@use "sass:map";
@use "./variables";
@use "./mixins";

@forward "mixins";
@forward "variables";

Expand Down
1 change: 0 additions & 1 deletion packages/mdc-line-ripple/mdc-line-ripple.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

@use "@material/base/mixins" as base-mixins;
@use "./mixins";

@forward "functions";
@forward "mixins";

Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-linear-progress/mdc-linear-progress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
// THE SOFTWARE.

@use "./mixins";

@forward "keyframes";
@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-list/mdc-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// THE SOFTWARE.

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-menu-surface/mdc-menu-surface.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
2 changes: 0 additions & 2 deletions packages/mdc-menu/mdc-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//

@use "./mixins";

@forward "mixins";
@forward "variables";

@include mixins.core-styles;
1 change: 0 additions & 1 deletion packages/mdc-notched-outline/mdc-notched-outline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

@use "@material/base/mixins" as base-mixins;
@use "./mixins";

@forward "mixins";
@forward "variables";

Expand Down
2 changes: 0 additions & 2 deletions packages/mdc-radio/mdc-radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
//

@use "./mixins";

@forward "functions";
@forward "mixins";
@forward "variables";

@include mixins.core-styles;
6 changes: 5 additions & 1 deletion packages/mdc-ripple/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@
/// @param {map} $opacity-map - map specifying custom opacity of zero or more states
/// @param {bool} $has-nested-focusable-element - whether the component contains a focusable element in the root
///
@mixin states-opacities($opacity-map: (), $has-nested-focusable-element: false, $query: feature-targeting-functions.all()) {
@mixin states-opacities(
$opacity-map: (),
$has-nested-focusable-element: false,
$query: feature-targeting-functions.all()
) {
// Ensure sufficient specificity to override base state opacities
@if map.has-key($opacity-map, hover) {
@include states-hover-opacity(map.get($opacity-map, hover), $query: $query);
Expand Down
1 change: 0 additions & 1 deletion packages/mdc-ripple/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@
@forward "keyframes";
@forward "mixins";
@forward "variables";

@use "./mixins";
@include mixins.common;
1 change: 0 additions & 1 deletion packages/mdc-ripple/mdc-ripple.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
@forward "keyframes";
@forward "mixins";
@forward "variables";

@use "./mixins";
@include mixins.common;
@include mixins.core-styles;
Loading

0 comments on commit 81809c4

Please sign in to comment.