diff --git a/components/vf-design-tokens/CHANGELOG.md b/components/vf-design-tokens/CHANGELOG.md index 0753999084..388119a922 100644 --- a/components/vf-design-tokens/CHANGELOG.md +++ b/components/vf-design-tokens/CHANGELOG.md @@ -1,3 +1,7 @@ +### 3.1.0 + +* adds `--1600` (`4rem`) spacing token. + ### 3.0.0 * We're moving the documentation to the `vf-component-library` diff --git a/components/vf-design-tokens/dist/json/vf-spacing.ios.json b/components/vf-design-tokens/dist/json/vf-spacing.ios.json index 5aa1375e84..1a7f67ea7d 100644 --- a/components/vf-design-tokens/dist/json/vf-spacing.ios.json +++ b/components/vf-design-tokens/dist/json/vf-spacing.ios.json @@ -107,6 +107,18 @@ "CSSCustomProperty": "--vf-spacing--1200", "comment": null } + }, + { + "type": "number", + "category": "spacing", + "name": "vfSpacing1600", + "value": "4rem", + "meta": { + "friendlyName": "Spacing 1600", + "sassVariable": "$vf-spacing--1600", + "CSSCustomProperty": "--vf-spacing--1600", + "comment": null + } } ] } \ No newline at end of file diff --git a/components/vf-design-tokens/dist/sass/custom-properties/vf-spacing.custom-properties.scss b/components/vf-design-tokens/dist/sass/custom-properties/vf-spacing.custom-properties.scss index b9bb1822d8..bc0ed731cc 100644 --- a/components/vf-design-tokens/dist/sass/custom-properties/vf-spacing.custom-properties.scss +++ b/components/vf-design-tokens/dist/sass/custom-properties/vf-spacing.custom-properties.scss @@ -13,4 +13,5 @@ --vf-spacing--600: 1.5rem; --vf-spacing--800: 2rem; --vf-spacing--1200: 3rem; + --vf-spacing--1600: 4rem; } diff --git a/components/vf-design-tokens/dist/sass/maps/vf-spacing.map.scss b/components/vf-design-tokens/dist/sass/maps/vf-spacing.map.scss index f66c714772..5a0aa2a089 100644 --- a/components/vf-design-tokens/dist/sass/maps/vf-spacing.map.scss +++ b/components/vf-design-tokens/dist/sass/maps/vf-spacing.map.scss @@ -13,4 +13,5 @@ $vf-spacing-map: ( 'vf-spacing--600': (1.5rem), 'vf-spacing--800': (2rem), 'vf-spacing--1200': (3rem), + 'vf-spacing--1600': (4rem), ); diff --git a/components/vf-design-tokens/src/maps/vf-spacing.yml b/components/vf-design-tokens/src/maps/vf-spacing.yml index 7c479a0b99..2499734350 100644 --- a/components/vf-design-tokens/src/maps/vf-spacing.yml +++ b/components/vf-design-tokens/src/maps/vf-spacing.yml @@ -62,6 +62,13 @@ props: sassVariable: $vf-spacing--1200 CSSCustomProperty: --vf-spacing--1200 comment: + - name: vf-spacing--1600 + value: 4rem + meta: + friendlyName: Spacing 1600 + sassVariable: $vf-spacing--1600 + CSSCustomProperty: --vf-spacing--1600 + comment: global: type: number category: spacing diff --git a/components/vf-hero/CHANGELOG.md b/components/vf-hero/CHANGELOG.md index c11ae77bfb..4b30da47b2 100755 --- a/components/vf-hero/CHANGELOG.md +++ b/components/vf-hero/CHANGELOG.md @@ -1,7 +1,21 @@ +### 2.0.0 + +* introduces new naming convention for design variants. + * `--inverted`: that inverts the foreground and background colours + * `--flush`: pulls the `vf-hero__content` to the bottom of the `vf-hero`. + * `--offset`: pulls the `vf-hero__content` below the `vf-hero` container. + * `--centered`: centres the `vf-hero__content` component. + * `--block`: makes the `vf-hero__content` bleed all the way ot the left of the page. + * `--striped`: inverts the `vf-hero__text` to that of what's set in `vf-hero__content`. + * `--800`, `--1200`, and `--1600` spacing variants. +* replaces `vf-hero-theme--` with `vf-hero--` for the `primary`, `secondary`, and `tertiary` variants. +* removes the 'Mortal Kombat' naming convention. +* reduces visible options of the new `vf-hero`. +* older versions (v2) degrade gracefully to the default variant. + ### 1.8.0 -* removes the JavaScript for the `--intense` version due to an issue in Safari 14 and iOS - * https://github.com/visual-framework/vf-core/pull/1241 +* deprecates the `--intense` variant. ### 1.7.1 diff --git a/components/vf-hero/README.md b/components/vf-hero/README.md index 16b77464cf..663486886a 100755 --- a/components/vf-hero/README.md +++ b/components/vf-hero/README.md @@ -4,15 +4,97 @@ ## About -The `vf-hero` component is to be used as a visual queue and page header. The `vf-hero` can take a heading, sub-heading, and text content. The text content can also be a link which adds am arrow icon. +The `vf-hero` component is to be used as a visual queue and page header. The `vf-hero` can take a heading, sub-heading, and text content. The text (`vf-hero__text`) content can also be a 'call to action' link which adds am arrow icon. ## Usage +Currently there are now two use cases for the `vf-hero` component: + + +### Landing Pages + +For landing pages like the home page, or a location page can take an image (provided by Design) which should be uploaded to [the files site](https://www.embl.org/files) and applied using the custom property available (`--vf-hero--bg-image`). + +The `vf-hero` for landing pgaes make use of the classes `vf-hero--primary` and `vf-hero--1200` to standardise the layout through out embl.org. + +By default the `vf-hero` for landing pages make use of the roundels bacground image. To keep the raw struture of the HTML and CSS the same this is applied using a CSS custom property. IE 11 will get the background colour still, but no image. This is progressive enhancement. + +The basic HTML structure for landing pages is: + +``` +
+ +
+ +

+ About the Hentze group! +

+ +

an example of some ancillary text

+ +

The Hentze group combines biochemical and systems–level approaches to investigate the connections between gene expression and cell metabolism, and their roles in human disease.

+ +
+ +
+``` + +--- +### Group Sites + +For group sites that exist like a sub-site or microsite as part of embl.org they are afforded their own specific `vf-hero`. + +The `vf-hero` for group sites make use of the classes `vf-hero--primary`, `vf-hero--block`, and `vf-hero--800` to standardise the layout through out embl.org. + +By default the `vf-hero` for group sites make use of the roundels background image. To keep the raw struture of the HTML and CSS the same this is applied using a CSS custom property. IE 11 will get the background colour still, but no image. This is progressive enhancement. + +If group leaders wish to, they can include some additional content to the heading such as their group location, and if it's part of a bigger group with the HTML structure: + +``` +

+ Strategy & Communications + + VF Hamburg | Structural Biology + +

+``` + +
+ +The basic HTML structure for the group site `vf-hero` is: + + +``` +
+ +
+ +

+ + + Strategy & Communications + + + VF Hamburg | Structural Biology + +

+ +

Chromosome structure and dynamics

+ +
+ +
+``` + + + +As the group sites variant of the `vf-hero` is used to announce the group name and some short additional information, it does not allow for the inclusion of the `vf-hero__text` element. + ### CSS Custom Properties -`--vf-hero-bg-image` — this is for the url for the background image. It can either be added, inline if you're writing the HTML, using the `.yml` data source of `vf_hero_image`, or by other needs (a input or upload in WordPress, for example). +`--vf-hero--bg-image` — this is for the url for the background image. It can either be added, inline if you're writing the HTML, using the `.yml` data source of `vf_hero_image`, or by other needs (a input or upload in WordPress, for example). -`--vf-hero-grid__row--initial` — This is used to represent the heigh of the image and helps calculate the position of the content, depending on the variant you have chosen. +`---vf-hero--bg-image-size` — this is to determine the sizing of the background image. As group sites are using the roundel image it needs specific dimensions so that it works. These dimensions are `auto 28.5rem`. We use a fallback here as background images in `vf-hero` should be full bleed by default so the fall back in the CSS is for cover — `var(---vf-hero--bg-image-size, cover)`. For ## Install diff --git a/components/vf-hero/vf-hero--example.njk b/components/vf-hero/vf-hero--example.njk deleted file mode 100644 index f4fcf48942..0000000000 --- a/components/vf-hero/vf-hero--example.njk +++ /dev/null @@ -1,63 +0,0 @@ -
- -
- {% if vf_hero_heading %}

{{ vf_hero_heading }}

{% endif %} -

{{ vf_hero_text }} {{ vf_hero_link_text }}

-
- -
- -
- - -
- {% if vf_hero_heading %}

{{ vf_hero_heading }}

{% endif %} -

{{ vf_hero_text }} {{ vf_hero_link_text }}

-
- -
- -
- - -
- {% if vf_hero_heading %}

{{ vf_hero_heading }}

{% endif %} -

{{ vf_hero_text }} {{ vf_hero_link_text }}

-
- -
- -
- - -
- {% if vf_hero_heading %}

{{ vf_hero_heading }}

{% endif %} -

{{ vf_hero_text }} {{ vf_hero_link_text }}

-
- -
- -
- - - - -
- {% if vf_hero_heading %}

{{ vf_hero_heading }}

{% endif %} -

{{ vf_hero_text }} {{ vf_hero_link_text }}

-
-
- - - - -
-
- -
- -
- {% if vf_hero_heading %}

{{ vf_hero_heading }}

{% endif %} -

{{ vf_hero_text }} {{ vf_hero_link_text }}

-
-
diff --git a/components/vf-hero/vf-hero.config.yml b/components/vf-hero/vf-hero.config.yml index 121eee6be7..61bf229544 100755 --- a/components/vf-hero/vf-hero.config.yml +++ b/components/vf-hero/vf-hero.config.yml @@ -3,61 +3,174 @@ title: Hero # Label shown on index pages label: Hero status: alpha -preview: '@preview--nogrid' +preview: "@preview--nogrid" # The template used from /components/_previews # # Per-variant options # variants: - # - name: default - # hidden: true +# - name: default +# hidden: true context: component-type: container - modifier_class: vf-hero--easy vf_hero_subheading: an example of some ancillary text vf_hero_text: - - The Hentze group combines biochemical and systems–level approaches to investigate the connections between gene expression and cell metabolism, and their roles in human disease. + - The Hentze group combines biochemical and systems–level approaches to investigate the connections between gene expression and cell metabolism, and their roles in human disease. vf_hero_link_text: Learn more. vf_hero_heading: About the Hentze group! - vf_hero__initial_row: 16em; - vf_hero_image: url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/vf-hero-intense.png'); variants: - name: default + hidden: false + context: + spacing: 1200 + newTheme: primary + vf_hero_image_size: auto 28.5rem + - name: default with inline link + hidden: false + context: + newTheme: primary + spacing: 1200 + vf_hero_text: Learn more. + vf_hero_href: JavaScript:Void(0); + - name: default with image + hidden: false + context: + newTheme: primary + spacing: 1200 + vf_hero_image: url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/vf-hero-intense.png'); + + - name: default with image and inline link + hidden: false + context: + newTheme: primary + spacing: 1200 + vf_hero_image: url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/vf-hero-intense.png'); + vf_hero_text: Learn more. + vf_hero_href: JavaScript:Void(0); + - name: default block + hidden: false + context: + vf_hero_heading: Strategy & Communications + vf_hero_subheading: Chromosome structure and dynamics + vf_hero_heading_additional: VF Hamburg | Structural Biology + vf_hero_image_size: auto 28.5rem + spacing: 800 + newTheme: primary + block: true + vf_hero_text: null + - name: block with image + hidden: false + context: + vf_hero_heading: Strategy & Communications + vf_hero_subheading: Chromosome structure and dynamics + vf_hero_heading_additional: VF Hamburg | Structural Biology + vf_hero_image: url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/vf-hero-intense.png'); + spacing: 800 + newTheme: primary + block: true + vf_hero_text: null + + - name: inverted + hidden: true + context: + spacing: 1200 + inverted: true + newTheme: primary + - name: offset hidden: true - - name: example + context: + offset: true + - name: centered hidden: true - - name: very easy context: - modifier_class: vf-hero--very-easy - - name: easy + centered: true + - name: flush + hidden: true context: - modifier_class: vf-hero--easy - - name: easy with link + flush: true + - name: centered offset + hidden: true context: - modifier_class: vf-hero--easy - vf_hero_href: 'JavaScript:Void(0);' - - name: normal + offset: true + centered: true + - name: centered flush + hidden: true context: - modifier_class: vf-hero--normal - - name: hard + flush: true + centered: true + - name: spacing (800) + hidden: true context: - modifier_class: vf-hero--hard - - name: extreme + spacing: 800 + - name: spacing (1200) hidden: true context: - modifier_class: vf-hero--extreme - - name: intense + spacing: 1200 + - name: spacing (1600) + hidden: true context: - vf_hero_summary_title: Europe wide, global impact, infinite curiosity. - vf_hero_href: https://www.embl.de/aboutus/general_information/mission/index.html - vf_hero_text: Learn more about EMBL’s contribution to society - modifier_class: vf-hero--intense + spacing: 1600 - name: primary + hidden: true context: - modifier_class: vf-hero-theme--primary + newTheme: primary - name: secondary + hidden: true context: - modifier_class: vf-hero-theme--secondary + newTheme: secondary - name: tertiary + hidden: true + context: + newTheme: tertiary + - name: striped + hidden: true + context: + striped: true + - name: striped - inverted + hidden: true + context: + striped: true + + - name: flush - block + hidden: true + context: + vf_hero_heading: Strategy & Communications + vf_hero_subheading: Chromosome structure and dynamics + vf_hero_heading_additional: VF Hamburg | Structural Biology + block: true + flush: true + vf_hero_text: null + - name: block - inverted + hidden: true + context: + vf_hero_heading: Strategy & Communications + vf_hero_subheading: Chromosome structure and dynamics + vf_hero_heading_additional: VF Hamburg | Structural Biology + newTheme: primary + inverted: true + block: true + vf_hero_text: null + + - name: block - striped + hidden: true + context: + vf_hero_heading: Strategy & Communications + vf_hero_subheading: Chromosome structure and dynamics + striped: true + block: true + - name: block - striped - inverted + hidden: true + context: + vf_hero_heading: Strategy & Communications + vf_hero_subheading: Chromosome structure and dynamics + inverted: true + striped: true + block: true + - name: block - striped - flush + hidden: true context: - modifier_class: vf-hero-theme--tertiary + vf_hero_heading: Strategy & Communications + vf_hero_subheading: Chromosome structure and dynamics + striped: true + block: true + flush: true diff --git a/components/vf-hero/vf-hero.njk b/components/vf-hero/vf-hero.njk index 5e1d4f3c81..3b184a47ed 100755 --- a/components/vf-hero/vf-hero.njk +++ b/components/vf-hero/vf-hero.njk @@ -1,19 +1,10 @@ {%- if context %} - {% set card_href = context.card_href %} - {% set vf_hero__initial_row = context.vf_hero__initial_row %} {% set vf_hero_heading = context.vf_hero_heading %} {% set vf_hero_summary_title = context.vf_hero_summary_title %} {% set vf_hero_subheading = context.vf_hero_subheading %} {% set vf_hero_image = context.vf_hero_image %} - {% set vf_hero_href = context.vf_hero_href %} - {% set vf_hero_text = context.vf_hero_text %} - {% set hero_text = context.hero_text %} - - {% set theme = context.theme %} - {% set variant = context.variant %} - {% set id = context.id %} {% set modifier_class = context.modifier_class %} {% set override_class = context.override_class %} @@ -21,29 +12,56 @@
-
- {% if vf_hero_heading %}

{{ vf_hero_heading }}

{% endif %} - {% if (vf_hero_summary_title) or (vf_hero_subheading) %}

{{ vf_hero_summary_title }}{{vf_hero_subheading}}

{% endif %} - {% if vf_hero_href %} + {% if vf_hero_image %}--vf-hero--bg-image: {{vf_hero_image}}{% endif %} + {% if vf_hero_image_size %}--vf-hero--bg-image-size: {{vf_hero_image_size}}{% endif %} + "> + {% if deprecated_text %}{% endif %} +
+ {% if vf_hero_heading %} +

+ {{ vf_hero_heading }} + {%- if vf_hero_heading_additional -%} + {{ vf_hero_heading_additional }} + {%- endif -%} +

+ {% endif %} + {% if vf_hero_subheading %}

{{vf_hero_subheading}}

{% endif %} + {%- if vf_hero_text %}

{%- if vf_hero_href %} - {{ vf_hero_text }} + + {{- vf_hero_text -}} + + {% else %} - {{ vf_hero_text | safe }} - {% endif %} -

- {% else %} - {% asyncEach hero_text in vf_hero_text -%} -

+ {% asyncEach hero_text in vf_hero_text -%} {{ hero_text | safe }} + {% endeach %} + {% endif %}

- {% endeach %} {% endif %}
-
diff --git a/components/vf-hero/vf-hero.scss b/components/vf-hero/vf-hero.scss index 58aa48f869..43d6d12f24 100755 --- a/components/vf-hero/vf-hero.scss +++ b/components/vf-hero/vf-hero.scss @@ -12,401 +12,292 @@ @import 'vf-hero.variables.scss'; .vf-hero { + --vf-hero--spacing: #{map-get($vf-spacing-map, vf-spacing--800)}; - --vf-hero-content-box-shadow: none; + background-color: var(--vf-hero--bg-color, #{set-color(vf-color--green)}); + background-image: url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/roundels.png'); + background-image: var(--vf-hero--bg-image, url('https://acxngcvroo.cloudimg.io/v7/https://www.embl.org/files/wp-content/uploads/roundels.png')); + margin-bottom: map-get($vf-spacing-map, vf-spacing--800); + margin-bottom: var(--vf-hero--spacing, #{map-get($vf-spacing-map, vf-spacing--800)}); + padding: map-get($vf-spacing-map, vf-spacing--800) 0; + padding: var(--vf-hero--spacing, #{map-get($vf-spacing-map, vf-spacing--800)}) 0; +} + +.vf-hero.vf-u-fullbleed::before { + background-size: cover; + background-size: var(--vf-hero--bg-image-size, cover); + z-index: 1; +} + +.vf-hero__content { background-color: set-ui-color(vf-ui-color--white); - background-color: rgba( - calc( (0 + var(--vf-hero-bg-color) ) * 255), - calc( (0 + var(--vf-hero-bg-color) ) * 255), - calc( (0 + var(--vf-hero-bg-color) ) * 255), - calc( (0 + var(--vf-hero-bg-color) ) * 100) - ); - grid-column: 1 / -1; - - display: grid; - grid-template-columns: minmax(var(--page-grid-gap), auto) [hero-start] minmax(288px, $vf-layout--comfortable) [hero-end] minmax(var(--page-grid-gap), auto); - grid-template-rows: calc(var(--vf-hero-grid__row--initial, var(--vf-hero-grid__row--initial, 260px)) * var(--vf-hero-grid-row--multiplier, .4)) max-content; - margin-bottom: 2rem; + background-color: var(--vf-hero-content--bg-color, set-ui-color(vf-ui-color--white)); + color: set-ui-color(vf-ui-color--black); + color: var(--vf-hero-content--fg-color, set-ui-color(vf-ui-color--black)); + box-shadow: + 2px 0 3px rgba(0, 0, 0, .1), + -2px 0 3px rgba(0, 0, 0, .1), + 0 2px 3px rgba(0, 0, 0, .1); + max-width: 60ch; + padding: map-get($vf-spacing-map, vf-spacing--400); + padding: calc( var(--vf-hero--spacing) / 2); position: relative; + z-index: set-layer(vf-z-index--hero); - &:not(.vf-hero--very-easy):not(.vf-hero--intense) { - &::before { - background-image: var(--vf-hero-bg-image); - content: ''; - grid-column: 1 / -1; - grid-row: 1 / span 1; - background-position: top center; - background-repeat: no-repeat; - background-size: cover; - margin-left: calc(50% - 50vw); - height: var(--vf-hero-grid__row--initial, 320px); - width: 100vw; - } + @supports (filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, .1))) { + box-shadow: unset; + filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, .25)); } +} - .vf-link { - color: inherit; - display: inline-block; - - svg { - fill: currentColor; - margin-left: .5rem; - } +.vf-hero__heading { + @include set-type(text-heading--1, $custom-margin-bottom: 0); - &:focus, - &:hover, - &:visited { - color: inherit; + display: flex; + flex-direction: column-reverse; + word-break: break-word; - svg { - transform: translateX(.25rem); - } - } + a { + color: inherit; + text-decoration: none; } } -.vf-hero__content { - grid-column: 2 / span 1; - max-width: 760px; - width: 100%; -} +.vf-hero__heading--additional { + @include set-type(text-body--3, $custom-margin-bottom: 0); -.vf-hero__heading { - @include set-type(text-heading--3); + position: relative; - // positions to the left - display: inline-block; - margin: 0; - padding: 1rem .5rem .5rem; + a { + color: currentColor; + text-decoration: none; + } } .vf-hero__subheading { - @include set-type(text-heading--4, $custom-margin-bottom: 0); - background-color: rgb(calc( (0 + var(--vf-hero-heading-bg-color) ) * 255), calc( (0 + var(--vf-hero-heading-bg-color) ) * 255), calc( (0 + var(--vf-hero-heading-bg-color) ) * 255)); - box-sizing: border-box; - color: rgb(calc( (0 + var(--vf-hero-heading-text-color) ) * 255), calc( (0 + var(--vf-hero-heading-text-color) ) * 255), calc( (0 + var(--vf-hero-heading-text-color) ) * 255)); - display: inline-block; - margin: 0 !important; // needed until we can safely remove `vf-summary__title` from markup - padding: .5rem; - width: 100%; + --vf-stack-margin--custom: 0; } .vf-hero__text { - @include set-type(text-body--2); - line-height: 2; - margin-bottom: 0; - padding: .5rem; -} - - -.vf-hero { - --vf-hero__padding: 0; - - --vf-hero-content-shadow-alpha: .1; - --vf-hero-heading-bg-color: 1; - --vf-hero-heading-text-color: 0; + @include set-type(text-body--2, $custom-margin-bottom: 0); - --vf-hero-text-bg-color: 0; - --vf-hero-text-color: 1; + a { + color: set-color(vf-color--blue); + text-decoration: none; + } + a:focus, + a:hover, + a:visited { + color: set-color(vf-color--blue--dark); + text-decoration: underline; + } } -.vf-hero__content { - background-color: set-ui-color(vf-ui-color--white); - background-color: rgba( - calc( (0 + var(--vf-hero__content-bg-color) ) * 255), - calc( (0 + var(--vf-hero__content-bg-color) ) * 255), - calc( (0 + var(--vf-hero__content-bg-color) ) * 255), - calc( (0 + var(--vf-hero__content-bg-color) ) * 100) - ); +.vf-hero__link { + align-items: center; + color: set-color(vf-color--blue--dark); + display: inline-flex; - // box-shadow: 2px 0 3px rgba(0, 0, 0, .1), -2px 0 3px rgba(0, 0, 0, .1), 0 2px 3px rgba(0, 0, 0, .1); - box-shadow: var(--vf-hero-content-box-shadow); + svg { + fill: currentColor; + margin-left: map-get($vf-spacing-map, vf-spacing--200); + } - padding: calc( (0 + var(--vf-hero__padding) ) * .1em ); - - z-index: set-layer(vf-z-index--hero); -} + &:focus, + &:hover, + &:visited { + color: set-color(vf-color--blue--dark); + svg { + transform: translateX(.25rem); + } + } -.vf-hero__heading { - background-color: rgb(calc( (0 + var(--vf-hero-heading-bg-color) ) * 255), calc( (0 + var(--vf-hero-heading-bg-color) ) * 255), calc( (0 + var(--vf-hero-heading-bg-color) ) * 255)); - color: rgb(calc( (0 + var(--vf-hero-heading-text-color) ) * 255), calc( (0 + var(--vf-hero-heading-text-color) ) * 255), calc( (0 + var(--vf-hero-heading-text-color) ) * 255)); + &:hover, + &:hover { + text-decoration: none; + } } -.vf-hero__text { - --vf-hero-text-bg-color--default: calc( var(--vf-hero-text-bg-color) * 255); +// ---------------------------------------------------------------------- +// variants +// ---------------------------------------------------------------------- - background-color: rgb(var(--vf-hero-text-bg-color--r, var(--vf-hero-text-bg-color--default)), var(--vf-hero-text-bg-color--g, var(--vf-hero-text-bg-color--default)), var(--vf-hero-text-bg-color--b, var(--vf-hero-text-bg-color--default))); - - color: rgb(calc( (0 + var(--vf-hero-text-color) ) * 255), calc( (0 + var(--vf-hero-text-color) ) * 255), calc( (0 + var(--vf-hero-text-color) ) * 255)); +// themes +// ---------------------------------------------------------------------- +.vf-hero--primary { + --vf-hero--bg-color: #{set-color(vf-color--green)}; } - - -.vf-hero--very-easy { - --vf-hero__content-bg-color: 1; - --vf-hero-bg-color: 1; - --vf-hero-text-bg-color: 1; - --vf-hero-text-color: 0; - --vf-hero-grid__row--initial: 1fr; - --vf-hero-content-box-shadow: none; - - height: auto; - padding: 24px; - - .vf-hero__content { - // grid-column-start: 2; - grid-column: 1 / span 1; - width: 100%; - } - - .vf-summary { - align-self: center; - // grid-column: 3 / span 1; - grid-column: 2 / span 1; - margin: 0; - } - - @media (min-width: $vf-breakpoint--md) { - display: grid; - // grid-template-columns: minmax(var(--page-grid-gap), 60px) [main-start] minmax(auto, 100%) minmax(auto, 22.125em) [main-end] minmax(var(--page-grid-gap), 60px); - grid-template-columns: [main-start] minmax(auto,100%) minmax(auto,22.125em) [main-end]; - margin: 0 auto; - max-width: $vf-layout--comfortable; - } - @media (min-width: 75em) { - padding: 48px 0; - } +.vf-hero--secondary { + --vf-hero--bg-color: #{set-color(vf-color--blue)}; +} +.vf-hero--tertiary { + --vf-hero--bg-color: #{set-color(vf-color--grey)}; } -.vf-hero--easy { - --vf-hero-content-box-shadow: - 2px 0 3px rgba(0, 0, 0, var(--vf-hero-content-shadow-alpha, 0)), - -2px 0 3px rgba(0, 0, 0, var(--vf-hero-content-shadow-alpha, 0)), - 0 2px 3px rgba(0, 0, 0, var(--vf-hero-content-shadow-alpha, 0)); - --vf-hero__content-bg-color: 1; - --vf-hero-bg-color: 1; +// sizes +// ---------------------------------------------------------------------- +.vf-hero--800 { + --vf-hero--spacing: #{map-get($vf-spacing-map, vf-spacing--800)}; +} - --vf-hero-text-bg-color: 1; - --vf-hero-text-color: 0; +.vf-hero--1200 { + --vf-hero--spacing: #{map-get($vf-spacing-map, vf-spacing--1200)}; +} - & .vf-hero__content { - grid-row: 2 / span 1; - justify-self: center; - } +.vf-hero--1600 { + --vf-hero--spacing: #{map-get($vf-spacing-map, vf-spacing--1600)}; } -.vf-hero--normal { - --vf-hero-bg-color: 1; - --vf-hero-content-box-shadow: none; +// ---------------------------------------------------------------------- +// Design Variants +// ---------------------------------------------------------------------- - & .vf-hero__content { - grid-row: 2 / span 1; - justify-self: flex-start; +// flushed +// ---------------------------------------------------------------------- +.vf-hero--flush { + .vf-hero__content { + bottom: -2rem; + bottom: calc( var(--vf-hero--spacing) / -1); + filter: none; } } -.vf-hero--hard { - --vf-hero-bg-color: 1; - --vf-hero-grid-row--multiplier: 1; - --vf-hero-grid__row--initial: 348px; - --vf-hero-content-box-shadow: none; - - & > .vf-hero__content { - align-self: flex-end; - grid-row: 1 / -1; +// offset +// ---------------------------------------------------------------------- +.vf-hero--offset { + margin-bottom: 4rem; + margin-bottom: calc( var(--vf-hero--spacing) * 2); + .vf-hero__content { + bottom: -4rem; + bottom: calc( var(--vf-hero--spacing) * -2); } } - -.vf-hero--extreme { - --vf-hero-bg-color: 1; - --vf-hero-grid__row--initial: 348px; - --vf-hero-text-bg-color: 1; - --vf-hero-text-color: 0; - --vf-hero-content-box-shadow: none; +// centered +// ---------------------------------------------------------------------- +.vf-hero--centered { + .vf-hero__content { + left: 50%; + transform: translateX(-50%); + } } - -.vf-hero--intense { - --vf-hero__content-bg-color: 1; - --vf-hero-heading-text-color: 0; - --vf-hero-text-bg-color: 1; - --vf-hero-text-color: 0; - --vf-hero-content-box-shadow: none; - --vf-hero__padding: 20; - - background-image: var(--vf-hero-bg-image); - background-position: center center; - background-repeat: no-repeat; - background-size: cover; - grid-template-rows: auto; - margin-left: calc(50% - 50vw); - padding: 24px 0; - width: 100vw; - +// striped +// ---------------------------------------------------------------------- +.vf-hero--striped { .vf-hero__content { - grid-row: 1; + background-color: set-ui-color(vf-ui-color--white); + background-color: var(--vf-hero-content--bg-color, set-ui-color(vf-ui-color--white)); + color: set-ui-color(vf-ui-color--black); + color: var(--vf-hero-content--fg-color, set-ui-color(vf-ui-color--black)); } .vf-hero__heading { - font-size: 36px; - padding: 0 0 1rem; + margin: calc( var(--vf-hero--spacing) / -2); + padding: calc( var(--vf-hero--spacing) / 2) calc( var(--vf-hero--spacing) / 2); + padding-bottom: 0; } - .vf-hero__subheading.vf-summary__title, - .vf-summary__title, .vf-hero__subheading { - padding: 0 0 1rem; + margin: calc( var(--vf-hero--spacing) / -2); + margin-bottom: 0; + padding: calc( var(--vf-hero--spacing) / 2) calc( var(--vf-hero--spacing) / 2); + padding-bottom: map-get($vf-spacing-map, vf-spacing--200); } .vf-hero__text { - font-weight: 500; - padding: 0; - } + --vf-stack-margin: 0; + background-color: set-ui-color(vf-ui-color--black); + background-color: var(--vf-hero-content--bg-color, set-ui-color(vf-ui-color--black)); + color: set-ui-color(vf-ui-color--white); + color: var(--vf-hero-content--fg-color, set-ui-color(vf-ui-color--white)); + margin: calc( var(--vf-hero--spacing) / -2); + padding: calc( var(--vf-hero--spacing) / 2) calc( var(--vf-hero--spacing) / 2); + padding-top: map-get($vf-spacing-map, vf-spacing--200); - .vf-hero__content { - box-sizing: border-box; - height: min-content; + a { + color: currentColor; + text-decoration: underline; + } } - .vf-link { - color: inherit; - display: block; + &.vf-hero--inverted .vf-hero__text a { + color: set-color(vf-color--blue); text-decoration: none; - svg { - fill: currentColor; - align-self: center; - margin-left: 8px; - transform: translate(0, 4px); - transition-duration: 125ms; - transition-timing-function: cubic-bezier(.45,.05,.55,.95); - } - &:hover { - color: set-color(vf-color--blue); text-decoration: underline; - - svg { - color: set-color(vf-color--blue) !important; - transform: translate(2px, 4px); - } - } - - & ~ [id*='#jarallax-container'] > div { - left: calc(50% - 50vw); - } - } - - @media (min-width: $vf-breakpoint--md) { - padding: 48px 0; - } - - @media (min-width: 75em) { - .vf-hero__heading { - font-size: 48px; - font-weight: 600; } } -} - - -.vf-hero-theme--primary { - --vf-hero-text-bg-color--r: #{red(set-color(vf-color--blue))}; - --vf-hero-text-bg-color--g: #{green(set-color(vf-color--blue))}; - --vf-hero-text-bg-color--b: #{blue(set-color(vf-color--blue))}; - - --vf-hero-text-color: 1; - - a:focus, - a:hover, - a:visited { - color: white; - } - .vf-hero__lens { + &.vf-hero--block .vf-hero__heading, + &.vf-hero--block .vf-hero__subheading, + &.vf-hero--block .vf-hero__text { + position: relative; - + .vf-hero__content .vf-hero__text { - --vf-hero-text-bg-color--r: 0; - --vf-hero-text-bg-color--g: 0; - --vf-hero-text-bg-color--b: 0; - } - + .vf-hero__content .vf-hero__heading { - --vf-hero-heading-bg-color: 1; + &::before { + background-color: inherit; + content: ""; + height: 100%; + margin-left: calc(50% - calc(50vw - var(--context-margin--inline, 0px) + 2rem)); + position: absolute; + top: 0; + width: calc(50vw - (var(--context-margin--inline, 0px) * 2)); + z-index: -1; } } - - .vf-hero__lens { - background-color: set-color(vf-color--green); // temporary hack - height: 100%; - max-height: 348px; - - path { - fill: set-color(vf-color--green); - height: 100%; - width: 100%; + @supports(--var: true) { + .vf-hero__content { + box-shadow: unset; } } } -.vf-hero-theme--secondary { - --vf-hero-text-bg-color--r: #{red(set-color(vf-color--green))}; - --vf-hero-text-bg-color--g: #{green(set-color(vf-color--green))}; - --vf-hero-text-bg-color--b: #{blue(set-color(vf-color--green))}; - - --vf-hero-text-color: 0; - - a:focus, - a:hover, - a:visited { - color: set-ui-color(vf-ui-color--white); +// inverted variant +// ---------------------------------------------------------------------- +.vf-hero--inverted { + .vf-hero__content { + --vf-hero-content--bg-color: black; + --vf-hero-content--fg-color: white; } - - .vf-hero__lens { - + .vf-hero__content .vf-hero__text { - --vf-hero-text-bg-color--r: 0; - --vf-hero-text-bg-color--g: 0; - --vf-hero-text-bg-color--b: 0; - } - + .vf-hero__content .vf-hero__heading { - --vf-hero-heading-bg-color: 1; + .vf-hero__text { + --vf-hero-content--bg-color: white; + --vf-hero-content--fg-color: black; + a { + color: currentColor; } } +} +// block variant +// ---------------------------------------------------------------------- +.vf-hero--block { + .vf-hero__content { - .vf-hero__lens { - background-color: set-color(vf-color--blue); // temporary hack + // padding: 1.5rem; + // padding-left: 0; - path { - fill: set-color(vf-color--blue); + &::before { + background-color: inherit; + // background-color: var(--vf-masthead__color--background-default, var(--global-bg-color, set-ui-color(vf-ui-color--black))); + content: ''; height: 100%; - width: 100%; + margin-left: calc(50% - calc(50vw - var(--context-margin--inline, 0px))); + position: absolute; + top: 0; + width: calc(50vw - (var(--context-margin--inline, 0px) * 2)); + z-index: -1; } } -} - -.vf-hero-theme--tertiary { - --vf-hero-text-bg-color--r: #{red(set-color(vf-color--grey--dark))}; - --vf-hero-text-bg-color--g: #{green(set-color(vf-color--grey--dark))}; - --vf-hero-text-bg-color--b: #{blue(set-color(vf-color--grey--dark))}; - a:focus, - a:hover, - a:visited { - color: set-ui-color(vf-ui-color--white); + .vf-hero__subheading { + --vf-stack-margin--custom: 0; } } -.vf-hero__lens { - height: 348px; - position: absolute; - width: 100%; -} - - -/* stylelint-enable */ diff --git a/components/vf-u-fullbleed/CHANGELOG.md b/components/vf-u-fullbleed/CHANGELOG.md index 2787f49310..71c0576472 100755 --- a/components/vf-u-fullbleed/CHANGELOG.md +++ b/components/vf-u-fullbleed/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.2.2 + +* adds fallbacks for CSS that relied on CSS custom properties + ### 1.2.1 * cleanup README diff --git a/components/vf-u-fullbleed/vf-u-fullbleed.scss b/components/vf-u-fullbleed/vf-u-fullbleed.scss index 4589e36f7b..77bbfda73b 100755 --- a/components/vf-u-fullbleed/vf-u-fullbleed.scss +++ b/components/vf-u-fullbleed/vf-u-fullbleed.scss @@ -44,9 +44,11 @@ content: ''; grid-column: 1 / -1; /* 4 */ height: 100%; /* 5 */ + margin-left: calc(50% - 50vw); margin-left: calc(50% - calc(50vw - var(--context-margin--inline, 0px))); /* 6 */ position: absolute; top: 0; /* 7 */ + width: 100vw; width: calc(100vw - (var(--context-margin--inline, 0px) * 2)); /* 8 */ z-index: set-layer(vf-z-index--negative); /* 9 */ }