From fc728dfef4d4967b634495f3eaa4c176fdb7e3f1 Mon Sep 17 00:00:00 2001 From: aswanson-nr Date: Wed, 5 Jan 2022 15:08:45 -0800 Subject: [PATCH] feat: complete image styling --- src/components/PackTile.js | 65 ++++++++++-------------------- src/pages/instant-observability.js | 3 +- 2 files changed, 22 insertions(+), 46 deletions(-) diff --git a/src/components/PackTile.js b/src/components/PackTile.js index 5d582f878..c35a2b17e 100644 --- a/src/components/PackTile.js +++ b/src/components/PackTile.js @@ -9,14 +9,10 @@ import { Tag, Link, } from '@newrelic/gatsby-theme-newrelic'; -import { - SHIELD_LEVELS, - RESERVED_QUICKSTART_IDS, - QUICKSTARTS_COLLAPSE_BREAKPOINT, -} from '../data/constants'; +import { SHIELD_LEVELS, RESERVED_QUICKSTART_IDS } from '../data/constants'; import PackImg from './PackImg'; -const IMAGE_BREAKPOINT = 1080; +const IMAGE_BREAKPOINT = '1080px'; const VIEWS = { GRID: 'Grid view', @@ -76,28 +72,33 @@ const PackTile = ({ interactive css={css` overflow: hidden; - //display: flex; - //flex-direction: column; display: grid; grid-template-rows: 1fr 3.5fr 0.5fr; + grid-template-columns: auto; + ${view === VIEWS.GRID && + css` + @media screen and (max-width: ${IMAGE_BREAKPOINT}) { + grid-template-rows: 4.5fr 0.5fr; + } + `} + ${view === VIEWS.LIST && css` - margin-bottom: 1em; - display: grid; grid-template-columns: 1fr 3.5fr 0.5fr; - @media (max-width: 1080px) { + grid-template-rows: auto; + @media screen and (max-width: ${IMAGE_BREAKPOINT}) { grid-template-columns: 4.5fr 0.5fr; + } `} - - @media screen and (max-width: ${QUICKSTARTS_COLLAPSE_BREAKPOINT}) { - flex-direction: row; - } `} onClick={() => handlePackClick(id)} >
@@ -136,9 +125,6 @@ const PackTile = ({ css` width: 100%; flex: 1 1 auto; - @media (max-width: ${IMAGE_BREAKPOINT}px) { - width: 100%; - } `} `} > @@ -149,6 +135,7 @@ const PackTile = ({

{featured && ( diff --git a/src/pages/instant-observability.js b/src/pages/instant-observability.js index 6e625571f..86c9dd327 100644 --- a/src/pages/instant-observability.js +++ b/src/pages/instant-observability.js @@ -521,14 +521,13 @@ const QuickstartsPage = ({ data, location }) => { css` grid-auto-rows: 1fr; grid-template-columns: 1fr; - grid-gap: 0.25rem; + grid-gap: 1.25rem; `} `} >