From 82d33abbc10f78ffd25df96261b289831301ecfe Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 5 Dec 2018 14:34:48 +0100 Subject: [PATCH] feat: add #table default style to the core styling --- .../src/shared/menu/SidebarMenu.js | 64 ++++++++++--------- .../src/shared/parts/Layout.js | 5 +- .../src/shared/parts/PortalStyle.js | 44 ++----------- .../__snapshots__/Button.test.js.snap | 9 ++- .../__snapshots__/Dropdown.test.js.snap | 13 +++- .../__tests__/__snapshots__/Icon.test.js.snap | 7 ++ .../__snapshots__/InputMasked.test.js.snap | 13 +++- .../__snapshots__/Input.test.js.snap | 11 +++- .../__tests__/__snapshots__/Logo.test.js.snap | 9 ++- .../__snapshots__/Modal.test.js.snap | 11 +++- .../__snapshots__/Slider.test.js.snap | 9 ++- .../__snapshots__/Switch.test.js.snap | 9 ++- .../__tests__/__snapshots__/Tabs.test.js.snap | 9 ++- .../src/patterns/article/style/_article.scss | 1 - .../__snapshots__/ViewTitle.test.js.snap | 9 ++- .../dnb-ui-lib/src/style/core/dnb-theme.scss | 51 ++++++++++++++- .../dnb-ui-lib/src/style/core/scopes.scss | 2 +- .../dnb-ui-lib/src/style/core/typography.scss | 22 +++---- 18 files changed, 196 insertions(+), 102 deletions(-) diff --git a/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.js b/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.js index ea3637b05c2..8c25b01d8f3 100644 --- a/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.js +++ b/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.js @@ -43,9 +43,7 @@ const Sidebar = styled.aside` max-height: calc(100vmin - 4em - 10px); margin: 0; - padding: 0; - padding-top: 2em; - padding-bottom: 1em; + padding: 2rem 0 1rem; } /* @@ -89,6 +87,8 @@ const StyledListItem = styled.li` flex-direction: column; justify-content: center; + line-height: 1.5rem; + /* external link icon */ svg { float: right; @@ -133,32 +133,6 @@ const StyledListItem = styled.li` font-size: 0.875em; } - .status-badge { - position: absolute; - right: 1.5rem; - - display: inline-flex; - justify-content: center; - align-items: center; - - padding: 2px 0 0; - - height: 1.25rem; - width: 1.25rem; - border-radius: 50%; - - background-color: var(--color-sea-green-alt-30); - color: var(--color-black); - - font-size: 0.5rem; - font-weight: 300; - text-align: center; - text-transform: uppercase; - } - ${'' /* &.status-wip .status-badge { - color: red; - } */} - &.active a { color: var(--color-ocean-green); @@ -222,6 +196,38 @@ const StyledListItem = styled.li` animation: hide-mobile-menu 300ms cubic-bezier(0.19, 1, 0.22, 1) 1 calc(10ms - var(--delay)) forwards; } + + .status-badge { + position: absolute; + z-index: 2; + right: 1.5rem; + + display: flex; + justify-content: center; + align-items: baseline; /* then we can set line-height */ + + font-size: 0.4375rem; + line-height: 1.3125rem; /* same as height + 1px */ + font-weight: 100; + text-align: center; + text-transform: uppercase; + color: var(--color-black); + + /* bg */ + height: 1.25rem; + width: 1.25rem; + border-radius: 50%; + + background-color: var(--color-sea-green-alt-30); + &::after { + content: ''; + position: absolute; + z-index: 1; + } + } + ${'' /* &.status-wip .status-badge { + color: red; + } */} ` const showAlwaysMenuItems = [] // like "uilib" som someting like that diff --git a/packages/dnb-design-system-portal/src/shared/parts/Layout.js b/packages/dnb-design-system-portal/src/shared/parts/Layout.js index c9e62345bcd..2469f747aba 100644 --- a/packages/dnb-design-system-portal/src/shared/parts/Layout.js +++ b/packages/dnb-design-system-portal/src/shared/parts/Layout.js @@ -17,7 +17,8 @@ import PropTypes from 'prop-types' import Sidebar from '../menu/SidebarMenu' import StickyMenuBar from '../menu/StickyMenuBar' import { markdownStyle } from './Markdown' -import styled, { cx } from 'react-emotion' +import styled from 'react-emotion' +import classnames from 'classnames' import { buildVersion } from '../../../package.json' import { SidebarMenuProvider } from '../menu/SidebarMenuContext' @@ -94,7 +95,7 @@ const Wrapper = styled.div` const Content = ({ className, children }) => (