Skip to content

Commit

Permalink
add animation documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stacyk committed Sep 25, 2023
1 parent ec4f273 commit b23230b
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 11 deletions.
9 changes: 0 additions & 9 deletions src/sass/config/_animation.scss

This file was deleted.

4 changes: 4 additions & 0 deletions src/sass/config/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
*/
@use 'tools';
@use 'sass:meta';
@use 'animation/easing';
@use 'animation/times';
@use 'color/brand';
@use 'color/ui' as color-ui;
@use 'scale/ratio';
@use 'scale/layout';
@use 'scale/spacing';
@use 'scale/text';
@use 'scale/ui' as scale-ui;
@include tools.add-easing(meta.module-variables('easing'));
@include tools.add-times(meta.module-variables('times'));
@include tools.add-colors(meta.module-variables('brand'));
@include tools.add-colors(meta.module-variables('color-ui'));
@include tools.add-sizes(meta.module-variables('ratio'));
Expand Down
5 changes: 3 additions & 2 deletions src/sass/config/_tools.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@forward 'accoutrement/sass/tools' with (
$size-var-prefix: '',
$ratio-var-prefix: '',
$color-var-prefix: '',
$easing-var-prefix: '',
$ratio-var-prefix: '',
$size-var-prefix: '',
$time-var-prefix: ''
);
1 change: 1 addition & 0 deletions src/sass/config/animation/_easing.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$grow-in: cubic-bezier(0.175, 0.885, 0.32, 1.275);
39 changes: 39 additions & 0 deletions src/sass/config/animation/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@use 'sassdoc-theme-herman/scss/utilities' as herman;
@use '../tools';
@use 'easing';
@use 'times';
@use 'sass:meta';
@forward 'easing';
@forward 'times';

/// # Animation Config
/// Accoutrement maps for storing global animation tokens.
/// @link https://www.oddbird.net/accoutrement/docs/animate.html
/// Accoutrement Animate
/// @group animation

/// ## Easing
/// ---------
/// Named easings that can be re-used to create consistent movement.
/// @group animation
/// @example scss
/// @use 'config/animation/easing';
/// @use 'config/tools';
/// @use 'sass:meta';
///
/// @each $name, $easing in tools.compile-easing(meta.module-variables('easing')) {
/// /* #{$name}: #{$easing}; */
/// }

/// ## Times
/// ---------
/// Named times that can be re-used to create consistent motion timing.
/// @group animation
/// @example scss
/// @use 'config/animation/times';
/// @use 'config/tools';
/// @use 'sass:meta';
///
/// @each $name, $time in tools.compile-times(meta.module-variables('times')) {
/// /* #{$name}: #{$time}; */
/// }
2 changes: 2 additions & 0 deletions src/sass/config/animation/_times.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$fast: 300ms;
$slow: 1000ms;
1 change: 1 addition & 0 deletions src/sass/initial/_root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ html {
@include config.ratios--;
@include config.sizes--;
@include config.times--;
@include config.easing--;

font-size: config.size('rem');
line-height: config.ratio('line-height');
Expand Down
12 changes: 12 additions & 0 deletions src/sass/patterns/_animation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Animation Patterns
// ------------------
/// @group animation
@keyframes grow-in {
0% {
transform: scale(0);
}

25% {
transform: scale(1);
}
}
1 change: 1 addition & 0 deletions src/sass/patterns/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// ================

@forward 'a11y';
@forward 'animation';
@forward 'forms';
@forward 'buttons';
@forward 'icons';
Expand Down

0 comments on commit b23230b

Please sign in to comment.