@@ -118,7 +118,10 @@ Add or remove rounded corners: `rounded-0` removes rounded corners, `rounded-1`
.rounded-1
-
+
.rounded-2
+
+ .circle
+
```
diff --git a/modules/primer-utilities/docs/margin.md b/modules/primer-utilities/docs/margin.md
index ed1447a205..7e8e61dde2 100644
--- a/modules/primer-utilities/docs/margin.md
+++ b/modules/primer-utilities/docs/margin.md
@@ -31,7 +31,7 @@ Since margin utilities have many variations and will be used in many places, we
_**Note:** The blue in the examples represents the element, and the orange represents the margin_
-## Uniform spacing
+## Uniform margins
Use uniform spacing utilities to apply equal margin to all sides of an element. These utilities can change or override default margins, and can be used with a spacing scale from 0-6.
@@ -59,7 +59,7 @@ Use uniform spacing utilities to apply equal margin to all sides of an element.
```
-## Directional spacing
+## Directional margins
Use directional utilities to apply margin to an individual side, or the X and Y axis of an element. Directional utilities can change or override default margins, and can be used with a spacing scale of 0-6.
diff --git a/modules/primer-utilities/docs/padding.md b/modules/primer-utilities/docs/padding.md
index 94289f01db..7395e25f5f 100644
--- a/modules/primer-utilities/docs/padding.md
+++ b/modules/primer-utilities/docs/padding.md
@@ -30,7 +30,7 @@ Since padding utilities have many variations and will be used in many places, we
_**Note:** The blue in the examples below represents the element, and the green represents the padding._
-## Uniform spacing
+## Uniform padding
Use uniform spacing utilities to apply equal padding to all sides of an element. These utilities can be used with a spacing scale from 0-6.
@@ -58,7 +58,7 @@ Use uniform spacing utilities to apply equal padding to all sides of an element.
```
-## Directional spacing
+## Directional padding
Use directional utilities to apply padding to an individual side, or the X and Y axis of an element. Directional utilities can change or override default padding, and can be used with a spacing scale of 0-6.
diff --git a/modules/primer-utilities/lib/animations.scss b/modules/primer-utilities/lib/animations.scss
index ef751cc884..6847c80cda 100644
--- a/modules/primer-utilities/lib/animations.scss
+++ b/modules/primer-utilities/lib/animations.scss
@@ -1,7 +1,7 @@
// This file contains reusable animations for github.
// stylelint-disable primer/selector-no-utility
-// Fade in
-// A class to fade in an element on the page.
+
+/* Fade in an element */
.anim-fade-in {
animation-name: fade-in;
animation-duration: 1s;
@@ -22,6 +22,27 @@
}
}
+/* Fade out an element */
+.anim-fade-out {
+ animation-name: fade-out;
+ animation-duration: 1s;
+ animation-timing-function: ease-out;
+
+ &.fast {
+ animation-duration: 0.3s;
+ }
+}
+
+@keyframes fade-out {
+ 0% {
+ opacity: 1;
+ }
+
+ 100% {
+ opacity: 0;
+ }
+}
+
/* Fade in and slide up an element */
.anim-fade-up {
opacity: 0;
@@ -151,3 +172,12 @@
transform: scale3d(1, 1, 1);
}
}
+
+/* Increase scale of an element on hover */
+.hover-grow {
+ transition: transform 0.3s;
+
+ &:hover {
+ transform: scale(1.025);
+ }
+}
diff --git a/modules/primer-utilities/lib/borders.scss b/modules/primer-utilities/lib/borders.scss
index ead6f66acf..ec68185f04 100644
--- a/modules/primer-utilities/lib/borders.scss
+++ b/modules/primer-utilities/lib/borders.scss
@@ -61,3 +61,5 @@
.rounded-1 { border-radius: $border-radius !important; }
/* Add a 2x border-radius to all corners */
.rounded-2 { border-radius: $border-radius * 2 !important; }
+/* Add a 50% border-radius to make something into a circle */
+.circle { border-radius: 50% !important; }
diff --git a/modules/primer-utilities/stories.js b/modules/primer-utilities/stories.js
new file mode 100644
index 0000000000..d0f0319de3
--- /dev/null
+++ b/modules/primer-utilities/stories.js
@@ -0,0 +1,14 @@
+import React from 'react'
+import { storiesOf } from '@storybook/react'
+
+storiesOf('Utilities', module)
+.add('hover-grow', () => (
+