@justeattakeaway/pie-css 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +33 -11
  2. package/dist/index.css +27 -0
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -10,16 +10,28 @@
10
10
 
11
11
  # PIE CSS
12
12
 
13
+ `pie-css` is a styling library that provides two distinct features:
14
+
15
+ 1. A minimal set of CSS styles to help PIE web components display as intended in web applications and providing our design tokens for applications to use.
16
+ 2. A set of SCSS style helpers (mixins, functions and variables) to help with common styling tasks when authoring PIE web components.
17
+
18
+ The PIE design tokens (and HSL colour variants) are exposed as CSS variables, as these variables are used across the PIE component styles and therefore need to be imported when using the PIE Web Components.
19
+
20
+
13
21
  # Table of Contents
14
22
 
15
- 1. [Introduction](#introduction)
16
- 2. [Installation](#installation)
17
- 3. [Using the `pie-css` CSS stylesheet in your web application](#using-the-pie-css-css-stylesheet-in-your-web-application)
23
+ 1. [Installation](#installation)
24
+ 2. [Using the `pie-css` CSS stylesheet in your web application](#using-the-pie-css-css-stylesheet-in-your-web-application)
18
25
  1. JS or Framework import (via bundler)
19
26
  2. Nuxt
20
27
  3. Sass /SCSS
21
28
  4. Native HTML
22
- 4. [What's included in the `pie-css` base stylesheet](#whats-included-in-the-pie-css-base-stylesheet)
29
+ 3. [What's included in the `pie-css` base stylesheet](#whats-included-in-the-pie-css-base-stylesheet)
30
+ 1. [PIE Design Tokens](#pie-design-tokens)
31
+ 2. [box-sizing](#box-sizing)
32
+ 3. [Typography](#typography)
33
+ 4. [z-index variables](#z-index-variables)
34
+ 5. [Reusable Animations](#reusable-animations)
23
35
  4. [Using the `pie-css` SCSS helpers (mixins & functions)](#using-the-pie-css-scss-helpers-mixins--functions)
24
36
  1. [Importing the `pie-css` SCSS helpers](#importing-the-pie-css-scss-helpers)
25
37
  2. [`pie-css` SCSS Helper Definitions](#pie-css-scss-helper-definitions)
@@ -29,13 +41,6 @@
29
41
  - [CSS](#css)
30
42
  - [SCSS](#scss)
31
43
 
32
- ## Introduction
33
-
34
- `pie-css` is a styling library that provides both a minimal set of CSS styles to help PIE Web Components display as intended on web applications, and a set of optional SCSS style helpers (mixins & functions) to help with common styling tasks.
35
-
36
- It also includes the PIE design tokens (and HSL colour variants) as CSS variables, as these variables are used across the PIE component styles and therefore need to be imported when using the PIE Web Components.
37
-
38
-
39
44
  ## Installation
40
45
 
41
46
  To install `pie-css`, run the following on your command line:
@@ -171,6 +176,7 @@ In most cases, a webpage should follow the DOM's natural stacking order and the
171
176
 
172
177
  | Token | Z-Index Value |
173
178
  | -------------------------- | ---------------|
179
+ | --dt-z-index-base: 1; | 1 |
174
180
  | --dt-z-index-dropdown | 1000 |
175
181
  | --dt-z-index-fab | 1000 |
176
182
  | --dt-z-index-tooltip | 2000 |
@@ -181,6 +187,22 @@ In most cases, a webpage should follow the DOM's natural stacking order and the
181
187
  | --dt-z-index-cookie-banner | 5000 |
182
188
  | --dt-z-index-toast | 6000 |
183
189
 
190
+ ### Reusable Animations
191
+
192
+ `pie-css` also ships with a set of reusable animations that can be applied to elements by adding a CSS class.
193
+
194
+ #### Slide Animation
195
+
196
+ | Class | Description |
197
+ | -------------------------- | ---------------|
198
+ | `.pie-animation--slide-in` | Slides an element in from the left. |
199
+ | `.pie-animation--slide-out`| Slides an element out to the left. |
200
+
201
+
202
+ **Customisation:**
203
+
204
+ The starting position of the slide animation can be customised by overriding the `--pie-animation-slide-translate-start` CSS variable. The default value is `-100%`.
205
+
184
206
  ---
185
207
 
186
208
  ## Using the `pie-css` SCSS helpers (mixins & functions)
package/dist/index.css CHANGED
@@ -2048,6 +2048,33 @@ html[data-highcontrast-enabled] {
2048
2048
  --dt-color-skeleton-shimmer-03-l: var(--dt-color-mozzarella-80-l);
2049
2049
  }
2050
2050
  }
2051
+ :root {
2052
+ --pie-animation-slide-translate-start: -100%;
2053
+ }
2054
+ .pie-animation--slide-in {
2055
+ animation: pie-animation-slide-in var(--dt-motion-timing-200) var(--dt-motion-easing-out);
2056
+ }
2057
+ .pie-animation--slide-out {
2058
+ animation: pie-animation-slide-out var(--dt-motion-timing-100) var(--dt-motion-easing-in);
2059
+ }
2060
+ @keyframes pie-animation-slide-in {
2061
+ from {
2062
+ transform: translate(var(--pie-animation-slide-translate-start));
2063
+ }
2064
+
2065
+ to {
2066
+ transform: translate(0);
2067
+ }
2068
+ }
2069
+ @keyframes pie-animation-slide-out {
2070
+ from {
2071
+ transform: translate(0);
2072
+ }
2073
+
2074
+ to {
2075
+ transform: translate(var(--pie-animation-slide-translate-start));
2076
+ }
2077
+ }
2051
2078
  html {
2052
2079
  box-sizing: border-box;
2053
2080
 
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-css",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "A styling library that provides both a shared collection of ready to use CSS styles to be used across JET web front-ends, and SCSS-based style helpers for our PIE Web Component library.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
8
8
  "directory": "packages/tools/pie-css"
9
9
  },
10
+ "homepage": "https://webc.pie.design/?path=/docs/additional-libraries-pie-css--docs",
10
11
  "author": "Just Eat Takeaway.com - Design System Team",
11
12
  "files": [
12
13
  "scss"
@@ -41,5 +42,8 @@
41
42
  "postcss": "8.4.32",
42
43
  "postcss-import": "15.1.0",
43
44
  "w3c-css-validator": "1.3.2"
45
+ },
46
+ "volta": {
47
+ "extends": "../../../package.json"
44
48
  }
45
49
  }