diff --git a/packages/decap-cms-core/src/components/App/App.js b/packages/decap-cms-core/src/components/App/App.js index 21994ea74ac5..1d30c97fa576 100644 --- a/packages/decap-cms-core/src/components/App/App.js +++ b/packages/decap-cms-core/src/components/App/App.js @@ -32,7 +32,6 @@ TopBarProgress.config({ }); const AppMainContainer = styled.div` - min-width: 800px; max-width: 1440px; margin: 0 auto; `; diff --git a/packages/decap-cms-core/src/components/Collection/Collection.js b/packages/decap-cms-core/src/components/Collection/Collection.js index cdc3c0c111a7..09ffcb381ea0 100644 --- a/packages/decap-cms-core/src/components/Collection/Collection.js +++ b/packages/decap-cms-core/src/components/Collection/Collection.js @@ -26,16 +26,23 @@ import { } from '../../reducers/entries'; const CollectionContainer = styled.div` - margin: ${lengths.pageMargin}; + display: flex; + flex-direction: column; + gap: 20px; + margin: ${lengths.pageMarginMobile}; + @media (min-width: 500px) { + margin: ${lengths.pageMargin}; + } `; const CollectionMain = styled.main` - padding-left: 280px; + @media (min-width: 800px) { + padding-left: 280px; + } `; const SearchResultContainer = styled.div` ${components.cardTop}; - margin-bottom: 22px; `; const SearchResultHeading = styled.h1` diff --git a/packages/decap-cms-core/src/components/Collection/CollectionControls.js b/packages/decap-cms-core/src/components/Collection/CollectionControls.js index 5b15508d609c..40d491de5479 100644 --- a/packages/decap-cms-core/src/components/Collection/CollectionControls.js +++ b/packages/decap-cms-core/src/components/Collection/CollectionControls.js @@ -9,14 +9,15 @@ import GroupControl from './GroupControl'; const CollectionControlsContainer = styled.div` display: flex; + flex-flow: row-reverse wrap; align-items: center; - flex-direction: row-reverse; + gap: 6px 0; margin-top: 22px; width: ${lengths.topCardWidth}; max-width: 100%; - & > div { - margin-left: 6px; + @media (min-width: 500px) { + gap: 6px; } `; diff --git a/packages/decap-cms-core/src/components/Collection/CollectionTop.js b/packages/decap-cms-core/src/components/Collection/CollectionTop.js index 47d63e956d45..30eb917ced60 100644 --- a/packages/decap-cms-core/src/components/Collection/CollectionTop.js +++ b/packages/decap-cms-core/src/components/Collection/CollectionTop.js @@ -8,11 +8,12 @@ import { components, buttons, shadows } from 'decap-cms-ui-default'; const CollectionTopContainer = styled.div` ${components.cardTop}; - margin-bottom: 22px; `; const CollectionTopRow = styled.div` display: flex; + flex-wrap: wrap; + gap: 8px; align-items: center; justify-content: space-between; `; @@ -26,13 +27,13 @@ const CollectionTopNewButton = styled(Link)` ${shadows.dropDeep}; ${buttons.default}; ${buttons.gray}; + white-space: nowrap; padding: 0 30px; `; const CollectionTopDescription = styled.p` ${components.cardTopDescription}; - margin-bottom: 0; `; function getCollectionProps(collection) { diff --git a/packages/decap-cms-core/src/components/Collection/ControlButton.js b/packages/decap-cms-core/src/components/Collection/ControlButton.js index a31e04834a56..c4e0c5f0f488 100644 --- a/packages/decap-cms-core/src/components/Collection/ControlButton.js +++ b/packages/decap-cms-core/src/components/Collection/ControlButton.js @@ -8,6 +8,7 @@ const Button = styled(StyledDropdownButton)` ${buttons.medium}; ${buttons.grayText}; font-size: 14px; + white-space: nowrap; &:after { top: 11px; diff --git a/packages/decap-cms-core/src/components/Collection/Entries/Entries.js b/packages/decap-cms-core/src/components/Collection/Entries/Entries.js index 0ef11da57274..50e8d15fd5f1 100644 --- a/packages/decap-cms-core/src/components/Collection/Entries/Entries.js +++ b/packages/decap-cms-core/src/components/Collection/Entries/Entries.js @@ -9,6 +9,7 @@ import EntryListing from './EntryListing'; const PaginationMessage = styled.div` width: ${lengths.topCardWidth}; + max-width: 100%; padding: 16px; text-align: center; `; diff --git a/packages/decap-cms-core/src/components/Collection/Sidebar.js b/packages/decap-cms-core/src/components/Collection/Sidebar.js index 93fe974eda96..dc8291c1e681 100644 --- a/packages/decap-cms-core/src/components/Collection/Sidebar.js +++ b/packages/decap-cms-core/src/components/Collection/Sidebar.js @@ -5,7 +5,7 @@ import styled from '@emotion/styled'; import { css } from '@emotion/react'; import { translate } from 'react-polyglot'; import { NavLink } from 'react-router-dom'; -import { Icon, components, colors } from 'decap-cms-ui-default'; +import { Icon, components, colors, lengths } from 'decap-cms-ui-default'; import { searchCollections } from '../../actions/collections'; import CollectionSearch from './CollectionSearch'; @@ -21,19 +21,20 @@ const styles = { const SidebarContainer = styled.aside` ${components.card}; - width: 250px; + width: ${lengths.topCardWidth}; + max-width: 100%; padding: 8px 0 12px; - position: fixed; max-height: calc(100vh - 112px); display: flex; flex-direction: column; + @media (min-width: 800px) { + position: fixed; + width: 250px; + } `; const SidebarHeading = styled.h2` - font-size: 22px; - font-weight: 600; - line-height: 37px; - padding: 0; + ${components.cardTopHeading}; margin: 10px 20px; color: ${colors.textLead}; `; diff --git a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Collection.spec.js.snap b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Collection.spec.js.snap index 0cb6a889449c..76185d1dde88 100644 --- a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Collection.spec.js.snap +++ b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Collection.spec.js.snap @@ -3,11 +3,27 @@ exports[`Collection should render connected component 1`] = ` .emotion-0 { - margin: 28px 18px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + gap: 20px; + margin: 12px 8px; } -.emotion-2 { - padding-left: 280px; +@media (min-width: 500px) { + .emotion-0 { + margin: 28px 18px; + } +} + +@media (min-width: 800px) { + .emotion-2 { + padding-left: 280px; + } }
.emotion-0 { - margin: 28px 18px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + gap: 20px; + margin: 12px 8px; +} + +@media (min-width: 500px) { + .emotion-0 { + margin: 28px 18px; + } } -.emotion-2 { - padding-left: 280px; +@media (min-width: 800px) { + .emotion-2 { + padding-left: 280px; + } }
.emotion-0 { - margin: 28px 18px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + gap: 20px; + margin: 12px 8px; } -.emotion-2 { - padding-left: 280px; +@media (min-width: 500px) { + .emotion-0 { + margin: 28px 18px; + } +} + +@media (min-width: 800px) { + .emotion-2 { + padding-left: 280px; + } }
.emotion-0 { - margin: 28px 18px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + gap: 20px; + margin: 12px 8px; +} + +@media (min-width: 500px) { + .emotion-0 { + margin: 28px 18px; + } } -.emotion-2 { - padding-left: 280px; +@media (min-width: 800px) { + .emotion-2 { + padding-left: 280px; + } }
- (idx === 0 && - css` - margin-left: 0; - `) || - (idx === 2 && - css` - margin-right: 0; - `) || + idx > 0 && css` - &:before, - &:after { + &:before { content: ''; display: block; position: absolute; width: 2px; height: 80%; - top: 76px; + top: 36px; background-color: ${colors.textFieldBorder}; + @media (min-width: 800px) { + top: 76px; + } } &:before { - left: -23px; - } - - &:after { - right: -23px; + left: -7px; + @media (min-width: 500px) { + left: -10px; + } + @media (min-width: 800px) { + left: -23px; + } } `, column: css` - margin: 0 20px; transition: background-color 0.5s ease; border: 2px dashed transparent; border-radius: 4px; @@ -68,21 +78,21 @@ const styles = { hiddenColumn: css` display: none; `, - hiddenRightBorder: css` - &:not(:first-child):not(:last-child) { - &:after { - display: none; - } - } - `, }; const ColumnHeader = styled.h2` - font-size: 20px; + font-size: 16px; font-weight: normal; - padding: 4px 14px; + padding: 2px 6px; border-radius: ${lengths.borderRadius}; - margin-bottom: 28px; + white-space: nowrap; + margin-bottom: 6px; + + @media (min-width: 800px) { + font-size: 20px; + padding: 4px 12px; + margin-bottom: 28px; + } ${props => props.name === 'draft' && @@ -107,11 +117,21 @@ const ColumnHeader = styled.h2` `; const ColumnCount = styled.p` - font-size: 13px; + font-size: 11px; font-weight: 500; color: ${colors.text}; text-transform: uppercase; margin-bottom: 6px; + padding-inline: 6px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + min-width: 0; + + @media (min-width: 800px) { + font-size: 13px; + padding-inline: 12px; + } `; // This is a namespace so that we can only drop these elements on a DropTarget with the same @@ -188,7 +208,6 @@ class WorkflowList extends React.Component { styles.columnPosition(idx), isHovered && styles.columnHovered, isOpenAuthoring && currColumn === 'pending_publish' && styles.hiddenColumn, - isOpenAuthoring && currColumn === 'pending_review' && styles.hiddenRightBorder, ]} > diff --git a/packages/decap-cms-ui-default/src/styles.js b/packages/decap-cms-ui-default/src/styles.js index cae4887d1f7f..704331bcf495 100644 --- a/packages/decap-cms-ui-default/src/styles.js +++ b/packages/decap-cms-ui-default/src/styles.js @@ -94,6 +94,7 @@ const lengths = { borderWidth: '2px', topCardWidth: '682px', pageMargin: '28px 18px', + pageMarginMobile: '12px 8px', objectWidgetTopBarContainerPadding: '0 14px 14px', }; @@ -313,12 +314,16 @@ const components = { width: ${lengths.topCardWidth}; max-width: 100%; padding: 18px 20px; - margin-bottom: 28px; + margin-bottom: 22px; `, cardTopHeading: css` - font-size: 22px; + font-size: 20px; + line-height: 24px; + @media (min-width: 500px) { + font-size: 22px; + line-height: 26px; + } font-weight: 600; - line-height: 37px; margin: 0; padding: 0; `, @@ -327,6 +332,7 @@ const components = { color: ${colors.text}; font-size: 14px; margin-top: 8px; + margin-bottom: 0; `, objectWidgetTopBarContainer: css` padding: ${lengths.objectWidgetTopBarContainerPadding};