ui.shipaid.com 0.2.13-beta → 0.2.13-beta.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
@@ -39,7 +39,7 @@ Then add the widget element where needed:
39
39
 
40
40
  #### Test Mode
41
41
 
42
- Sometimes, a store won't have activated their subscription before you install the widget - in this case, the widget does not display (you will notice a message in the console reflecting this). So to force the widget to show while you are installing and testing it, you can add this query param to the page URL: `shipaid-test`.
42
+ Sometimes, a store won't have activated their subscription before you install the widget - in this case, the widget does not display (you will notice a message in the console reflecting this). So to force the widget to show while you are installing and testing it, you can add this query param to the page URL: `shipaid-test`.
43
43
  For example: `https://some-store.myshopify.com/cart?shipaid-text`
44
44
 
45
45
  ### Slots
@@ -51,9 +51,9 @@ Slots, with the syntax `slot="<slot name>"`, can be used to customise the widget
51
51
  </shipaid-widget>
52
52
  ```
53
53
 
54
- The default content will be replaced by any slot content. You can also add inline styles to the slots, if you need to change the text color for example:
54
+ The default content will be replaced by any slot content. You can also add inline styles to the slots, if you need to change the font size/weight for example - but color changes should be handled by CSS variables:
55
55
  ```html
56
- <span slot="title" style="color: white; font-weight: 500;">Package Protection</span>
56
+ <span slot="title" style="font-weight: 500;">Package Protection</span>
57
57
  ```
58
58
 
59
59
  | Name | Description |
@@ -102,6 +102,30 @@ if (shipAidEl) await shipAidEl.updateCart()
102
102
  | `addProtection` | Adds the relevant protection item to cart. | |
103
103
  | `removeProtection` | Removes the protection item from the cart. | |
104
104
 
105
+ ### Styles
106
+
107
+ If you need to change any of the widget colors to suit a specific theme, there are various CSS variables you can use to do so. These should be added to the style attribute on the widget element:
108
+
109
+ ```html
110
+ <shipaid-widget
111
+ style="
112
+ --shipaid-text: #fff;
113
+ --shipaid-prompt-actions-price-color: #fff;
114
+ "
115
+ >
116
+ </shipaid-widget>
117
+ ```
118
+
119
+ | Variable | Description | Default |
120
+ |----------|-------------|---------|
121
+ | `--shipaid-text` | Changes the global text color. | `#000000` |
122
+ | `--shipaid-text-muted` | Changes the global muted text color. | `#aaaaaa` |
123
+ | `--shipaid-prompt-actions-price-color` | Changes the color of the price element. | `var(--shipaid-text-muted)` |
124
+ | `--shipaid-prompt-actions-button-color` | Changes the color of the add/remove button element. | `var(--shipaid-primary)` |
125
+ | `--shipaid-prompt-badge-background-color` | Changes the background color of the learn more button element. | `var(--shipaid-light-grey)` |
126
+ | `--shipaid-prompt-badge-text-color` | Changes the color of the learn more button element. | `var(--shipaid-text)` |
127
+
128
+ Other variables can be found [here](/widget/src/assets/styles.ts) (`/widget/src/assets/styles.ts`).
105
129
 
106
130
  ## Contributing
107
131
 
package/dist/widget.es.js CHANGED
@@ -969,7 +969,7 @@ const styles = i$1`
969
969
  .prompt-product
970
970
  .prompt-product-actions
971
971
  .prompt-product-actions-price {
972
- color: var(--prompt-actions-price-color, var(--shipaid-text-muted));
972
+ color: var(--shipaid-prompt-actions-price-color, var(--shipaid-text-muted));
973
973
  font-size: var(--shipaid-font-base);
974
974
  }
975
975
  .shipaid-prompt
@@ -978,7 +978,7 @@ const styles = i$1`
978
978
  .prompt-product-actions-button {
979
979
  background-color: transparent;
980
980
  border: none;
981
- color: var(--prompt-actions-button-color, var(--shipaid-primary));
981
+ color: var(--shipaid-prompt-actions-button-color, var(--shipaid-primary));
982
982
  text-transform: uppercase;
983
983
  font-weight: var(--shipaid-font-heavy);
984
984
  cursor: pointer;
@@ -1002,8 +1002,8 @@ const styles = i$1`
1002
1002
  margin-left: 0.5rem;
1003
1003
  }
1004
1004
  .shipaid-prompt .prompt-footer .prompt-footer-badge {
1005
- background-color: var(--shipaid-prompt-badge-background, var(--shipaid-light-grey));
1006
- color: var(--shipaid-prompt-badge-text, var(--shipaid-text));
1005
+ background-color: var(--shipaid-prompt-badge-background--shipaid-text, var(--shipaid-light-grey));
1006
+ color: var(--shipaid-prompt-badge-text--shipaid-text, var(--shipaid-text));
1007
1007
  padding: 0.5rem 1.5rem;
1008
1008
  border-radius: 30px;
1009
1009
  cursor: pointer;
@@ -329,7 +329,7 @@ function ht(t,e,i){return t?e():null==i?void 0:i()}const ct=h`
329
329
  .prompt-product
330
330
  .prompt-product-actions
331
331
  .prompt-product-actions-price {
332
- color: var(--prompt-actions-price-color, var(--shipaid-text-muted));
332
+ color: var(--shipaid-prompt-actions-price-color, var(--shipaid-text-muted));
333
333
  font-size: var(--shipaid-font-base);
334
334
  }
335
335
  .shipaid-prompt
@@ -338,7 +338,7 @@ function ht(t,e,i){return t?e():null==i?void 0:i()}const ct=h`
338
338
  .prompt-product-actions-button {
339
339
  background-color: transparent;
340
340
  border: none;
341
- color: var(--prompt-actions-button-color, var(--shipaid-primary));
341
+ color: var(--shipaid-prompt-actions-button-color, var(--shipaid-primary));
342
342
  text-transform: uppercase;
343
343
  font-weight: var(--shipaid-font-heavy);
344
344
  cursor: pointer;
@@ -362,8 +362,8 @@ function ht(t,e,i){return t?e():null==i?void 0:i()}const ct=h`
362
362
  margin-left: 0.5rem;
363
363
  }
364
364
  .shipaid-prompt .prompt-footer .prompt-footer-badge {
365
- background-color: var(--shipaid-prompt-badge-background, var(--shipaid-light-grey));
366
- color: var(--shipaid-prompt-badge-text, var(--shipaid-text));
365
+ background-color: var(--shipaid-prompt-badge-background--shipaid-text, var(--shipaid-light-grey));
366
+ color: var(--shipaid-prompt-badge-text--shipaid-text, var(--shipaid-text));
367
367
  padding: 0.5rem 1.5rem;
368
368
  border-radius: 30px;
369
369
  cursor: pointer;
@@ -329,7 +329,7 @@ function ht(t,e,i){return t?e():null==i?void 0:i()}const ct=h`
329
329
  .prompt-product
330
330
  .prompt-product-actions
331
331
  .prompt-product-actions-price {
332
- color: var(--prompt-actions-price-color, var(--shipaid-text-muted));
332
+ color: var(--shipaid-prompt-actions-price-color, var(--shipaid-text-muted));
333
333
  font-size: var(--shipaid-font-base);
334
334
  }
335
335
  .shipaid-prompt
@@ -338,7 +338,7 @@ function ht(t,e,i){return t?e():null==i?void 0:i()}const ct=h`
338
338
  .prompt-product-actions-button {
339
339
  background-color: transparent;
340
340
  border: none;
341
- color: var(--prompt-actions-button-color, var(--shipaid-primary));
341
+ color: var(--shipaid-prompt-actions-button-color, var(--shipaid-primary));
342
342
  text-transform: uppercase;
343
343
  font-weight: var(--shipaid-font-heavy);
344
344
  cursor: pointer;
@@ -362,8 +362,8 @@ function ht(t,e,i){return t?e():null==i?void 0:i()}const ct=h`
362
362
  margin-left: 0.5rem;
363
363
  }
364
364
  .shipaid-prompt .prompt-footer .prompt-footer-badge {
365
- background-color: var(--shipaid-prompt-badge-background, var(--shipaid-light-grey));
366
- color: var(--shipaid-prompt-badge-text, var(--shipaid-text));
365
+ background-color: var(--shipaid-prompt-badge-background--shipaid-text, var(--shipaid-light-grey));
366
+ color: var(--shipaid-prompt-badge-text--shipaid-text, var(--shipaid-text));
367
367
  padding: 0.5rem 1.5rem;
368
368
  border-radius: 30px;
369
369
  cursor: pointer;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.2.13-beta",
4
+ "version": "0.2.13-beta.3",
5
5
  "type": "module",
6
6
  "main": "dist/widget.umd.js",
7
7
  "unpkg": "dist/widget.iife.js",