Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/scratch-gui/src/components/cards/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ body .card-container {
border-bottom: 1px solid $extensions-tertiary;
font-size: 0.625rem;
font-weight: bold;
/* Ensure there is enough padding for the focus outline to become visible on Safari */
box-sizing: border-box;
padding: 0 0.77rem;
}

.header-buttons button {
Expand Down Expand Up @@ -155,6 +158,12 @@ body .card-container {
padding: 0.75rem;
}

.remove-button:focus-visible,
.shrink-expand-button:focus-visible,
.all-button:focus-visible {
outline-offset: -4px;
}

.remove-button:hover, .all-button:hover {
background-color: $ui-black-transparent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
cursor: pointer;
width: 32px;
height: 32px;
padding-left: 0;
padding-right: 0;
}

.modal-content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ const PreferenceMenu = ({
src={dropdownCaret}
/>
</button>
<Submenu place={isRtl ? 'left' : 'right'}>
<Submenu
place={isRtl ? 'left' : 'right'}
className={styles.preferenceSubmenu}
menuClassName={styles.menu}
>
{itemKeys.map(itemKey => (
<PreferenceItem
onParentKeyDown={handleKeyDownOpenMenu}
Expand Down
16 changes: 16 additions & 0 deletions packages/scratch-gui/src/components/menu-bar/settings-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
width: 1.5rem;
}

/*
Safari removes focus outline on elements inside overflow:hidden.
Since the preference submenu is inside a menu with overflow:hidden,
we need to override that here so that the focus outline is visible.
The preference submenus include a short list of options,
so the overflow:hidden is not necessary for them (as opposed to the Language menu)
*/
.preference-submenu {
overflow: visible;
}

.preference-submenu .menu {
overflow: visible;
box-shadow: none;
}

/* Unused? */
.color-mode-label {
flex: 1;
Expand Down
4 changes: 3 additions & 1 deletion packages/scratch-gui/src/components/menu/menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ MenuComponent.propTypes = {
place: PropTypes.oneOf(['left', 'right'])
};

const Submenu = ({children, className, place, ...props}) => (
const Submenu = ({children, className, menuClassName, place, ...props}) => (
<ul
className={classNames(
styles.submenu,
Expand All @@ -45,6 +45,7 @@ const Submenu = ({children, className, place, ...props}) => (
>
<MenuComponent
place={place}
className={menuClassName}
{...props}
>
{children}
Expand All @@ -55,6 +56,7 @@ const Submenu = ({children, className, place, ...props}) => (
Submenu.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
menuClassName: PropTypes.string,
place: PropTypes.oneOf(['left', 'right'])
};

Expand Down
Loading