UNPKG

@atlaskit/side-navigation

Version:

A highly composable side navigation component that supports nested views.

44 lines • 2.33 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } import { VAR_SCROLL_INDICATOR_COLOR } from '../../common/constants'; var scrollIndicatorMaskZIndex = 2; var scrollIndicatorHeight = 2; var scrollIndicatorBorderRadius = '1px'; export var innerContainerCSS = function innerContainerCSS(opts) { return _objectSpread(_objectSpread({ display: 'flex', overflow: 'auto', width: '100%', position: 'relative', boxSizing: 'border-box', flexDirection: 'column' }, !opts.showTopScrollIndicator && { '&::before': { borderRadius: "var(--ds-radius-xsmall, ".concat(scrollIndicatorBorderRadius, ")"), content: "''", left: 0, right: 0, height: scrollIndicatorHeight, backgroundColor: "var(".concat(VAR_SCROLL_INDICATOR_COLOR, ", ", "var(--ds-surface, #FFFFFF)", ")"), position: 'absolute', display: 'block', zIndex: scrollIndicatorMaskZIndex } }), {}, { // This after pseudo element abuses being a flex child and pushes itself down to the // very bottom of the container - doing so ends up "masking" the actual scroll indicator. '&::after': { borderRadius: "var(--ds-radius-xsmall, ".concat(scrollIndicatorBorderRadius, ")"), content: "''", display: 'block', flexShrink: 0, height: scrollIndicatorHeight, // This is used to "push" the element to the bottom of the flex container. marginTop: 'auto', position: 'relative', zIndex: scrollIndicatorMaskZIndex, backgroundColor: "var(".concat(VAR_SCROLL_INDICATOR_COLOR, ", ", "var(--ds-surface, #FFFFFF)", ")") } }); };