Skip to content

Commit

Permalink
Apply light mobile header and border styles
Browse files Browse the repository at this point in the history
  • Loading branch information
at-susie committed Sep 20, 2023
1 parent 6d19d70 commit 030fcf4
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 82 deletions.
3 changes: 2 additions & 1 deletion src/app-layout/visual-refresh/background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ div.background {
display: contents;

> .scrolling-background {
background-color: awsui.$color-background-layout-main;
//background-color: awsui.$color-background-layout-main;
background-color: awsui.$color-foreground-control-default;
color: awsui.$color-text-body-default;
grid-column: 1 / span 5;
grid-row: 1 / 10;
Expand Down
2 changes: 1 addition & 1 deletion src/app-layout/visual-refresh/background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Background() {
}

return (
<div className={clsx(styles.background, 'awsui-context-content-header')}>
<div className={clsx(styles.background)}>
<div className={styles['scrolling-background']} />

{!isMobile && hasStickyBackground && (
Expand Down
4 changes: 3 additions & 1 deletion src/app-layout/visual-refresh/drawers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

&.has-open-drawer {
background-color: awsui.$color-background-container-content;
box-shadow: awsui.$shadow-panel;
//box-shadow: awsui.$shadow-panel;
box-shadow: none;
border-left: solid 2px awsui.$color-border-divider-default;
}

@include styles.with-motion {
Expand Down
4 changes: 2 additions & 2 deletions src/app-layout/visual-refresh/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default function Header() {
[styles['has-breadcrumbs']]: breadcrumbs,
[styles['has-notifications-content']]: hasNotificationsContent,
[styles.unfocusable]: hasDrawerViewportOverlay,
},
'awsui-context-content-header'
}
//'awsui-context-content-header'
)}
>
{contentHeader}
Expand Down
3 changes: 0 additions & 3 deletions src/app-layout/visual-refresh/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React from 'react';
import { AppLayoutInternalsProvider } from './context';
import { AppLayoutProps } from '../interfaces';
import Background from './background';
import Breadcrumbs from './breadcrumbs';
import Drawers from './drawers';
import Header from './header';
import Layout from './layout';
Expand All @@ -31,8 +30,6 @@ const AppLayoutWithRef = React.forwardRef(function AppLayout(

<Notifications />

<Breadcrumbs />

<Header />

<Main />
Expand Down
19 changes: 12 additions & 7 deletions src/app-layout/visual-refresh/mobile-toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,37 @@

section.mobile-toolbar {
align-items: center;
background-color: awsui.$color-background-home-header;
border-bottom: 1px solid awsui.$color-border-divider-default;
box-shadow: awsui.$shadow-panel-toggle;
//background-color: awsui.$color-background-home-header;
border-bottom: 2px solid awsui.$color-border-divider-default;
//box-shadow: awsui.$shadow-panel-toggle;
box-sizing: border-box;
height: var(#{custom-props.$mobileBarHeight});
//height: var(#{custom-props.$mobileBarHeight});
display: grid;
grid-area: mobileToolbar;
grid-column: 1 / span 5;
grid-column: 2 / span 3;
grid-template-columns: auto minmax(0, 1fr) auto;
padding: 0 awsui.$space-m;
position: sticky;
top: var(#{custom-props.$offsetTop});
z-index: 1000;

// Custom CSS
height: 48px;
background-color: awsui.$color-foreground-control-default;

> .mobile-toolbar-nav {
grid-column: 1;
margin-right: awsui.$space-m;
}

> .mobile-toolbar-breadcrumbs {
grid-column: 2;
background-color: awsui.$color-background-layout-main;
//background-color: awsui.$color-background-layout-main;
background-color: awsui.$color-foreground-control-default;
}

> .mobile-toolbar-tools {
grid-column: 3;
grid-column: 2;
margin-left: awsui.$space-m;
}
}
6 changes: 3 additions & 3 deletions src/app-layout/visual-refresh/mobile-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function MobileToolbar() {
toolsRefs,
} = useAppLayoutInternals();

if (!isMobile || (navigationHide && !breadcrumbs && toolsHide && drawers.length === 0)) {
if (navigationHide && !breadcrumbs && toolsHide && drawers.length === 0) {
return null;
}

Expand All @@ -38,8 +38,8 @@ export default function MobileToolbar() {
[styles.unfocusable]: hasDrawerViewportOverlay,
[testutilStyles['mobile-bar']]: isMobile,
},
testutilStyles['mobile-bar'],
'awsui-context-content-header'
testutilStyles['mobile-bar']
//'awsui-context-content-header'
)}
>
{!navigationHide && (
Expand Down
4 changes: 3 additions & 1 deletion src/app-layout/visual-refresh/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ nav.show-navigation {

nav.navigation {
background-color: awsui.$color-background-container-content;
box-shadow: awsui.$shadow-panel;
//box-shadow: awsui.$shadow-panel;
box-shadow: none;
border-right: solid 2px awsui.$color-border-divider-default;
bottom: 0;
height: 100%;
overflow-x: hidden;
Expand Down
23 changes: 1 addition & 22 deletions src/app-layout/visual-refresh/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import clsx from 'clsx';
import { useAppLayoutInternals } from './context';
import { InternalButton } from '../../button/internal';
import TriggerButton from './trigger-button';
//import TriggerButton from './trigger-button';
import styles from './styles.css.js';
import testutilStyles from '../test-classes/styles.css.js';
import { Transition } from '../../internal/components/transition';
Expand Down Expand Up @@ -63,27 +63,6 @@ export default function Navigation() {
// Overwrite the default nav width (depends on breakpoints) only when the `navigationWidth` property is set.
style={{ ...(navigationWidth && { [customCssProps.navigationWidth]: `${navigationWidth}px` }) }}
>
{!isMobile && (
<nav
aria-hidden={isMobile || isNavigationOpen ? true : false}
aria-label={ariaLabels?.navigation ?? undefined}
className={clsx(styles['show-navigation'], {
[styles.animating]: state === 'exiting',
[styles['is-navigation-open']]: isNavigationOpen,
})}
ref={state === 'exiting' ? transitionEventsRef : undefined}
>
<TriggerButton
ariaLabel={ariaLabels?.navigationToggle}
ariaExpanded={isNavigationOpen ? undefined : false}
iconName="menu"
className={testutilStyles['navigation-toggle']}
onClick={() => handleNavigationClick(true)}
ref={navigationRefs.toggle}
/>
</nav>
)}

<nav
aria-label={ariaLabels?.navigation ?? undefined}
className={clsx(
Expand Down
4 changes: 3 additions & 1 deletion src/app-layout/visual-refresh/split-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ section.split-panel-side {
be persistent in the DOM when closed.
*/
&.is-split-panel-open.position-side {
box-shadow: awsui.$shadow-panel;
//box-shadow: awsui.$shadow-panel;
box-shadow: none;
border-left: solid 2px awsui.$color-border-divider-default;
max-width: var(#{custom-props.$splitPanelMaxWidth}, 280px);
min-width: var(#{custom-props.$splitPanelMinWidth}, 280px);
&.animating {
Expand Down
4 changes: 3 additions & 1 deletion src/app-layout/visual-refresh/tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ viewport size and state of the Tools drawer.

.tools {
background-color: awsui.$color-background-container-content;
box-shadow: awsui.$shadow-panel;
//box-shadow: awsui.$shadow-panel;
box-shadow: none;
border-left: solid 2px awsui.$color-border-divider-default;
flex-shrink: 0;
height: 100%;
overflow-y: auto;
Expand Down
74 changes: 37 additions & 37 deletions src/app-layout/visual-refresh/tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import React from 'react';
import clsx from 'clsx';
import { InternalButton } from '../../button/internal';
import { useAppLayoutInternals } from './context';
import TriggerButton from './trigger-button';
//import TriggerButton from './trigger-button';
import styles from './styles.css.js';
import splitPanelStyles from '../../split-panel/styles.css.js';
//import splitPanelStyles from '../../split-panel/styles.css.js';
import testutilStyles from '../test-classes/styles.css.js';
import { Transition } from '../../internal/components/transition';
import customCssProps from '../../internal/generated/custom-css-properties';
Expand All @@ -28,7 +28,7 @@ export default function Tools({ children }: ToolsProps) {
ariaLabels,
disableBodyScroll,
drawers,
handleSplitPanelClick,
//handleSplitPanelClick,
handleToolsClick,
hasDefaultToolsWidth,
hasDrawerViewportOverlay,
Expand All @@ -37,11 +37,11 @@ export default function Tools({ children }: ToolsProps) {
isToolsOpen,
loseToolsFocus,
splitPanel,
splitPanelControlId,
//splitPanelControlId,
splitPanelDisplayed,
splitPanelPosition,
splitPanelRefs,
splitPanelToggle,
//splitPanelRefs,
//splitPanelToggle,
tools,
toolsControlId,
toolsHide,
Expand All @@ -50,7 +50,7 @@ export default function Tools({ children }: ToolsProps) {
} = useAppLayoutInternals();

const hasSplitPanel = !!splitPanel && getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);
const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);
//const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);
const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);
const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen;

Expand Down Expand Up @@ -118,7 +118,7 @@ export default function Tools({ children }: ToolsProps) {
</aside>
)}

{!isMobile && (
{/* {!isMobile && (
<aside
aria-hidden={!hasToolsForm ? true : false}
aria-label={ariaLabels?.tools ?? undefined}
Expand Down Expand Up @@ -156,7 +156,7 @@ export default function Tools({ children }: ToolsProps) {
/>
)}
</aside>
)}
)} */}
</div>
)}
</Transition>
Expand Down Expand Up @@ -194,34 +194,34 @@ function getSplitPanelStatus(splitPanelDisplayed: boolean, splitPanelPosition: s
* In large viewports, however the Tools form and its corresponding buttons
* should be present in the UI under the below circumstances.
*/
function getToolsFormStatus(
hasSplitPanel: boolean,
isMobile: boolean,
isSplitPanelOpen?: boolean,
isToolsOpen?: boolean,
toolsHide?: boolean
) {
let hasToolsForm = false;

if (!isMobile) {
// Both the Split Panel and Tools button are needed
if (hasSplitPanel && !toolsHide) {
hasToolsForm = true;
}

// The Split Panel button is needed
if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {
hasToolsForm = true;
}

// The Tools button is needed
if (!hasSplitPanel && !toolsHide && !isToolsOpen) {
hasToolsForm = true;
}
}

return hasToolsForm;
}
// function getToolsFormStatus(
// hasSplitPanel: boolean,
// isMobile: boolean,
// isSplitPanelOpen?: boolean,
// isToolsOpen?: boolean,
// toolsHide?: boolean
// ) {
// let hasToolsForm = false;

// if (!isMobile) {
// // Both the Split Panel and Tools button are needed
// if (hasSplitPanel && !toolsHide) {
// hasToolsForm = true;
// }

// // The Split Panel button is needed
// if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {
// hasToolsForm = true;
// }

// // The Tools button is needed
// if (!hasSplitPanel && !toolsHide && !isToolsOpen) {
// hasToolsForm = true;
// }
// }

// return hasToolsForm;
// }

/**
* Under two scenarios the Tools form that contains the triggers
Expand Down
9 changes: 8 additions & 1 deletion src/internal/components/selectable-item/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
@use '../../styles' as styles;
@use '../../styles/tokens' as awsui;

$selected-item-background: awsui.$color-background-status-info;
//$selected-item-border: #539FE5;
$selected-item-border: awsui.$color-border-item-selected;

// Outer borders of adjacent cells overlap and we want selected option border
// to take precedence over the other ones, hence negative margins and z-indices
.selectable-item {
Expand Down Expand Up @@ -64,7 +68,10 @@
}

&.selected {
background-color: awsui.$color-background-dropdown-item-selected;
//background-color: awsui.$color-background-dropdown-item-selected;
background-color: $selected-item-background;
border-color: $selected-item-border;
z-index: 1000;
// smooth adjacent selected borders to avoid bubble effect (visual refresh)
&.next-item-selected {
border-bottom-left-radius: 0;
Expand Down
4 changes: 3 additions & 1 deletion src/internal/styles/forms/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@

&::after {
@include utils.base-pseudo-element;
box-shadow: awsui.$shadow-container;
//box-shadow: awsui.$shadow-container;
box-shadow: none;
border: solid 2px awsui.$color-border-divider-default;
border-radius: awsui.$border-radius-container;
mix-blend-mode: multiply;
}
Expand Down

0 comments on commit 030fcf4

Please sign in to comment.