@onereach/styles 0.1.1 → 0.1.3

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
@@ -1,13 +1,13 @@
1
1
  # 💅 Onereach styles for components.
2
2
 
3
3
  ## 🎯 Install
4
- ```
4
+ ```sh
5
5
  $ yarn add @onereach/styles
6
6
  $ npm install @onereach/styles --save
7
7
  ```
8
8
 
9
9
  ## 🛠️ Develop
10
- ```
10
+ ```sh
11
11
  $ npm run dev
12
12
  ```
13
13
 
@@ -15,32 +15,61 @@ $ npm run dev
15
15
  ### Don't forget that you need style loaders.
16
16
  #### Webpack: https://webpack.js.org/loaders/sass-loader
17
17
  ### Global styles:
18
- ```
18
+ ```js
19
19
  import '@onereach/styles';
20
- or
20
+ // or
21
21
  import '@onereach/styles/src/main.scss';
22
22
  ```
23
23
 
24
24
  ### Components (required: Global Styles):
25
- ```
25
+ ```js
26
26
  import '@onereach/styles/src/components/(base/modern/etc.)/component-name.scss';
27
27
  ```
28
- #### Vue SFC component. Example:
29
- ```
30
- <template>
31
- <span class="base-icon">
32
- <template v-if="icon">{{ icon }}</template>
33
- <slot v-else />
34
- </span>
35
- </template>
36
-
37
- <script lang="ts">
38
- import Vue from 'vue';
39
- export default /*#__PURE__*/ Vue.extend({});
28
+ #### Vue SFC
29
+ ```vue
30
+ <template>Template</template>
31
+
32
+ <script>
33
+ // with sass-loader
34
+ // import '@onereach/styles/src/components/base/icon.scss';
35
+
36
+ export default {};
40
37
  </script>
41
38
 
42
39
  <style lang="scss">
43
40
  @import "node_modules/@onereach/styles/src/components/base/icon";
44
41
  </style>
45
42
  ```
43
+ ```js
44
+ // example with js or ts files
45
+ import '@onereach/styles/src/components/base/icon.scss';
46
+
47
+ export default {
48
+ name: 'BaseHeading',
49
+
50
+ props: {
51
+ level: {
52
+ type: [String, Number],
53
+ default: 1
54
+ },
55
+
56
+ text: String
57
+ },
58
+
59
+ render (h) {
60
+ return h(
61
+ `h${this.level}`,
62
+ {
63
+ class: [
64
+ 'base-title',
65
+ `h${this.level}`
66
+ ],
67
+ domProps: {
68
+ innerHTML: this.text
69
+ }
70
+ }
71
+ )
72
+ }
73
+ }
74
+ ```
46
75
 
package/dist/index.css CHANGED
@@ -103,34 +103,34 @@
103
103
  --c-black-lighten-20: #333333;
104
104
  --c-black-darken-3: black;
105
105
  --c-black-darken-5: black;
106
- --c-neutral-6: #fff;
107
- --c-neutral-6-lighten-20: white;
108
- --c-neutral-6-darken-3: #f7f7f7;
109
- --c-neutral-6-darken-5: #f2f2f2;
110
- --c-neutral-5: #f6f6f6;
111
- --c-neutral-5-lighten-20: white;
112
- --c-neutral-5-darken-3: #eeeeee;
113
- --c-neutral-5-darken-5: #e9e9e9;
114
- --c-neutral-4: #dfdfdf;
115
- --c-neutral-4-lighten-20: white;
116
- --c-neutral-4-darken-3: #d7d7d7;
117
- --c-neutral-4-darken-5: #d2d2d2;
106
+ --c-neutral-0: #fff;
107
+ --c-neutral-0-lighten-20: white;
108
+ --c-neutral-0-darken-3: #f7f7f7;
109
+ --c-neutral-0-darken-5: #f2f2f2;
110
+ --c-neutral-1: #f6f6f6;
111
+ --c-neutral-1-lighten-20: white;
112
+ --c-neutral-1-darken-3: #eeeeee;
113
+ --c-neutral-1-darken-5: #e9e9e9;
114
+ --c-neutral-2: #dfdfdf;
115
+ --c-neutral-2-lighten-20: white;
116
+ --c-neutral-2-darken-3: #d7d7d7;
117
+ --c-neutral-2-darken-5: #d2d2d2;
118
118
  --c-neutral-3: #c6c6c6;
119
119
  --c-neutral-3-lighten-20: #f9f9f9;
120
120
  --c-neutral-3-darken-3: #bebebe;
121
121
  --c-neutral-3-darken-5: #b9b9b9;
122
- --c-neutral-2: #91969d;
123
- --c-neutral-2-lighten-20: #c7c9cd;
124
- --c-neutral-2-darken-3: #898e96;
125
- --c-neutral-2-darken-5: #848991;
126
- --c-neutral-1: #6c747d;
127
- --c-neutral-1-lighten-20: #a1a7ae;
128
- --c-neutral-1-darken-3: #656c75;
129
- --c-neutral-1-darken-5: #60676f;
130
- --c-neutral-0: #1e232b;
131
- --c-neutral-0-lighten-20: #485467;
132
- --c-neutral-0-darken-3: #181c22;
133
- --c-neutral-0-darken-5: #14171c;
122
+ --c-neutral-4: #91969d;
123
+ --c-neutral-4-lighten-20: #c7c9cd;
124
+ --c-neutral-4-darken-3: #898e96;
125
+ --c-neutral-4-darken-5: #848991;
126
+ --c-neutral-5: #6c747d;
127
+ --c-neutral-5-lighten-20: #a1a7ae;
128
+ --c-neutral-5-darken-3: #656c75;
129
+ --c-neutral-5-darken-5: #60676f;
130
+ --c-neutral-6: #1e232b;
131
+ --c-neutral-6-lighten-20: #485467;
132
+ --c-neutral-6-darken-3: #181c22;
133
+ --c-neutral-6-darken-5: #14171c;
134
134
  }
135
135
 
136
136
  html,
@@ -306,6 +306,10 @@ body {
306
306
  background-color: var(--c-body-bg);
307
307
  }
308
308
 
309
+ fieldset {
310
+ border: none;
311
+ }
312
+
309
313
  a {
310
314
  text-decoration: none;
311
315
  }
@@ -317,6 +321,24 @@ pre {
317
321
  font-family: monospace;
318
322
  }
319
323
 
324
+ pre {
325
+ -webkit-overflow-scrolling: touch;
326
+ padding: 1rem;
327
+ overflow-x: auto;
328
+ font-size: inherit;
329
+ color: var(--c-text);
330
+ text-align: left;
331
+ word-wrap: normal;
332
+ white-space: pre-wrap;
333
+ background-color: var(--c-neutral-2);
334
+ }
335
+ pre code {
336
+ padding: 0;
337
+ font-size: 0.75rem;
338
+ color: currentColor;
339
+ background-color: transparent;
340
+ }
341
+
320
342
  input[type=checkbox],
321
343
  input[type=radio] {
322
344
  vertical-align: baseline;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/variables/_css-vars.scss","index.css","../src/base/_reset.scss","../src/base/_generic.scss","../src/base/_v-transitions.scss","../src/base/_animation.scss"],"names":[],"mappings":"AAII;;EAGI,oBAAA;EACA,+BAAA;EACA,6BAAA;EACA,6BAAA;EAHA,kBAAA;EACA,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EJyUF;EItUA;IACE,yBAAA;EJwUF;AACF;;AI/UA;EACE;IACE,oBAAA;EJyUF;EItUA;IACE,yBAAA;EJwUF;AACF;AIrUA;EACE;IACE,UAAA;EJuUF;EIpUA;IACE,UAAA;EJsUF;AACF;AI7UA;EACE;IACE,UAAA;EJuUF;EIpUA;IACE,UAAA;EJsUF;AACF","file":"index.css"}
1
+ {"version":3,"sources":["../src/variables/_css-vars.scss","index.css","../src/base/_reset.scss","../src/base/_generic.scss","../src/utils/mixins/_overflow-touch.scss","../src/base/_v-transitions.scss","../src/base/_animation.scss"],"names":[],"mappings":"AAII;;EAGI,oBAAA;EACA,+BAAA;EACA,6BAAA;EACA,6BAAA;EAHA,kBAAA;EACA,6BAAA;EACA,2BAAA;EACA,2BAAA;EAHA,oBAAA;EACA,+BAAA;EACA,6BAAA;EACA,6BAAA;EAHA,oBAAA;EACA,+BAAA;EACA,6BAAA;EACA,6BAAA;EAHA,iBAAA;EACA,4BAAA;EACA,0BAAA;EACA,0BAAA;EAHA,iBAAA;EACA,4BAAA;EACA,0BAAA;EACA,0BAAA;EAHA,iBAAA;EACA,6BAAA;EACA,6BAAA;EACA,6BAAA;EAHA,eAAA;EACA,2BAAA;EACA,2BAAA;EACA,2BAAA;EAHA,eAAA;EACA,6BAAA;EACA,yBAAA;EACA,yBAAA;EAHA,mBAAA;EACA,+BAAA;EACA,+BAAA;EACA,+BAAA;EAHA,sBAAA;EACA,+BAAA;EACA,+BAAA;EACA,+BAAA;EAHA,sBAAA;EACA,+BAAA;EACA,+BAAA;EACA,+BAAA;EAHA,sBAAA;EACA,iCAAA;EACA,+BAAA;EACA,+BAAA;EAHA,sBAAA;EACA,iCAAA;EACA,+BAAA;EACA,+BAAA;EAHA,sBAAA;EACA,iCAAA;EACA,+BAAA;EACA,+BAAA;EAHA,sBAAA;EACA,iCAAA;EACA,+BAAA;EACA,+BAAA;ACwDR;;ADlDI;EAEI,oBAAA;EACA,+BAAA;EACA,6BAAA;EACA,6BAAA;E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kCAAA;EACA,mCAAA;EACA,kCAAA;EACA,eAAA;EACA,8BAAA;KAAA,2BAAA;UAAA,sBAAA;AFoRF;;AEjRA;EACE,kBAAA;EACA,gBAAA;EACA,yBAAA;MAAA,yBAAA;EACA,0IAtBiB;EAuBjB,mBAtBe;EAuBf,gBAtBiB;EAuBjB,sBAtBiB;EAuBjB,oBAtBW;EAuBX,kCAtBc;AF0ShB;;AEjRA;EACE,YAAA;AFoRF;;AEjRA;EACE,qBAAA;AFoRF;;AEjRA;;EAEE,4CAAA;EACA,6BAAA;EACA,sBAAA;AFoRF;;AEjRA;EC5CE,iCAAA;ED+CA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,oBA3CU;EA4CV,gBAAA;EACA,iBAAA;EACA,qBAAA;EACA,oCAhDO;AFmUT;AEjRE;EACE,UAAA;EACA,kBAAA;EACA,mBAAA;EACA,6BAAA;AFmRJ;;AE/QA;;EAEE,wBAAA;AFkRF;;AIlVE;EAEE,6DAAA;AJoVJ;AIjVE;EAEE,UAAA;AJkVJ;;AK5VA;EACE;IACE,oBAAA;EL+VF;EK5VA;IACE,yBAAA;EL8VF;AACF;;AKrWA;EACE;IACE,oBAAA;EL+VF;EK5VA;IACE,yBAAA;EL8VF;AACF;AK3VA;EACE;IACE,UAAA;EL6VF;EK1VA;IACE,UAAA;EL4VF;AACF;AKnWA;EACE;IACE,UAAA;EL6VF;EK1VA;IACE,UAAA;EL4VF;AACF","file":"index.css"}
@@ -1 +1 @@
1
- :root,[data-theme=light]{--c-primary:#178ae7;--c-primary-lighten-20:#73b9f1;--c-primary-darken-3:#1682d9;--c-primary-darken-5:#157cd0;--c-error:#da1e28;--c-error-lighten-20:#ec7279;--c-error-darken-3:#cd1c26;--c-error-darken-5:#c41b24;--c-warning:#f0d10d;--c-warning-lighten-20:#f7e46c;--c-warning-darken-3:#e1c40c;--c-warning-darken-5:#d8bc0c;--c-success:#4ec00f;--c-success-lighten-20:#82f045;--c-success-darken-3:#48b20e;--c-success-darken-5:#44a80d;--c-grey:#91969d;--c-grey-lighten-20:#c7c9cd;--c-grey-darken-3:#898e96;--c-grey-darken-5:#848991;--c-text:#1e232b;--c-text-lighten-20:#485467;--c-text-darken-3:#181c22;--c-text-darken-5:#14171c;--c-body-bg:#fff;--c-body-bg-lighten-20:white;--c-body-bg-darken-3:#f7f7f7;--c-body-bg-darken-5:#f2f2f2;--c-white:#fff;--c-white-lighten-20:white;--c-white-darken-3:#f7f7f7;--c-white-darken-5:#f2f2f2;--c-black:#000;--c-black-lighten-20:#333333;--c-black-darken-3:black;--c-black-darken-5:black;--c-neutral-0:#fff;--c-neutral-0-lighten-20:white;--c-neutral-0-darken-3:#f7f7f7;--c-neutral-0-darken-5:#f2f2f2;--c-neutral-1:#f6f6f6;--c-neutral-1-lighten-20:white;--c-neutral-1-darken-3:#eeeeee;--c-neutral-1-darken-5:#e9e9e9;--c-neutral-2:#dfdfdf;--c-neutral-2-lighten-20:white;--c-neutral-2-darken-3:#d7d7d7;--c-neutral-2-darken-5:#d2d2d2;--c-neutral-3:#c6c6c6;--c-neutral-3-lighten-20:#f9f9f9;--c-neutral-3-darken-3:#bebebe;--c-neutral-3-darken-5:#b9b9b9;--c-neutral-4:#91969d;--c-neutral-4-lighten-20:#c7c9cd;--c-neutral-4-darken-3:#898e96;--c-neutral-4-darken-5:#848991;--c-neutral-5:#6c747d;--c-neutral-5-lighten-20:#a1a7ae;--c-neutral-5-darken-3:#656c75;--c-neutral-5-darken-5:#60676f;--c-neutral-6:#1e232b;--c-neutral-6-lighten-20:#485467;--c-neutral-6-darken-3:#181c22;--c-neutral-6-darken-5:#14171c}[data-theme=dark]{--c-primary:#178ae7;--c-primary-lighten-20:#73b9f1;--c-primary-darken-3:#1682d9;--c-primary-darken-5:#157cd0;--c-error:#da1e28;--c-error-lighten-20:#ec7279;--c-error-darken-3:#cd1c26;--c-error-darken-5:#c41b24;--c-warning:#f0d10d;--c-warning-lighten-20:#f7e46c;--c-warning-darken-3:#e1c40c;--c-warning-darken-5:#d8bc0c;--c-success:#4ec00f;--c-success-lighten-20:#82f045;--c-success-darken-3:#48b20e;--c-success-darken-5:#44a80d;--c-grey:#91969d;--c-grey-lighten-20:#c7c9cd;--c-grey-darken-3:#898e96;--c-grey-darken-5:#848991;--c-c-text:#1e232b;--c-c-text-lighten-20:#485467;--c-c-text-darken-3:#181c22;--c-c-text-darken-5:#14171c;--c-c-body-bg:#fff;--c-c-body-bg-lighten-20:white;--c-c-body-bg-darken-3:#f7f7f7;--c-c-body-bg-darken-5:#f2f2f2;--c-white:#fff;--c-white-lighten-20:white;--c-white-darken-3:#f7f7f7;--c-white-darken-5:#f2f2f2;--c-black:#000;--c-black-lighten-20:#333333;--c-black-darken-3:black;--c-black-darken-5:black;--c-neutral-6:#fff;--c-neutral-6-lighten-20:white;--c-neutral-6-darken-3:#f7f7f7;--c-neutral-6-darken-5:#f2f2f2;--c-neutral-5:#f6f6f6;--c-neutral-5-lighten-20:white;--c-neutral-5-darken-3:#eeeeee;--c-neutral-5-darken-5:#e9e9e9;--c-neutral-4:#dfdfdf;--c-neutral-4-lighten-20:white;--c-neutral-4-darken-3:#d7d7d7;--c-neutral-4-darken-5:#d2d2d2;--c-neutral-3:#c6c6c6;--c-neutral-3-lighten-20:#f9f9f9;--c-neutral-3-darken-3:#bebebe;--c-neutral-3-darken-5:#b9b9b9;--c-neutral-2:#91969d;--c-neutral-2-lighten-20:#c7c9cd;--c-neutral-2-darken-3:#898e96;--c-neutral-2-darken-5:#848991;--c-neutral-1:#6c747d;--c-neutral-1-lighten-20:#a1a7ae;--c-neutral-1-darken-3:#656c75;--c-neutral-1-darken-5:#60676f;--c-neutral-0:#1e232b;--c-neutral-0-lighten-20:#485467;--c-neutral-0-darken-3:#181c22;--c-neutral-0-darken-5:#14171c}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,summary,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{padding:0;margin:0;vertical-align:baseline;border:0}input:-webkit-autofill,input:-webkit-autofill:focus,input:-webkit-autofill:hover,select:-webkit-autofill,select:-webkit-autofill:focus,select:-webkit-autofill:hover,textarea:-webkit-autofill,textarea:-webkit-autofill:focus,textarea:-webkit-autofill:hover{-webkit-transition:color 9999s ease-out,background-color 9999s ease-out;-webkit-transition-delay:9999s}*,::after,::before{box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body,html{-webkit-tap-highlight-color:transparent}blockquote,q{quotes:none}blockquote::after,blockquote::before,q::after,q::before{content:none}table{border-spacing:0;border-collapse:collapse}input,textarea{border-radius:0}input::-ms-clear{width:0}html{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-size:100%;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}body{overflow-x:hidden;overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:.875rem;font-weight:400;line-height:1.3125rem;color:var(--c-text);background-color:var(--c-body-bg)}a{text-decoration:none}code,pre{-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;font-family:monospace}input[type=checkbox],input[type=radio]{vertical-align:baseline}.fade-enter-active,.fade-leave-active{transition:opacity .25s cubic-bezier(.12, .39, .5, .93)}.fade-enter,.fade-leave-to{opacity:0}@-webkit-keyframes spinAround{from{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes spinAround{from{transform:rotate(0)}to{transform:rotate(359deg)}}@-webkit-keyframes fade{from{opacity:1}to{opacity:0}}@keyframes fade{from{opacity:1}to{opacity:0}}
1
+ :root,[data-theme=light]{--c-primary:#178ae7;--c-primary-lighten-20:#73b9f1;--c-primary-darken-3:#1682d9;--c-primary-darken-5:#157cd0;--c-error:#da1e28;--c-error-lighten-20:#ec7279;--c-error-darken-3:#cd1c26;--c-error-darken-5:#c41b24;--c-warning:#f0d10d;--c-warning-lighten-20:#f7e46c;--c-warning-darken-3:#e1c40c;--c-warning-darken-5:#d8bc0c;--c-success:#4ec00f;--c-success-lighten-20:#82f045;--c-success-darken-3:#48b20e;--c-success-darken-5:#44a80d;--c-grey:#91969d;--c-grey-lighten-20:#c7c9cd;--c-grey-darken-3:#898e96;--c-grey-darken-5:#848991;--c-text:#1e232b;--c-text-lighten-20:#485467;--c-text-darken-3:#181c22;--c-text-darken-5:#14171c;--c-body-bg:#fff;--c-body-bg-lighten-20:white;--c-body-bg-darken-3:#f7f7f7;--c-body-bg-darken-5:#f2f2f2;--c-white:#fff;--c-white-lighten-20:white;--c-white-darken-3:#f7f7f7;--c-white-darken-5:#f2f2f2;--c-black:#000;--c-black-lighten-20:#333333;--c-black-darken-3:black;--c-black-darken-5:black;--c-neutral-0:#fff;--c-neutral-0-lighten-20:white;--c-neutral-0-darken-3:#f7f7f7;--c-neutral-0-darken-5:#f2f2f2;--c-neutral-1:#f6f6f6;--c-neutral-1-lighten-20:white;--c-neutral-1-darken-3:#eeeeee;--c-neutral-1-darken-5:#e9e9e9;--c-neutral-2:#dfdfdf;--c-neutral-2-lighten-20:white;--c-neutral-2-darken-3:#d7d7d7;--c-neutral-2-darken-5:#d2d2d2;--c-neutral-3:#c6c6c6;--c-neutral-3-lighten-20:#f9f9f9;--c-neutral-3-darken-3:#bebebe;--c-neutral-3-darken-5:#b9b9b9;--c-neutral-4:#91969d;--c-neutral-4-lighten-20:#c7c9cd;--c-neutral-4-darken-3:#898e96;--c-neutral-4-darken-5:#848991;--c-neutral-5:#6c747d;--c-neutral-5-lighten-20:#a1a7ae;--c-neutral-5-darken-3:#656c75;--c-neutral-5-darken-5:#60676f;--c-neutral-6:#1e232b;--c-neutral-6-lighten-20:#485467;--c-neutral-6-darken-3:#181c22;--c-neutral-6-darken-5:#14171c}[data-theme=dark]{--c-primary:#178ae7;--c-primary-lighten-20:#73b9f1;--c-primary-darken-3:#1682d9;--c-primary-darken-5:#157cd0;--c-error:#da1e28;--c-error-lighten-20:#ec7279;--c-error-darken-3:#cd1c26;--c-error-darken-5:#c41b24;--c-warning:#f0d10d;--c-warning-lighten-20:#f7e46c;--c-warning-darken-3:#e1c40c;--c-warning-darken-5:#d8bc0c;--c-success:#4ec00f;--c-success-lighten-20:#82f045;--c-success-darken-3:#48b20e;--c-success-darken-5:#44a80d;--c-grey:#91969d;--c-grey-lighten-20:#c7c9cd;--c-grey-darken-3:#898e96;--c-grey-darken-5:#848991;--c-c-text:#1e232b;--c-c-text-lighten-20:#485467;--c-c-text-darken-3:#181c22;--c-c-text-darken-5:#14171c;--c-c-body-bg:#fff;--c-c-body-bg-lighten-20:white;--c-c-body-bg-darken-3:#f7f7f7;--c-c-body-bg-darken-5:#f2f2f2;--c-white:#fff;--c-white-lighten-20:white;--c-white-darken-3:#f7f7f7;--c-white-darken-5:#f2f2f2;--c-black:#000;--c-black-lighten-20:#333333;--c-black-darken-3:black;--c-black-darken-5:black;--c-neutral-0:#fff;--c-neutral-0-lighten-20:white;--c-neutral-0-darken-3:#f7f7f7;--c-neutral-0-darken-5:#f2f2f2;--c-neutral-1:#f6f6f6;--c-neutral-1-lighten-20:white;--c-neutral-1-darken-3:#eeeeee;--c-neutral-1-darken-5:#e9e9e9;--c-neutral-2:#dfdfdf;--c-neutral-2-lighten-20:white;--c-neutral-2-darken-3:#d7d7d7;--c-neutral-2-darken-5:#d2d2d2;--c-neutral-3:#c6c6c6;--c-neutral-3-lighten-20:#f9f9f9;--c-neutral-3-darken-3:#bebebe;--c-neutral-3-darken-5:#b9b9b9;--c-neutral-4:#91969d;--c-neutral-4-lighten-20:#c7c9cd;--c-neutral-4-darken-3:#898e96;--c-neutral-4-darken-5:#848991;--c-neutral-5:#6c747d;--c-neutral-5-lighten-20:#a1a7ae;--c-neutral-5-darken-3:#656c75;--c-neutral-5-darken-5:#60676f;--c-neutral-6:#1e232b;--c-neutral-6-lighten-20:#485467;--c-neutral-6-darken-3:#181c22;--c-neutral-6-darken-5:#14171c}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,summary,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{padding:0;margin:0;vertical-align:baseline;border:0}input:-webkit-autofill,input:-webkit-autofill:focus,input:-webkit-autofill:hover,select:-webkit-autofill,select:-webkit-autofill:focus,select:-webkit-autofill:hover,textarea:-webkit-autofill,textarea:-webkit-autofill:focus,textarea:-webkit-autofill:hover{-webkit-transition:color 9999s ease-out,background-color 9999s ease-out;-webkit-transition-delay:9999s}*,::after,::before{box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body,html{-webkit-tap-highlight-color:transparent}blockquote,q{quotes:none}blockquote::after,blockquote::before,q::after,q::before{content:none}table{border-spacing:0;border-collapse:collapse}input,textarea{border-radius:0}input::-ms-clear{width:0}html{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-size:100%;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}body{overflow-x:hidden;overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:.875rem;font-weight:400;line-height:1.3125rem;color:var(--c-text);background-color:var(--c-body-bg)}fieldset{border:none}a{text-decoration:none}code,pre{-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;font-family:monospace}pre{-webkit-overflow-scrolling:touch;padding:1rem;overflow-x:auto;font-size:inherit;color:var(--c-text);text-align:left;word-wrap:normal;white-space:pre-wrap;background-color:var(--c-neutral-2)}pre code{padding:0;font-size:.75rem;color:currentColor;background-color:transparent}input[type=checkbox],input[type=radio]{vertical-align:baseline}.fade-enter-active,.fade-leave-active{transition:opacity .25s cubic-bezier(.12, .39, .5, .93)}.fade-enter,.fade-leave-to{opacity:0}@-webkit-keyframes spinAround{from{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes spinAround{from{transform:rotate(0)}to{transform:rotate(359deg)}}@-webkit-keyframes fade{from{opacity:1}to{opacity:0}}@keyframes fade{from{opacity:1}to{opacity:0}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/styles",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Styles for or-ui components",
5
5
  "main": "./dist/index.min.css",
6
6
  "unpkg": "./dist/index.css",
@@ -41,5 +41,5 @@
41
41
  "sass": "^1.35.1",
42
42
  "stylelint": "^13.13.1"
43
43
  },
44
- "gitHead": "4ed4fba5968eeb9cdcb50ab829a5d3158cd2848b"
44
+ "gitHead": "74e91e4d630b99224b429fa4091cfe6b1ebeafd8"
45
45
  }
@@ -5,6 +5,9 @@ $body-line-height: get-line-height(1) !default;
5
5
  $body-color: var(--c-text) !default;
6
6
  $body-bg-color: var(--c-body-bg) !default;
7
7
 
8
+ $pre-bg: var(--c-neutral-2) !default;
9
+ $pre-color: var(--c-text) !default;
10
+
8
11
  html {
9
12
  -moz-osx-font-smoothing: grayscale;
10
13
  -webkit-font-smoothing: antialiased;
@@ -25,6 +28,10 @@ body {
25
28
  background-color: $body-bg-color;
26
29
  }
27
30
 
31
+ fieldset {
32
+ border: none;
33
+ }
34
+
28
35
  a {
29
36
  text-decoration: none;
30
37
  }
@@ -36,6 +43,26 @@ pre {
36
43
  font-family: monospace;
37
44
  }
38
45
 
46
+ pre {
47
+ @include overflow-touch;
48
+
49
+ padding: get-spacing(4);
50
+ overflow-x: auto;
51
+ font-size: inherit; // $pre-font-size
52
+ color: $pre-color;
53
+ text-align: left;
54
+ word-wrap: normal;
55
+ white-space: pre-wrap;
56
+ background-color: $pre-bg;
57
+
58
+ code {
59
+ padding: 0;
60
+ font-size: get-font-size();
61
+ color: currentColor;
62
+ background-color: transparent;
63
+ }
64
+ }
65
+
39
66
  input[type="checkbox"],
40
67
  input[type="radio"] {
41
68
  vertical-align: baseline;
@@ -1,5 +1,7 @@
1
1
  @import "../../utils";
2
2
 
3
+ $btn-prefix: base !default;
4
+
3
5
  $btn-min-width: px-to-rem(96) !default;
4
6
  $btn-padding: get-spacing(2) get-spacing(4) !default;
5
7
  $btn-cursor: pointer !default;
@@ -38,7 +40,7 @@ $btn-types: (outline, text, icon);
38
40
  background-color: var(--btn-#{$key}-bg-color);
39
41
  border-color: var(--c-#{$key});
40
42
 
41
- .base-button {
43
+ .#{$btn-prefix}-button {
42
44
  &--loader {
43
45
  &::after {
44
46
  border-color: var(--btn-#{$key}-color);
@@ -56,8 +58,12 @@ $btn-types: (outline, text, icon);
56
58
  border-color: var(--btn-#{$key}-darken-5);
57
59
  }
58
60
 
59
- &:disabled,
60
- &.is-loading {
61
+ @include disabled {
62
+ background-color: var(--btn-#{$key}-lighten-20);
63
+ border-color: var(--btn-#{$key}-lighten-20);
64
+ }
65
+
66
+ @include loading {
61
67
  background-color: var(--btn-#{$key}-lighten-20);
62
68
  border-color: var(--btn-#{$key}-lighten-20);
63
69
  }
@@ -70,7 +76,7 @@ $btn-types: (outline, text, icon);
70
76
  background-color: transparent;
71
77
  box-shadow: none;
72
78
 
73
- .base-button {
79
+ .#{$btn-prefix}-button {
74
80
  &--loader {
75
81
  &::after {
76
82
  border-color: inherit;
@@ -88,7 +94,7 @@ $btn-types: (outline, text, icon);
88
94
  color: var(--btn-#{$key}-color);
89
95
  border-color: var(--btn-#{$key}-color);
90
96
 
91
- .base-button {
97
+ .#{$btn-prefix}-button {
92
98
  &--loader {
93
99
  &::after {
94
100
  border-color: var(--btn-#{$key}-lighten-20);
@@ -108,8 +114,13 @@ $btn-types: (outline, text, icon);
108
114
  border-color: var(--btn-#{$key}-darken-5);
109
115
  }
110
116
 
111
- &:disabled,
112
- &.is-loading {
117
+ @include disabled {
118
+ color: var(--btn-#{$key}-lighten-20);
119
+ background-color: transparent;
120
+ border-color: var(--btn-#{$key}-lighten-20);
121
+ }
122
+
123
+ @include loading {
113
124
  color: var(--btn-#{$key}-lighten-20);
114
125
  background-color: transparent;
115
126
  border-color: var(--btn-#{$key}-lighten-20);
@@ -126,7 +137,7 @@ $btn-types: (outline, text, icon);
126
137
  box-shadow: $btn-box-shadow-second;
127
138
  }
128
139
 
129
- &.is-loading {
140
+ @include loading {
130
141
  box-shadow: $btn-box-shadow-second;
131
142
  }
132
143
  }
@@ -163,34 +174,18 @@ $btn-types: (outline, text, icon);
163
174
  border-color: transparent;
164
175
  }
165
176
 
166
- &:disabled,
167
- &.is-loading {
177
+ @include disabled {
168
178
  color: var(--btn-#{$key}-lighten-20);
169
179
  background-color: transparent;
170
180
  border-color: transparent;
171
181
  }
172
- }
173
- }
174
- }
175
- }
176
182
 
177
- @mixin is-loading() {
178
- &.is-loading {
179
- cursor: progress !important;
180
-
181
- .base-button {
182
- &--loader {
183
- visibility: visible;
184
- opacity: 1;
185
-
186
- &::after {
187
- animation-play-state: running;
183
+ @include loading {
184
+ color: var(--btn-#{$key}-lighten-20);
185
+ background-color: transparent;
186
+ border-color: transparent;
188
187
  }
189
188
  }
190
-
191
- &--content {
192
- opacity: 0;
193
- }
194
189
  }
195
190
  }
196
191
  }
@@ -201,7 +196,7 @@ $btn-types: (outline, text, icon);
201
196
  }
202
197
  }
203
198
 
204
- .base-button {
199
+ .#{$btn-prefix}-button {
205
200
  -moz-appearance: none;
206
201
  -webkit-appearance: none;
207
202
  position: relative;
@@ -224,7 +219,7 @@ $btn-types: (outline, text, icon);
224
219
  transition-duration: $btn-transition-time;
225
220
  transition-property: color, background-color, box-shadow, border-color;
226
221
 
227
- .base-icon {
222
+ .material-icons {
228
223
  font-size: $btn-icon-font-size;
229
224
  }
230
225
 
@@ -271,7 +266,7 @@ $btn-types: (outline, text, icon);
271
266
  font-size: calc(#{$btn-font-size} - #{px-to-rem(2)});
272
267
  line-height: 1;
273
268
 
274
- .base-icon {
269
+ .material-icons {
275
270
  font-size: $btn-icon-font-size;
276
271
  }
277
272
  }
@@ -279,12 +274,26 @@ $btn-types: (outline, text, icon);
279
274
  @include default-color-mixin;
280
275
  @include outline-type;
281
276
  @include text-type;
282
- @include is-loading;
283
277
  @include is-fullwidth;
284
278
 
285
- // disabled styles for all btn-types
286
- &:disabled {
287
- cursor: not-allowed;
279
+ @include loading {
280
+ .#{$btn-prefix}-button {
281
+ &--loader {
282
+ visibility: visible;
283
+ opacity: 1;
284
+
285
+ &::after {
286
+ animation-play-state: running;
287
+ }
288
+ }
289
+
290
+ &--content {
291
+ opacity: 0;
292
+ }
293
+ }
294
+ }
295
+
296
+ @include disabled {
288
297
  box-shadow: none;
289
298
  }
290
299
  }
@@ -0,0 +1,122 @@
1
+ @import "../../utils";
2
+
3
+ $checkbox-prefix: quote(base) !default;
4
+
5
+ $checkbox-size: px-to-rem(16) !default;
6
+ $checkbox-transition-func: get-transition-func() !default;
7
+ $checkbox-transition-time: get-transition-time() !default;
8
+ $checkbox-border-radius: px-to-rem(2) !default;
9
+ $checkbox-border-width: px-to-rem(1) !default;
10
+ $checkbox-border-color: var(--c-neutral-2) !default;
11
+ $checkbox-border-color-hover: var(--c-neutral-2-darken-3) !default;
12
+ $checkbox-border-color-active: var(--c-neutral-2-darken-5) !default;
13
+ $checkbox-bg-color: var(--c-white) !default;
14
+ $checkbox-text-color: inherit !default;
15
+ $checkbox-font-size: inherit !default;
16
+ $checkbox-line-height: inherit !default;
17
+ $checkbox-content-spacing: get-spacing(3) !default;
18
+
19
+ // checked
20
+ $checkbox-icon-color-checked: var(--c-white) !default;
21
+ $checkbox-border-color-checked: var(--c-primary) !default;
22
+ $checkbox-border-color-checked-hover: var(--c-primary-darken-3) !default;
23
+ $checkbox-border-color-checked-active: var(--c-primary-darken-5) !default;
24
+ $checkbox-bg-color-checked: var(--c-primary) !default;
25
+ $checkbox-bg-color-checked-hover: var(--c-primary-darken-3) !default;
26
+ $checkbox-bg-color-checked-active: var(--c-primary-darken-5) !default;
27
+ $checkbox-bg-color-checked-disabled: var(--c-primary-lighten-20) !default;
28
+
29
+ @mixin is-checked () {
30
+ &.is-checked {
31
+ .#{$checkbox-prefix}-checkbox {
32
+ &--checkbox {
33
+ background-color: $checkbox-bg-color-checked;
34
+ border-color: $checkbox-border-color-checked;
35
+ }
36
+ }
37
+
38
+ @include hover {
39
+ .#{$checkbox-prefix}-checkbox {
40
+ &--checkbox {
41
+ background-color: $checkbox-bg-color-checked-hover;
42
+ border-color: $checkbox-border-color-checked-hover;
43
+ }
44
+ }
45
+ }
46
+
47
+ @include active {
48
+ .#{$checkbox-prefix}-checkbox {
49
+ &--checkbox {
50
+ background-color: $checkbox-bg-color-checked-active;
51
+ border-color: $checkbox-border-color-checked-active;
52
+ }
53
+ }
54
+ }
55
+
56
+ @include disabled {
57
+ .#{$checkbox-prefix}-checkbox {
58
+ &--checkbox {
59
+ background-color: $checkbox-bg-color-checked-disabled;
60
+ border-color: $checkbox-bg-color-checked-disabled;
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ .#{$checkbox-prefix}-checkbox {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ font-size: $checkbox-font-size;
71
+ line-height: $checkbox-size;
72
+ color: $checkbox-text-color;
73
+ cursor: pointer;
74
+
75
+ &--input {
76
+ @include visually-hidden;
77
+ }
78
+
79
+ &--checkbox {
80
+ display: inline-flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ width: $checkbox-size;
84
+ min-width: $checkbox-size;
85
+ height: $checkbox-size;
86
+ min-height: $checkbox-size;
87
+ margin-right: $checkbox-content-spacing;
88
+ background-color: $checkbox-bg-color;
89
+ border: $checkbox-border-width solid $checkbox-border-color;
90
+ border-radius: $checkbox-border-radius;
91
+ transition-timing-function: $checkbox-transition-func;
92
+ transition-duration: $checkbox-transition-time;
93
+ transition-property: background-color, border-color;
94
+ }
95
+
96
+ &--icon {
97
+ font-size: $checkbox-size;
98
+ color: $checkbox-icon-color-checked;
99
+ transition-timing-function: $checkbox-transition-func;
100
+ transition-duration: $checkbox-transition-time;
101
+ transition-property: color;
102
+ }
103
+
104
+ @include hover {
105
+ .#{$checkbox-prefix}-checkbox {
106
+ &--checkbox {
107
+ border-color: $checkbox-border-color-hover;
108
+ }
109
+ }
110
+ }
111
+
112
+ @include active {
113
+ .#{$checkbox-prefix}-checkbox {
114
+ &--checkbox {
115
+ border-color: $checkbox-border-color-active;
116
+ }
117
+ }
118
+ }
119
+
120
+ @include disabled;
121
+ @include is-checked;
122
+ }
@@ -1,10 +1,11 @@
1
1
  @use "../../utils/functions" as *;
2
2
  @use "../../utils/mixins" as *;
3
3
 
4
+ $icon-prefix: base !default;
4
5
  $icon-size: px-to-rem(20) !default;
5
6
  $icon-color: inherit !default;
6
7
 
7
- .base-icon {
8
+ .#{$icon-prefix}-icon {
8
9
  display: inline-flex;
9
10
  font-size: $icon-size;
10
11
  color: $icon-color;
@@ -2,6 +2,7 @@
2
2
  @use "../../utils/mixins" as *;
3
3
  @use "../../base/animation" as *;
4
4
 
5
+ $loader-prefix: base !default;
5
6
  $loader-width: px-to-rem(24) !default;
6
7
  $loader-height: $loader-width !default;
7
8
  $loader-border-width: 2px !default;
@@ -39,7 +40,7 @@ $loader-border-color: inherit;
39
40
  }
40
41
  }
41
42
 
42
- .base-loader {
43
+ .#{$loader-prefix}-loader {
43
44
  position: relative;
44
45
  display: inline-flex;
45
46
  align-items: center;
@@ -0,0 +1,32 @@
1
+ @import "../../utils";
2
+
3
+ $radio-group-prefix: base !default;
4
+ $radio-group-column-mb: get-spacing(4) !default;
5
+ $radio-group-row-mr: get-spacing(4) !default;
6
+
7
+ .#{$radio-group-prefix}-radio-group {
8
+ &.is-column {
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: flex-start;
12
+ justify-content: flex-start;
13
+
14
+ > * {
15
+ &:not(:last-child) {
16
+ margin-bottom: $radio-group-column-mb;
17
+ }
18
+ }
19
+ }
20
+
21
+ &.is-row {
22
+ display: flex;
23
+ align-items: flex-start;
24
+ justify-content: flex-start;
25
+
26
+ > * {
27
+ &:not(:last-child) {
28
+ margin-right: $radio-group-row-mr;
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,125 @@
1
+ @import "../../utils";
2
+
3
+ $radio-prefix: base !default;
4
+ $radio-icon-size: px-to-rem(16) !default;
5
+
6
+ $radio-dot-size: $radio-icon-size - px-to-rem(12) !default;
7
+ $radio-dot-bg: var(--c-white) !default;
8
+
9
+ $radio-icon-radius: 9999px;
10
+
11
+ $radio-icon-border-width: px-to-rem(1) !default;
12
+ $radio-icon-border-color: var(--c-neutral-2) !default;
13
+ $radio-icon-border-color-hover: var(--c-neutral-2-darken-3) !default;
14
+ $radio-icon-border-color-active: var(--c-neutral-2-darken-5) !default;
15
+
16
+ $radio-icon-bg: var(--c-white) !default;
17
+ $radio-icon-bg-hover: var(--c-white-darken-3) !default;
18
+ $radio-icon-bg-active: var(--c-white-darken-5) !default;
19
+ $radio-icon-bg-checked: var(--c-primary) !default;
20
+
21
+ $radio-content-spacing: get-spacing(3) !default;
22
+ $radio-content-color: var(--c-neutral-6) !default;
23
+ $radio-content-color-disabled: var(--c-neutral-4) !default;
24
+
25
+ $radio-transition-func: get-transition-func() !default;
26
+ $radio-transition-time: get-transition-time() !default;
27
+
28
+ @mixin is-checked() {
29
+ &.is-checked {
30
+ .#{$radio-prefix}-radio {
31
+ &--radio {
32
+ background-color: $radio-icon-bg-checked;
33
+ border-color: $radio-icon-bg-checked;
34
+
35
+ &::after {
36
+ transform: translate(-50%, -50%) scale(1);
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ .#{$radio-prefix}-radio {
44
+ display: inline-flex;
45
+ align-items: center;
46
+ cursor: pointer;
47
+
48
+ &--input {
49
+ @include visually-hidden;
50
+ }
51
+
52
+ &--radio {
53
+ position: relative;
54
+ width: $radio-icon-size;
55
+ min-width: $radio-icon-size;
56
+ height: $radio-icon-size;
57
+ min-height: $radio-icon-size;
58
+ margin-right: $radio-content-spacing;
59
+ background-color: $radio-icon-bg;
60
+ border: $radio-icon-border-width solid $radio-icon-border-color;
61
+ border-radius: $radio-icon-radius;
62
+ transition-timing-function: $radio-transition-func;
63
+ transition-duration: $radio-transition-time;
64
+ transition-property: border-color, background-color, opacity;
65
+
66
+ &::after {
67
+ position: absolute;
68
+ top: 50%;
69
+ left: 50%;
70
+ width: $radio-dot-size;
71
+ height: $radio-dot-size;
72
+ content: '';
73
+ background-color: $radio-dot-bg;
74
+ border-radius: inherit;
75
+ transition-delay: 0.15s;
76
+ transition-timing-function: $radio-transition-func;
77
+ transition-duration: $radio-transition-time;
78
+ transition-property: transform;
79
+ transform: translate(-50%, -50%) scale(0);
80
+ }
81
+ }
82
+
83
+ &--content {
84
+ color: $radio-content-color;
85
+ transition-timing-function: $radio-transition-func;
86
+ transition-duration: $radio-transition-time;
87
+ transition-property: color;
88
+ }
89
+
90
+ @include is-checked;
91
+
92
+ @include hover {
93
+ &:not(.is-checked) {
94
+ .#{$radio-prefix}-radio {
95
+ &--radio {
96
+ background-color: $radio-icon-bg-hover;
97
+ border-color: $radio-icon-border-color-hover;
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ @include active {
104
+ &:not(.is-checked) {
105
+ .#{$radio-prefix}-radio {
106
+ &--radio {
107
+ background-color: $radio-icon-bg-active;
108
+ border-color: $radio-icon-border-color-active;
109
+ }
110
+ }
111
+ }
112
+ }
113
+
114
+ @include disabled {
115
+ .#{$radio-prefix}-radio {
116
+ &--radio {
117
+ opacity: 0.5;
118
+ }
119
+
120
+ &--content {
121
+ color: $radio-content-color-disabled;
122
+ }
123
+ }
124
+ }
125
+ }
@@ -0,0 +1,170 @@
1
+ @import "../../utils";
2
+
3
+ // base
4
+ $switch-prefix: base !default;
5
+ $switch-transition-func: get-transition-func() !default;
6
+ $switch-transition-time: get-transition-time() !default;
7
+
8
+ // layer
9
+ $switch-layer-width: px-to-rem(34) !default;
10
+ $switch-layer-height: px-to-rem(14) !default;
11
+ $switch-layer-border-radius: 9999px !default;
12
+
13
+ $switch-layer-bg: var(--c-neutral-2) !default;
14
+ $switch-layer-bg-hover: var(--c-neutral-2-darken-3) !default;
15
+ $switch-layer-bg-active: var(--c-neutral-2-darken-5) !default;
16
+
17
+ $switch-layer-bg-checked: var(--c-primary) !default;
18
+ $switch-layer-bg-checked-hover: var(--c-primary-darken-3) !default;
19
+ $switch-layer-bg-checked-active: var(--c-primary-darken-5) !default;
20
+ $switch-layer-bg-checked-disabled: var(--c-primary-lighten-20) !default;
21
+
22
+ // knob
23
+ $switch-knob-size: px-to-rem(20) !default;
24
+ $switch-knob-bg: var(--c-white) !default;
25
+ $switch-knob-box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.16), 0 1px 1px 0 rgba(0, 0, 0, 0.24) !default;
26
+ $switch-knob-box-shadow-disabled: 0 0 1px 0 rgba(0, 0, 0, 0.16), 0 1px 1px 0 rgba(0, 0, 0, 0.24) !default;
27
+
28
+ $switch-knob-border-width: 1px !default;
29
+ $switch-knob-border-color: var(--c-neutral-1) !default;
30
+
31
+ $switch-loader-size: calc(#{$switch-knob-size} - #{px-to-rem(5)});
32
+ $switch-loader-color: var(--c-primary) !default;
33
+
34
+ $switch-content-spacing: get-spacing(3) !default;
35
+ $switch-content-color: var(--c-neutral-6) !default;
36
+ $switch-content-color-disabled: var(--c-neutral-4) !default;
37
+
38
+ @mixin is-checked() {
39
+ &.is-checked {
40
+ .#{$switch-prefix}-switch {
41
+ &--layer {
42
+ background-color: $switch-layer-bg-checked;
43
+ }
44
+
45
+ &--knob {
46
+ transform: translate(calc(100% - 3px), -50%);
47
+ }
48
+ }
49
+
50
+ @include hover {
51
+ .#{$switch-prefix}-switch {
52
+ &--layer {
53
+ background-color: $switch-layer-bg-checked-hover;
54
+ }
55
+ }
56
+ }
57
+
58
+ @include active {
59
+ .#{$switch-prefix}-switch {
60
+ &--layer {
61
+ background-color: $switch-layer-bg-checked-active;
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+
68
+ .#{$switch-prefix}-switch {
69
+ display: inline-flex;
70
+ align-items: center;
71
+ cursor: pointer;
72
+
73
+ &--input {
74
+ @include visually-hidden;
75
+ }
76
+
77
+ &--switcher {
78
+ position: relative;
79
+ display: inline-flex;
80
+ margin-right: $switch-content-spacing;
81
+ }
82
+
83
+ &--layer {
84
+ width: $switch-layer-width;
85
+ min-width: $switch-layer-width;
86
+ height: $switch-layer-height;
87
+ min-height: $switch-layer-height;
88
+ background-color: $switch-layer-bg;
89
+ border-radius: $switch-layer-border-radius;
90
+ transition-timing-function: $switch-transition-func;
91
+ transition-duration: $switch-transition-time;
92
+ transition-property: background-color, opacity;
93
+ }
94
+
95
+ &--knob {
96
+ position: absolute;
97
+ top: 50%;
98
+ left: 0;
99
+ z-index: 1;
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ width: $switch-knob-size;
104
+ min-width: $switch-knob-size;
105
+ height: $switch-knob-size;
106
+ min-height: $switch-knob-size;
107
+ background-color: $switch-knob-bg;
108
+ border-width: $switch-knob-border-width solid $switch-knob-border-color;
109
+ border-radius: 9999px;
110
+ box-shadow: $switch-knob-box-shadow;
111
+ transition-timing-function: $switch-transition-func;
112
+ transition-duration: $switch-transition-time;
113
+ transition-property: transform, box-shadow;
114
+ transform: translate(-3px, -50%);
115
+ }
116
+
117
+ &--content {
118
+ color: $switch-content-color;
119
+ transition-timing-function: $switch-transition-func;
120
+ transition-duration: $switch-transition-time;
121
+ transition-property: color;
122
+ }
123
+
124
+ &--loader {
125
+ &.base-loader {
126
+ &::after {
127
+ width: $switch-loader-size;
128
+ min-width: $switch-loader-size;
129
+ height: $switch-loader-size;
130
+ min-height: $switch-loader-size;
131
+ border-color: $switch-loader-color;
132
+ }
133
+ }
134
+ }
135
+
136
+ @include hover {
137
+ .#{$switch-prefix}-switch {
138
+ &--layer {
139
+ background-color: $switch-layer-bg-hover;
140
+ }
141
+ }
142
+ }
143
+
144
+ @include active {
145
+ .#{$switch-prefix}-switch {
146
+ &--layer {
147
+ background-color: $switch-layer-bg-active;
148
+ }
149
+ }
150
+ }
151
+
152
+ @include disabled {
153
+ .#{$switch-prefix}-switch {
154
+ &--layer {
155
+ opacity: 0.5;
156
+ }
157
+
158
+ &--knob {
159
+ box-shadow: $switch-knob-box-shadow-disabled;
160
+ }
161
+
162
+ &--content {
163
+ color: $switch-content-color-disabled;
164
+ }
165
+ }
166
+ }
167
+
168
+ @include is-checked;
169
+ @include loading;
170
+ }
@@ -1,5 +1,5 @@
1
1
  @mixin active {
2
- &:not(&:disabled, &.is-loading) {
2
+ &:not(&:disabled, &.is-loading, &.is-disabled) {
3
3
  &:active {
4
4
  @content;
5
5
  }
@@ -0,0 +1,8 @@
1
+ @mixin disabled {
2
+ &:disabled,
3
+ &.is-disabled {
4
+ cursor: not-allowed;
5
+
6
+ @content;
7
+ }
8
+ }
@@ -1,6 +1,6 @@
1
1
  @mixin hover {
2
2
  @media (hover: hover) and (pointer: fine) {
3
- &:not(&:disabled, &.is-loading) {
3
+ &:not(&:disabled, &.is-loading, &.is-disabled) {
4
4
  &:hover {
5
5
  @content;
6
6
  }
@@ -8,7 +8,7 @@
8
8
  }
9
9
 
10
10
  @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
11
- &:not(&:disabled, &.is-loading) {
11
+ &:not(&:disabled, &.is-loading, &.is-disabled) {
12
12
  &:hover {
13
13
  @content;
14
14
  }
@@ -0,0 +1,7 @@
1
+ @mixin loading {
2
+ &.is-loading {
3
+ cursor: progress;
4
+
5
+ @content;
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ @mixin overflow-touch () {
2
+ -webkit-overflow-scrolling: touch;
3
+ }
@@ -1,10 +1,10 @@
1
- @mixin visuallyHidden() {
1
+ @mixin visually-hidden() {
2
2
  position: absolute !important;
3
3
  width: 1px !important;
4
4
  height: 1px !important;
5
5
  padding: 0 !important;
6
+ margin: -1px !important;
6
7
  overflow: hidden;
7
- clip: rect(1px 1px 1px 1px);
8
- clip: rect(1px, 1px, 1px, 1px);
8
+ clip: rect(0 0 0 0);
9
9
  border: 0 !important;
10
10
  }
@@ -5,4 +5,7 @@
5
5
  @forward "hover";
6
6
  @forward "active";
7
7
  @forward "focus";
8
+ @forward "disabled";
9
+ @forward "loading";
8
10
  @forward "breakpont";
11
+ @forward "overflow-touch";
@@ -62,13 +62,13 @@ $design-tokens: (
62
62
  c-body-bg: #fff,
63
63
  white: #fff,
64
64
  black: #000,
65
- neutral-6: #fff,
66
- neutral-5: #f6f6f6,
67
- neutral-4: #dfdfdf,
65
+ neutral-0: #fff,
66
+ neutral-1: #f6f6f6,
67
+ neutral-2: #dfdfdf,
68
68
  neutral-3: #c6c6c6,
69
- neutral-2: #91969d,
70
- neutral-1: #6c747d,
71
- neutral-0: #1e232b
69
+ neutral-4: #91969d,
70
+ neutral-5: #6c747d,
71
+ neutral-6: #1e232b
72
72
  )
73
73
  )
74
74
  );