[beta4] Update DSFR library from 1.7 to 1.9

Created on 7 February 2023, almost 2 years ago
Updated 17 October 2023, about 1 year ago

Problem/Motivation

Version 1.8 was released in October 2022.
Version 1.9 was released in March 2023.

https://github.com/GouvernementFR/dsfr/tags

Proposed resolution

Move to 1.9 using a CDN.

Current config:

dsfr:
  version: 1.x
  license:
    name: MIT
    gpl-compatible: false
  js:
    # We don't use dsfr.module.min.js because of conflict with drupal js.
    dist/dsfr.module.js: { }
  css:
    theme:
      dist/dsfr.min.css: { minified: true }
      dist/utility/icons/icons.min.css: { minified: true }
      dist/utility/colors/colors.min.css: { minified: true }
      dist/reset/reset.css: { }

New config (with mandatory module attribute & reset.css removal):

dsfr:
  version: 1.x
  license:
    name: MIT
    gpl-compatible: false
  js:
    # We don't use dsfr.module.min.js because of conflict with drupal js.
    https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/dsfr.module.js:
      attributes: { "type" : "module" }
  css:
    theme:
      https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/dsfr.min.css: { minified: true }
      https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/utility/icons/icons.min.css: { minified: true }
      https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/utility/colors/colors.min.css: { minified: true }

Careful about html.html.twig:

  <link rel="apple-touch-icon" href="/{{ theme_path }}/dist/favicons/apple-touch-icon.png"><!-- 180×180 -->
<link rel="icon" href="/{{ theme_path }}/dist/favicons/favicon.svg" type="image/svg+xml">
<link rel="shortcut icon" href="/{{ theme_path }}/dist/favicons/favicon.ico" type="image/x-icon"><!-- 32×32 -->
<link rel="manifest" href="/{{ theme_path }}/dist/favicons/manifest.webmanifest" crossorigin="use-credentials">

With:

function ui_suite_dsfr_preprocess_html(&$variables) {
  $variables['theme_path'] = \Drupal::service('extension.list.theme')->getPath('ui_suite_dsfr');
}

Do we keep those 4 files in the codebase?

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024