@@ -101,29 +101,19 @@ For special use cases, we also provide a Sass map–`$hds-breakpoints`–which i
101
101
102
102
We also provide helpers in case you need to access the breakpoints names/ values in JavaScript code .
103
103
104
- You have access to the list of breakpoint names using the `hdsBreakpointsNames` array :
104
+ You have access to the list of breakpoint names and values using the `hdsBreakpoints` map :
105
105
106
106
```javascript{data-execute =false }
107
- import { hds Breakpoints Names } from ' @hashicorp/design-system-components/utils/hds-breakpoints' ;
108
-
109
- hdsBreakpointsNames .forEach (name => {
110
- // do something with the breakpoint names
111
- } );
112
- ```
113
-
114
- You also have access to the list of breakpoint names and values using the `hdsBreakpointsValues` map :
115
-
116
- ```javascript{data-execute =false }
117
- import { hds Breakpoints Values } from ' @hashicorp/design-system-components/utils/hds-breakpoints' ;
107
+ import { hds Breakpoints } from ' @hashicorp/design-system-components/utils/hds-breakpoints' ;
118
108
119
109
// do something with a specific breakpoint value
120
- const myBreakpoint = hdsBreakpointsValues [' xl' ].value ; // numeric (eg. 1440)
121
- const myBreakpoint = hdsBreakpointsValues [' lg' ].px ; // size in px (eg. 1088px)
122
- const myBreakpoint = hdsBreakpointsValues [' sm' ].rem ; // size in rem (eg. 30rem)
110
+ const myBreakpoint1 = hdsBreakpoints [' xl' ].value ; // numeric (eg. 1440)
111
+ const myBreakpoint2 = hdsBreakpoints [' lg' ].px ; // size in px (eg. 1088px)
112
+ const myBreakpoint3 = hdsBreakpoints [' sm' ].rem ; // size in rem (eg. 30rem)
123
113
124
114
// loop over all the breakpoints
125
- Object .entries (hdsBreakpointsValues ).forEach (([name , sizes]) => {
115
+ Object .entries (hdsBreakpoints ).forEach (([name , sizes]) => {
126
116
// do something with a specific breakpoint value in px
127
- const breakpointSizePx = sizes.px;
117
+ const myBreakpointSizePx = sizes.px;
128
118
} );
129
119
```
0 commit comments