@justeattakeaway/pie-css 0.3.0 → 0.4.0

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.
package/README.md CHANGED
@@ -10,6 +10,117 @@
10
10
 
11
11
  # PIE CSS
12
12
 
13
- 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.
13
+ # Table of Contents
14
+
15
+ 1. [Introduction](#pie-css)
16
+ 2. [Installation](#installation)
17
+ 1. JS or Framework import (via bundler)
18
+ 2. NuxtJS
19
+ 3. Sass /SCSS
20
+ 4. Native HTML
21
+ 3. [Using the PIE CSS – SCSS helpers](#helpers)
22
+
23
+ ## Introduction
24
+
25
+ PIE CSS is 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.
14
26
 
15
27
  ---
28
+
29
+ ## Installing PIE CSS shared CSS styles
30
+
31
+ To install the PIE CSS library, run the following on your command line:
32
+
33
+ ```bash
34
+ # npm
35
+ npm i @justeattakeaway/pie-css
36
+
37
+ # yarn
38
+ yarn add @justeattakeaway/pie-css
39
+ ```
40
+
41
+ Once installed, how you include PIE CSS will largely depend on the type of application you are building (and your own preference), but here are a few examples.
42
+
43
+
44
+ ### JS or Framework import (via bundler)
45
+
46
+ One common way of importing PIE CSS would be through a regular JS import as part of your application bundle.
47
+
48
+ ```js
49
+ import '@justeattakeaway/pie-css';
50
+ ```
51
+
52
+
53
+ For example, in React (or NextJS), you could add the `pie-css` import to your `App.js` file:
54
+
55
+ ```js
56
+ import '@justeattakeaway/pie-css';
57
+
58
+ function App () {
59
+ return (
60
+
61
+ );
62
+ }
63
+
64
+ export default App;
65
+ ```
66
+
67
+ Similarly, in Vue 3, you will likely include it as part of your `/src/main.ts` file:
68
+
69
+
70
+ ```js
71
+ import { createApp } from 'vue';
72
+ import '@justeattakeaway/pie-css';
73
+ import App from './App.vue';
74
+
75
+ createApp(App).mount('#app');
76
+ ```
77
+
78
+ ### NuxtJS
79
+
80
+ If you are using NuxtJS, you can import PIE CSS in your `nuxt.config.js` file.
81
+
82
+
83
+ For NuxtJS v3, this would look like this:
84
+
85
+ ```js
86
+ // Nuxt v3
87
+ export default defineNuxtConfig({
88
+ css: ['@justeattakeaway/pie-css'],
89
+
90
+ });
91
+ ```
92
+
93
+ For NuxtJS v2, it is very similar, looking more like this:
94
+
95
+ ```js
96
+ export default {
97
+ css: [
98
+ '@justeattakeaway/pie-css',
99
+ ],
100
+
101
+ }
102
+ ```
103
+
104
+
105
+ ### Sass / SCSS
106
+
107
+ If you are using Sass, you could import the CSS file as part of your styles directly.
108
+
109
+ ```scss
110
+ @use 'node_modules/@justeattakeaway/pie-css/dist/index.css';
111
+ ```
112
+
113
+
114
+ ### Native HTML
115
+
116
+ Of course, you could include the styles straight inside your HTML document – most likely you'd want to link to the `/@justeattakeaway/pie-css/dist/index.css` CSS file in the head of your HTML.
117
+
118
+
119
+
120
+ ## Using the PIE CSS – SCSS helpers
121
+
122
+ PIE CSS also has an optional set of SCSS helpers that are used by the PIE Web Components.
123
+
124
+ These are for carrying out common tasks in our styles, such as setting font sizes in consistent ways and sharing styles across components via SCSS mixins and functions.
125
+
126
+ We will be writing more in-depth docs on these SCSS helpers shortly, but for now, feel free to browse the [SCSS code in the PIE mono-repo](https://github.com/justeattakeaway/pie/tree/main/packages/tools/pie-css/scss).
package/dist/index.css CHANGED
@@ -1,4 +1,4 @@
1
- :root, ::backdrop {
1
+ :root {
2
2
  /* Global tokens - Color */
3
3
  --dt-color-aubergine-10: #e7d6e7;
4
4
  --dt-color-aubergine-80: #452844;
@@ -75,6 +75,7 @@
75
75
  --dt-color-container-strong: var(--dt-color-mozzarella-20);
76
76
  --dt-color-container-dark: var(--dt-color-mozzarella-90);
77
77
  --dt-color-container-inverse: var(--dt-color-mozzarella-90);
78
+ --dt-color-container-inverse-alternative: var(--dt-color-mozzarella-90);
78
79
  --dt-color-border-default: var(--dt-color-mozzarella-20);
79
80
  --dt-color-border-subtle: var(--dt-color-mozzarella-10);
80
81
  --dt-color-border-strong: var(--dt-color-mozzarella-30);
@@ -158,6 +159,7 @@
158
159
  --dt-color-highcontrast-container-strong: var(--dt-color-white);
159
160
  --dt-color-highcontrast-container-dark: var(--dt-color-black);
160
161
  --dt-color-highcontrast-container-inverse: var(--dt-color-black);
162
+ --dt-color-highcontrast-container-inverse-alternative: var(--dt-color-black);
161
163
  --dt-color-highcontrast-border-default: var(--dt-color-black);
162
164
  --dt-color-highcontrast-border-subtle: var(--dt-color-black);
163
165
  --dt-color-highcontrast-border-strong: var(--dt-color-black);
@@ -241,6 +243,7 @@
241
243
  --dt-color-dark-container-strong: var(--dt-color-mozzarella-70);
242
244
  --dt-color-dark-container-dark: var(--dt-color-mozzarella-90);
243
245
  --dt-color-dark-container-inverse: var(--dt-color-white);
246
+ --dt-color-dark-container-inverse-alternative: var(--dt-color-mozzarella-70);
244
247
  --dt-color-dark-border-default: var(--dt-color-mozzarella-70);
245
248
  --dt-color-dark-border-subtle: var(--dt-color-mozzarella-75);
246
249
  --dt-color-dark-border-strong: var(--dt-color-mozzarella-60);
@@ -324,6 +327,7 @@
324
327
  --dt-color-highcontrast-dark-container-strong: var(--dt-color-black);
325
328
  --dt-color-highcontrast-dark-container-dark: var(--dt-color-black);
326
329
  --dt-color-highcontrast-dark-container-inverse: var(--dt-color-white);
330
+ --dt-color-highcontrast-dark-container-inverse-alternative: var(--dt-color-black);
327
331
  --dt-color-highcontrast-dark-border-default: var(--dt-color-white);
328
332
  --dt-color-highcontrast-dark-border-subtle: var(--dt-color-white);
329
333
  --dt-color-highcontrast-dark-border-strong: var(--dt-color-white);
@@ -655,7 +659,7 @@
655
659
  --dt-elevation-dark-inverse-04: var(--dt-elevation-box-shadow-04);
656
660
  --dt-elevation-dark-inverse-05: var(--dt-elevation-box-shadow-05);
657
661
  }
658
- :root, ::backdrop {
662
+ :root {
659
663
  --dt-color-aubergine-10-h: 300;
660
664
  --dt-color-aubergine-10-s: 26.2%;
661
665
  --dt-color-aubergine-10-l: 87.3%;
@@ -875,6 +879,9 @@
875
879
  --dt-color-container-inverse-h: var(--dt-color-mozzarella-90-h);
876
880
  --dt-color-container-inverse-s: var(--dt-color-mozzarella-90-s);
877
881
  --dt-color-container-inverse-l: var(--dt-color-mozzarella-90-l);
882
+ --dt-color-container-inverse-alternative-h: var(--dt-color-mozzarella-90-h);
883
+ --dt-color-container-inverse-alternative-s: var(--dt-color-mozzarella-90-s);
884
+ --dt-color-container-inverse-alternative-l: var(--dt-color-mozzarella-90-l);
878
885
  --dt-color-border-default-h: var(--dt-color-mozzarella-20-h);
879
886
  --dt-color-border-default-s: var(--dt-color-mozzarella-20-s);
880
887
  --dt-color-border-default-l: var(--dt-color-mozzarella-20-l);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-css",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
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
  "author": "JustEatTakeaway - Design System Web Team",
6
6
  "files": [
@@ -28,6 +28,7 @@
28
28
  "license": "Apache-2.0",
29
29
  "devDependencies": {
30
30
  "@types/postcss-import": "14.0.0",
31
+ "postcss": "8.4.29",
31
32
  "postcss-import": "15.1.0",
32
33
  "w3c-css-validator": "1.3.1"
33
34
  }
@@ -0,0 +1,9 @@
1
+ // Allows a grab handle to appear.
2
+ // Currently used in the card container component.
3
+ %has-grab-cursor {
4
+ cursor: grab;
5
+
6
+ &:active {
7
+ cursor: grabbing;
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ @forward './helpers';
package/scss/index.scss CHANGED
@@ -1,2 +1,3 @@
1
1
  @forward './mixins/';
2
2
  @forward './functions/';
3
+ @forward 'helpers';