@rescui/menu 0.13.6-RUI-296-Build-docs-md-files-for-each-docs-section-b138dd5bf.19 → 0.13.6-RUI-293-Update-menu-component-6ca9d26d3.22

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.
@@ -88,6 +88,46 @@ import {
88
88
  </Menu>;
89
89
  ```
90
90
 
91
+ #### Contrast primary color
92
+
93
+ If your primary color background requires dark text color, use `--rs-menu-contrast-primary` CSS variable.
94
+
95
+ ```tsx
96
+ import { Menu, MenuItem } from '@rescui/menu';
97
+
98
+ const Demo = () => {
99
+ return (
100
+ <div className="light-green-primary">
101
+ <Menu className="menu-with-contrast-primary" style={{ maxWidth: 200 }}>
102
+ <MenuItem>Some text 1</MenuItem>
103
+ <MenuItem>Some text 2</MenuItem>
104
+ <MenuItem>Some text 3</MenuItem>
105
+ <MenuItem>Some text 4</MenuItem>
106
+ <MenuItem>Some text 5</MenuItem>
107
+ </Menu>
108
+ </div>
109
+ );
110
+ };
111
+
112
+ render(<Demo />);
113
+ ```
114
+
115
+ ```postcss
116
+ .menu-with-contrast-primary {
117
+ --rs-menu-contrast-primary: 1;
118
+ }
119
+
120
+ .light-green-primary {
121
+ --rs-color-primary-light-theme: rgb(71, 224, 84);
122
+ --rs-color-primary-t-dim-light-theme: rgba(71, 224, 84, 0.8);
123
+ --rs-color-primary-t-fog-light-theme: rgba(71, 224, 84, 0.2);
124
+
125
+ --rs-color-primary-dark-theme: rgb(71, 224, 84);
126
+ --rs-color-primary-t-dim-dark-theme: rgba(71, 224, 84, 0.8);
127
+ --rs-color-primary-t-fog-dark-theme: rgba(71, 224, 84, 0.2);
128
+ }
129
+ ```
130
+
91
131
  ## CSS Mixins API
92
132
 
93
133
  #### `Menu` mixins
@@ -183,6 +223,14 @@ render(
183
223
  }
184
224
  ```
185
225
 
226
+ #### `Menu` CSS Vars
227
+
228
+ | Variable | Syntax | Description |
229
+ | --- | --- | --- |
230
+ | `--rs-menu-contrast-primary` | `0 \| 1` | The flag whenever the current primary is contrast enough and highlighted text color should be inverted |
231
+
232
+ Check out [this example](/components/menu/#contrast-primary-color) for contrast primary.
233
+
186
234
  #### `MenuItem` mixins
187
235
 
188
236
  | Mixin name | Details |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescui/menu",
3
- "version": "0.13.6-RUI-296-Build-docs-md-files-for-each-docs-section-b138dd5bf.19+b138dd5bf",
3
+ "version": "0.13.6-RUI-293-Update-menu-component-6ca9d26d3.22+6ca9d26d3",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
@@ -26,10 +26,10 @@
26
26
  "react": ">=16.8.0 <20"
27
27
  },
28
28
  "devDependencies": {
29
- "@rescui/colors": "0.3.1-RUI-296-Build-docs-md-files-for-each-docs-section-b138dd5bf.54+b138dd5bf",
29
+ "@rescui/colors": "0.3.1-RUI-293-Update-menu-component-6ca9d26d3.57+6ca9d26d3",
30
30
  "@rescui/postcss-preset-library": "0.2.2",
31
31
  "@rescui/scripts": "0.5.2",
32
- "@rescui/typography": "0.27.1-RUI-296-Build-docs-md-files-for-each-docs-section-b138dd5bf.19+b138dd5bf",
32
+ "@rescui/typography": "0.27.1-RUI-293-Update-menu-component-6ca9d26d3.22+6ca9d26d3",
33
33
  "@rescui/visual-regression": "0.1.4",
34
34
  "postcss": "^8.3.0"
35
35
  },
@@ -38,5 +38,5 @@
38
38
  "build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
39
39
  },
40
40
  "nx": {},
41
- "gitHead": "b138dd5bf3dbdca6c21fa339dd567517d5c5d1d9"
41
+ "gitHead": "6ca9d26d30da536dc5a10fdd86222129e2832efa"
42
42
  }