diff --git a/.gitignore b/.gitignore index 5fbd257705..231211f4a2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,6 @@ logs *.log npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* lerna-debug.log* node_modules @@ -19,6 +16,15 @@ package-lock.json /cypress/videos/ /cypress/screenshots/ +# Yarn +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + # Editor directories and files .vscode/* !.vscode/extensions.json diff --git a/.nvmrc b/.nvmrc index 2f5ee741e0..8351c19397 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14.15.1 +14 diff --git a/package.json b/package.json index 2dbae442f8..f844bd697a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "build-storybook": "build-storybook" }, "dependencies": { - "vue": "^3.2.31" + "vue": "^3.2.31", + "yarn": "^1.22.19" }, "devDependencies": { "@babel/core": "^7.17.9", diff --git a/src/assets/scss/_grid.scss b/src/assets/scss/_grid.scss index 1e4d9393f6..a81f957e19 100644 --- a/src/assets/scss/_grid.scss +++ b/src/assets/scss/_grid.scss @@ -8,40 +8,45 @@ gap: $desktop-width-gutter; grid-template-columns: repeat(auto-fill, minmax(29.74%, 1fr)); } + +@mixin fourcol-grid { + gap: $desktop-width-gutter; + grid-template-columns: repeat(auto-fill, minmax(21%, 1fr)); +} ////// Inner Grid @mixin inner-grid($parent) { - .inner--grid.grid--twocol--50-50 { + .list-container--grid.grid--twocol--50-50 { @if $parent >= 50 { - @include breakpoint(md) { - .list-container { + @include breakpoint(sm) { + .list-container__inner { display: grid; @include twocol-grid; - // @todo Remove when uiowa/uiowa#2670 and uiowa/uiowa#2554 are resolved. - .card.card--media-left, - .card.card--media-right { - margin-bottom: 0; - } } } @media screen and (min-width: 58.125em) { - .list-container { + .list-container__inner { gap: $desktop-width-gutter; grid-template-columns: 1fr 1fr; } } } } - .inner--grid.grid--threecol--33-34-33 { + .list-container--grid.grid--threecol--33-34-33 { @if $parent >= 75 { @media screen and (min-width: 58.125em) { - .list-container { + .list-container__inner { display: grid; @include threecol-grid; - // @todo Remove when uiowa/uiowa#2670 and uiowa/uiowa#2554 are resolved. - .card.card--media-left, - .card.card--media-right { - margin-bottom: 0; - } + } + } + } + } + .list-container--grid.grid--fourcol--25 { + @if $parent >= 75 { + @media screen and (min-width: 58.125em) { + .list-container__inner { + display: grid; + @include fourcol-grid; } } } @@ -55,7 +60,7 @@ } @mixin grid-base { - @include breakpoint(md) { + @include breakpoint(sm) { @include display-grid; grid-template-columns: 1fr; } diff --git a/src/assets/scss/_utilities.scss b/src/assets/scss/_utilities.scss index 4496a06ac4..2e308f145d 100755 --- a/src/assets/scss/_utilities.scss +++ b/src/assets/scss/_utilities.scss @@ -200,7 +200,10 @@ @mixin border { border: 1px solid; - border-color: rgba(0,0,0,.425); + border-color: rgba(0,0,0,.125); + [class*="bg--black"] & { + border-color: hsla(0,0%,100%,.325); + } } @mixin text-light { diff --git a/src/components/button/button.scss b/src/components/button/button.scss index ebb1805710..74f813d349 100755 --- a/src/components/button/button.scss +++ b/src/components/button/button.scss @@ -87,18 +87,6 @@ [class*="bg--black"] [class*="bg--gold"] & { color: $secondary; } - - &:after { - [class*="bg--gold"] &, - [class*="bg--white"] [class*="bg--gold"] & { - background: #fff; - } - - [class*="bg--white"] &, - [class*="bg--gold"] [class*="bg--white"] & { - background: $primary; - } - } } .bttn.borderless { diff --git a/src/components/card/Card.stories.js b/src/components/card/Card.stories.js index 6073826ac5..18e9f85bea 100644 --- a/src/components/card/Card.stories.js +++ b/src/components/card/Card.stories.js @@ -15,12 +15,12 @@ export default { // Props headline_style: { name: 'Title style', - options: ['', 'serif'], + options: ['serif', ''], control: { type: 'select', labels: { - '': 'default', - serif: 'Serif', + 'serif': 'Zilla Slab (default)', + '': 'Roboto', }, }, table: { @@ -121,11 +121,52 @@ export default { category: 'Content', }, }, - }, - parameters: { - viewport: { - viewports: parameters.viewport.viewports, - defaultViewport: 'mobile2', + section_background: { + name: 'Section background', + options: [ + '', + 'bg--black', + 'bg--black--pattern--brain', + 'bg--black--pattern--community', + 'bg--black--pattern--particle', + 'bg--gold', + 'bg--gold--pattern--brain', + 'bg--gold--pattern--community', + 'bg--gold--pattern--particle', + 'bg--gray', + 'bg--gray--pattern--brain', + 'bg--gray--pattern--community', + 'bg--gray--pattern--particle', + 'bg--white', + 'bg--white--pattern--brain', + 'bg--white--pattern--community', + 'bg--white--pattern--particle', + ], + control: { + type: 'select', + labels: { + '': '- None -', + 'bg--black': 'Black', + 'bg--black--pattern--brain': 'Black - Brain pattern', + 'bg--black--pattern--community': 'Black - Community pattern', + 'bg--black--pattern--particle': 'Black - Particle pattern', + 'bg--gold': 'Gold', + 'bg--gold--pattern--brain': 'Gold - Brain pattern', + 'bg--gold--pattern--community': 'Gold - Community pattern', + 'bg--gold--pattern--particle': 'Gold - Particle pattern', + 'bg--gray': 'Gray', + 'bg--gray--pattern--brain': 'Gray - Brain pattern', + 'bg--gray--pattern--community': 'Gray - Community pattern', + 'bg--gray--pattern--particle': 'Gray - Particle pattern', + 'bg--white': 'White', + 'bg--white--pattern--brain': 'White - Brain pattern', + 'bg--white--pattern--community': 'White - Community pattern', + 'bg--white--pattern--particle': 'White - Particle pattern', + }, + }, + table: { + category: 'Container', + }, }, }, } @@ -140,27 +181,33 @@ const Template = (args) => ({ }, // And then the `args` are bound to your component with `v-bind="args"` template: ` - - - - - - - +
+
+
+ + + + + + + +
+
+
`, }) @@ -177,15 +224,16 @@ Default.args = { link_text: 'Explore the arts', link_indicator: true, button_align_bottom: false, - headline_style: '', + headline_style: 'serif', borderless: false, background: '', centered: false, orientation: '', media_border: false, - media_size: '', + media_size: 'large', media_shape: 'widescreen', media_padded: false, + section_background: '', } export const LinkedWithNoButtonText = Template.bind({}); @@ -289,31 +337,33 @@ const GridTemplate = (args) => ({ }, // And then the `args` are bound to your component with `v-bind="args"` template: ` - - - - - - - - - - - +
+ + + + + + + + + + + +
`, }) diff --git a/src/components/card/card.scss b/src/components/card/card.scss index 5ec598383f..9dc690f9b2 100755 --- a/src/components/card/card.scss +++ b/src/components/card/card.scss @@ -8,8 +8,6 @@ display: flex; flex-direction: row; flex-grow: 1; - flex-wrap: wrap; - margin-bottom: 1.6rem; padding: 2rem; text-decoration: none; @include border; @@ -17,10 +15,6 @@ @include flex($fg: 1, $fs: 1, $fb: 0%); @include flex-direction($value: column); - @include breakpoint(sm) { - margin-bottom: 0; - } - h2, h3, h4, @@ -52,7 +46,7 @@ } header { - margin: 0 0 $sm; + margin: 0 0 0.525rem; padding: 0; font-size: 1.5rem; font-weight: $font-weight-medium; @@ -88,7 +82,7 @@ footer { .bttn { - margin-top: 2rem; + margin-top: 1.25rem; } } } @@ -98,19 +92,39 @@ // === Media === // .card { // Overrides for shared media classes. - .media { - margin-left: auto; - margin-right: auto; + + > .media { margin-top: 0; text-align: center; + min-width: 9.375rem; - &.media--circle { - display: block; + img { + width: 100%; + object-fit: cover; + } - // @todo remove when https://github.com/uiowa/uids/issues/805 is implemented. - &.media--small { - max-width: 150px; - } + // @todo this collides with uids_base iframe styles. + //embed, + //iframe, + //object, + //video { + // position: relative; + // top: 0; + // bottom: 0; + // left: 0; + // width: 100%; + // height: 100%; + // border: 0; + //} + + iframe { + border: none; + } + + &.media--small.media--circle, + &.media--medium.media--circle { + margin-left: auto; + margin-right: auto; } } @@ -121,6 +135,41 @@ margin-top: -2rem; margin-bottom: 2rem; } + + .media--circle { + display: block; + + // We override padding for the circle format since it doesn't look good against the edges. + // Allows the media to run edge to edge for stacked cards. + .media__inner { + margin-left: 0; + margin-top: 0; + margin-right: 0; + } + &.media--small { + max-width: 9.375rem; + } + &.media--medium { + max-width: 15.625rem; + @include breakpoint(sm) { + max-width: 60%; + } + } + } + + .media--square { + img, + iframe { + aspect-ratio: 1 / 1; + } + } + + .media--widescreen { + img, + iframe { + aspect-ratio: 16 / 9; + } + } } // === End: Media === // @@ -130,7 +179,7 @@ font-family: $font-family-serif; font-size: 1.3rem; font-weight: $font-weight-medium; - line-height: 1.3; + line-height: 1.4; } // === End: Subtitle === // @@ -151,6 +200,15 @@ } } // === End: Meta === // + +// === Body === // +.card__body { + line-height: 1.7; + word-wrap: anywhere; + overflow-wrap: anywhere; +} +// === End: Body === // + // === End: Elements === // // === Modifiers === // @@ -227,24 +285,58 @@ // === Layout left and layout right shared === // .card--layout-left, .card--layout-right { + .media__inner { + + } @include breakpoint(sm) { display: flex; - flex-wrap: nowrap; - flex-direction: unset; + flex-direction: row; width: 100%; - margin-bottom: 1.6rem; .media__inner { margin-bottom: 0; margin-left: 0; - margin-top: 0; margin-right: 0; + margin-top: 0; } } > * { flex-basis: 100%; } + + .media--small.media--circle { + max-width: 11.375rem; + } + + .media--small.media--square { + @include breakpoint(sm) { + max-width: 11.375rem; + } + } + + .media--small.media--widescreen { + @include breakpoint(sm) { + max-width: 15.625rem; + } + } + + .media--medium { + &.media--circle { + @include breakpoint(sm) { + max-width: none; + } + } + @include breakpoint(sm) { + flex: 0 0 35%; + } + } + + .media--large { + @include breakpoint(sm) { + flex: 0 0 52.5%; + } + } } // === End: Layout left and layout right shared === // @@ -253,7 +345,9 @@ @include breakpoint(sm) { flex-direction: row; - .media__inner { + .media__inner, + // Add margin back in for media--circle since we removed it before. + .media--circle .media__inner { margin-right: 2rem; } } @@ -265,10 +359,33 @@ @include breakpoint(sm) { flex-direction: row-reverse; - .media__inner { + .media__inner, + // Add margin back in for media--circle since we removed it before. + .media--circle .media__inner { margin-left: 2rem; } } } // === End: Layout right === // + +// === Background colors === // +// Remove padding if container background matches card background with borderless. +$bg-colors: "white", "gray", "black", "gold"; + +@each $color in $bg-colors { + .bg--#{$color} { + .card.bg--#{$color}[class*="borderless"] { + padding: 0; + &:not([class*="card--layout"]) { + .media__inner { + margin-left: 0; + margin-right: 0; + margin-top: 0; + } + } + } + } +} + +// === End: Background colors === // /* === End: Card modifiers === */ diff --git a/src/components/grid/Grid.vue b/src/components/grid/Grid.vue index 74d4af5c6b..277bb13861 100644 --- a/src/components/grid/Grid.vue +++ b/src/components/grid/Grid.vue @@ -1,6 +1,6 @@