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

Commit 4971637

Browse files
allan-chencopybara-github
authored andcommitted
docs(circular-progress): Add SassDocs
PiperOrigin-RevId: 300196133
1 parent 1db5c9f commit 4971637

File tree

4 files changed

+50
-10
lines changed

4 files changed

+50
-10
lines changed

packages/mdc-circular-progress/_keyframes.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@
2222

2323
@use "./variables";
2424

25+
/// Keyframes for the persistent rotation of the outermost container
26+
/// @access private
2527
@mixin container-rotate-keyframes_ {
2628
@keyframes mdc-circular-progress-container-rotate {
2729
to { transform: rotate(360deg); }
2830
}
2931
}
3032

33+
/// Keyframes for the rotation of the spinner layer
34+
/// @access private
3135
@mixin spinner-layer-rotate-keyframes_ {
3236
@keyframes mdc-circular-progress-spinner-layer-rotate {
3337
@for $i from 1 through 8 {
@@ -38,6 +42,9 @@
3842
}
3943
}
4044

45+
/// Keyframes for the fade-in and fade-out of the first color.
46+
/// .99 opacity is used to force subpixel rendering.
47+
/// @access private
4148
@mixin color-1-fade-in-out-keyframes_ {
4249
@keyframes mdc-circular-progress-color-1-fade-in-out {
4350
from { opacity: .99; }
@@ -49,6 +56,9 @@
4956
}
5057
}
5158

59+
/// Keyframes for the fade-in and fade-out of the second color.
60+
/// .99 opacity is used to force subpixel rendering.
61+
/// @access private
5262
@mixin color-2-fade-in-out-keyframes_ {
5363
@keyframes mdc-circular-progress-color-2-fade-in-out {
5464
from { opacity: 0; }
@@ -59,6 +69,9 @@
5969
}
6070
}
6171

72+
/// Keyframes for the fade-in and fade-out of the third color.
73+
/// .99 opacity is used to force subpixel rendering.
74+
/// @access private
6275
@mixin color-3-fade-in-out-keyframes_ {
6376
@keyframes mdc-circular-progress-color-3-fade-in-out {
6477
from { opacity: 0; }
@@ -69,6 +82,9 @@
6982
}
7083
}
7184

85+
/// Keyframes for the fade-in and fade-out of the fourth color.
86+
/// .99 opacity is used to force subpixel rendering.
87+
/// @access private
7288
@mixin color-4-fade-in-out-keyframes_ {
7389
@keyframes mdc-circular-progress-color-4-fade-in-out {
7490
from { opacity: 0; }
@@ -79,6 +95,9 @@
7995
}
8096
}
8197

98+
/// Keyframes for the expansion and contraction of the arc for the
99+
/// left semi-circle.
100+
/// @access private
82101
@mixin left-spin-keyframes_ {
83102
@keyframes mdc-circular-progress-left-spin {
84103
from { transform: rotate(265deg); }
@@ -87,6 +106,9 @@
87106
}
88107
}
89108

109+
/// Keyframes for the expansion and contraction of the arc for the
110+
/// right semi-circle.
111+
/// @access private
90112
@mixin right-spin-keyframes_ {
91113
@keyframes mdc-circular-progress-right-spin {
92114
from { transform: rotate(-265deg); }

packages/mdc-circular-progress/_mixins.scss

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2019 Google Inc.
2+
// Copyright 2020 Google Inc.
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
@@ -172,18 +172,27 @@
172172

173173
// Public mixins
174174

175+
/// Customizes the stroke-color of the indicator. Applies to the
176+
/// determinate variant, and also the indeterminate variant unless the
177+
/// four-color mixin is applied.
178+
/// @param {Color} $color - The desired stroke color.
179+
/// @see {mixin} indeterminate-colors
175180
@mixin color($color, $query: feature-targeting-functions.all()) {
176181
$feat-color: feature-targeting-functions.create-target($query, color);
177182

178183
.mdc-circular-progress__determinate-circle,
179184
.mdc-circular-progress__indeterminate-circle-graphic {
180-
181185
@include feature-targeting-mixins.targets($feat-color) {
182186
@include theme-mixins.prop("stroke", $color);
183187
}
184188
}
185189
}
186190

191+
/// Applies four animated stroke-colors to the indeterminate indicator.
192+
/// Applicable to the indeterminate variant only and overrides any single color
193+
/// currently set.
194+
/// @param {List} $colors - A list of four desired colors.
195+
/// @see {mixin} color
187196
@mixin indeterminate-colors($colors, $query: feature-targeting-functions.all()) {
188197
$feat-color: feature-targeting-functions.create-target($query, color);
189198

@@ -202,6 +211,11 @@
202211

203212
// Private mixins
204213

214+
/// Sets the container size of the indicator and the stroke width appropriate
215+
/// for the size according to Material Design guidelines. The dimensions are
216+
/// predefined for one of three discrete sizes listed below only.
217+
/// @param {String} $size - Choose from small, medium, or large.
218+
/// @access private
205219
@mixin size_($size, $query: feature-targeting-functions.all()) {
206220
$feat-structure: feature-targeting-functions.create-target($query, structure);
207221

@@ -226,6 +240,8 @@
226240
}
227241
}
228242

243+
/// Sets the animations for the indicator in indeterminate mode.
244+
/// @access private
229245
@mixin indeterminate-active-animations_($query: feature-targeting-functions.all()) {
230246
$feat-animation: feature-targeting-functions.create-target($query, animation);
231247

packages/mdc-circular-progress/_variables.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2019 Google Inc.
2+
// Copyright 2020 Google Inc.
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
@@ -20,6 +20,8 @@
2020
// THE SOFTWARE.
2121
//
2222

23+
$color: primary !default;
24+
2325
/// size parameters
2426
$default-size: large;
2527
$container-side-length: (
@@ -33,16 +35,16 @@ $stroke-width: (
3335
small: 2.5px,
3436
);
3537

36-
$color: primary !default;
37-
/// the rotation position of the arcs that corresponds to their fully contracted state
38+
/// The rotation position of the arcs that corresponds to their fully contracted state
3839
$base-angle: 135deg;
39-
/// amount of circle the arc takes up
40+
/// Amount of circle the arc takes up
4041
$arc-size: 270deg;
41-
/// time it takes to expand and contract arc
42+
/// Time it takes to expand and contract arc
4243
$arc-time: 1333ms;
43-
/// time for inactive indicator to disappear
44+
/// Time for inactive indicator to disappear
4445
$shrink-time: 400ms;
45-
/// how much the start location of the arc should rotate each time, 216 gives
46+
/// How much the start location of the arc should rotate each time; 216 gives
4647
/// us a 5 pointed star shape (it's 360/5 * 3)
4748
$arc-start-rotation-interval: 216deg;
49+
/// The timing function used for the core spinner animations.
4850
$timing-function: cubic-bezier(.4, 0, .2, 1);

packages/mdc-circular-progress/mdc-circular-progress.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2019 Google Inc.
2+
// Copyright 2020 Google Inc.
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)