Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vote-1124: Responsive Module Set Up #949

Merged
merged 15 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/local/config_split.patch.core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ adding:
devel: 0
disable_language: 0
field_ui: 0
responsive_image: 0
views_ui: 0
removing: { }
12 changes: 4 additions & 8 deletions config/sync/core.entity_view_display.media.image.scaled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ dependencies:
- core.entity_view_mode.media.scaled
- field.field.media.image.field_caption
- field.field.media.image.field_media_image
- image.style.scaled_lg
- media.type.image
- responsive_image.styles.scaled
module:
- svg_image
- responsive_image
- text
id: media.image.scaled
targetEntityType: media
Expand All @@ -24,17 +24,13 @@ content:
weight: 1
region: content
field_media_image:
type: image
type: responsive_image
label: visually_hidden
settings:
responsive_image_style: scaled
image_link: ''
image_style: scaled_lg
image_loading:
attribute: lazy
svg_attributes:
width: null
height: null
svg_render_as_image: true
third_party_settings: { }
weight: 0
region: content
Expand Down
10 changes: 3 additions & 7 deletions config/sync/core.entity_view_display.paragraph.hero.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ dependencies:
- field.field.paragraph.hero.field_heading
- field.field.paragraph.hero.field_link
- field.field.paragraph.hero.field_media
- image.style.scaled_xl
- paragraphs.paragraphs_type.hero
module:
- link
- media
- options
- text
id: paragraph.hero.default
Expand Down Expand Up @@ -55,13 +53,11 @@ content:
weight: 2
region: content
field_media:
type: media_thumbnail
type: entity_reference_entity_view
label: hidden
settings:
image_link: ''
image_style: scaled_xl
image_loading:
attribute: lazy
view_mode: scaled
link: false
third_party_settings: { }
weight: 3
region: content
Expand Down
1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module:
path_alias: 0
redirect: 0
remove_http_headers: 0
responsive_image: 0
rest: 0
rest_views: 0
robotstxt: 0
Expand Down
23 changes: 23 additions & 0 deletions config/sync/responsive_image.styles.scaled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: 41865dd0-e521-4e76-bdd8-51ff0a8230bf
langcode: en
status: true
dependencies:
config:
- image.style.scaled_lg
- image.style.scaled_sm
- image.style.scaled_xl
id: scaled
label: Scaled
image_style_mappings:
-
image_mapping_type: sizes
image_mapping:
sizes: 100vw
sizes_image_styles:
- scaled_lg
- scaled_sm
- scaled_xl
breakpoint_id: responsive_image.viewport_sizing
multiplier: 1x
breakpoint_group: responsive_image
fallback_image_style: scaled_sm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends 'media.html.twig' %}
{#
/**
* @file
* Theme override to display a media item: image.
*/
#}

{# Caching the data in content object #}
{% set savedCache = content | render %}

{% block content %}
{{ content.field_media_image | field_value }}
{% endblock %}
12 changes: 12 additions & 0 deletions web/themes/custom/votegov/votegov.breakpoints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
votegov.mobile:
label: 'Mobile'
mediaQuery: ''
weight: 1
votegov.tablet:
label: 'Tablet'
mediaQuery: 'all and (min-width: 640px)'
weight: 2
votegov.desktop:
label: 'Desktop'
mediaQuery: 'all and (min-width: 1024px)'
weight: 3