Skip to content

Commit

Permalink
feat: Focus-within polyfill (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh authored Oct 22, 2020
1 parent 8a5d560 commit 42d4147
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/fuselage-polyfills/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('focus-within-polyfill');
require('focus-visible');
window.ResizeObserver = window.ResizeObserver || require('@juggle/resize-observer').ResizeObserver;
navigator.clipboard = navigator.clipboard || require('clipboard-polyfill');
Expand Down
1 change: 1 addition & 0 deletions packages/fuselage-polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dependencies": {
"@juggle/resize-observer": "^3.1.2",
"clipboard-polyfill": "^2.8.6",
"focus-within-polyfill": "^5.1.0",
"element-closest-polyfill": "^1.0.2",
"focus-visible": "^5.0.2"
}
Expand Down
8 changes: 8 additions & 0 deletions packages/fuselage/src/components/Sidebar/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ $sidebar-item-color-selected: theme('sidebar-item-color-selected', colors.foregr
}

&:hover &__menu-wraper,
&.focus-within &__menu-wraper {
width: lengths.size(20);

margin-inline: lengths.margin(4);

opacity: 1;
}

&:focus-within &__menu-wraper {
width: lengths.size(20);

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8871,6 +8871,11 @@ focus-visible@^5.0.2:
resolved "https://registry.yarnpkg.com/focus-visible/-/focus-visible-5.0.2.tgz#4fae9cf40458b73c10701c9774c462e3ccd53caf"
integrity sha512-zT2fj/bmOgEBjqGbURGlowTmCwsIs3bRDMr/sFZz8Ly7VkEiwuCn9swNTL3pPuf8Oua2de7CLuKdnuNajWdDsQ==

focus-within-polyfill@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/focus-within-polyfill/-/focus-within-polyfill-5.1.0.tgz#a32ed39503a7e95a5eb208367083858af533178c"
integrity sha512-u944FX2NsX5nhCi3jsXcWkUcPAekvFHnhl5+OQJZvZeRamPXhQxwvOVs1ordzyIaP7sc+cW3PU7z1fDKPYM9+A==

for-in@^0.1.3:
version "0.1.8"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1"
Expand Down

0 comments on commit 42d4147

Please sign in to comment.