Skip to content

Commit a7bbed8

Browse files
committed
Restore removed comments/context
1 parent 9253c8a commit a7bbed8

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/components/flyout/flyout.styles.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ export const euiFlyoutCloseButtonStyles = (euiThemeContext: UseEuiTheme) => {
5555
background-color: ${transparentize(euiTheme.colors.emptyShade, 0.9)};
5656
`,
5757
outside: css`
58-
// match dropshadow
58+
// Match dropshadow
5959
${euiShadowXLarge(euiThemeContext)};
6060
// Override the hover and focus transitions of buttons
6161
animation: none !important;
6262
`,
6363
outsideSide: {
64+
// `transforms` pull in close buttons a little
65+
// `!important` is necessary here to override the hover/focus transitions of buttons
6466
right: css`
6567
${logicalCSS('left', 0)}
6668
@@ -101,6 +103,7 @@ export const euiFlyoutStyles = (euiThemeContext: UseEuiTheme) => {
101103
align-items: stretch;
102104
103105
&:focus {
106+
// Remove focus ring because of tabindex=0
104107
outline: none;
105108
}
106109
@@ -111,7 +114,7 @@ export const euiFlyoutStyles = (euiThemeContext: UseEuiTheme) => {
111114
}
112115
`,
113116

114-
// Flyout Sizes
117+
// Flyout sizes
115118
s: css`
116119
${composeFlyoutSizing(euiThemeContext, 's')}
117120
`,
@@ -135,6 +138,7 @@ export const euiFlyoutStyles = (euiThemeContext: UseEuiTheme) => {
135138
${euiTheme.animation.resistance};
136139
}
137140
`,
141+
// Left-side flyouts should only be used for navigation
138142
left: css`
139143
${logicalCSS('left', 0)}
140144
clip-path: polygon(0 0, 150% 0, 150% 100%, 0 100%);
@@ -150,7 +154,8 @@ export const euiFlyoutStyles = (euiThemeContext: UseEuiTheme) => {
150154
`,
151155
push: css`
152156
clip-path: none;
153-
animation-duration: 0s !important; // Don't animate on loading a docked nav
157+
// Don't animate on loading a docked nav
158+
animation-duration: 0s !important;
154159
// Make sure the header shadows are above
155160
z-index: ${Number(euiTheme.levels.flyout) - 1};
156161
`,
@@ -187,9 +192,10 @@ const composeFlyoutSizing = (
187192
) => {
188193
const euiTheme = euiThemeContext.euiTheme;
189194

195+
// 1. Calculating the minimum width based on the screen takeover breakpoint
190196
const flyoutSizes = {
191197
s: {
192-
min: `${Math.round(euiTheme.breakpoint.m * 0.5)}px`,
198+
min: `${Math.round(euiTheme.breakpoint.m * 0.5)}px`, // 1.
193199
width: '25vw',
194200
max: `${Math.round(euiTheme.breakpoint.s * 0.7)}px`,
195201
},
@@ -202,7 +208,7 @@ const composeFlyoutSizing = (
202208
},
203209

204210
l: {
205-
min: `${Math.round(euiTheme.breakpoint.m * 0.9)}px`,
211+
min: `${Math.round(euiTheme.breakpoint.m * 0.9)}px`, // 1.
206212
width: '75vw',
207213
max: `${euiTheme.breakpoint.l}px`,
208214
},

0 commit comments

Comments
 (0)