Bootstrap Italia

repository·main·Indexed 43 days ago

https://github.com/italia/bootstrap-italia

A customized version of Bootstrap 5 designed to meet the design guidelines and accessibility requirements of Italian Public Administrations. It implements the Italian Country Design System and UI Kit Italia, providing ready-to-use UI components and patterns for digital services of the PA. Version 2.18.3.

Tokens
196.3K
Snippets
571
Records
688
Agent score
54%

What's inside Bootstrap Italia

  1. What is Bootstrap Italia

    main
    Bootstrap Italia is a customization of the Bootstrap library. It is specifically designed to comply with the design, usability, and accessibility guidelines defined in the "Linee guida di design per i siti internet e i servizi digitali della Pubblica Amministrazione" (Design guidelines for websites and digital services of the Public Administration) and the supporting "Manuale operativo di design".
  2. Overview of Bootstrap Italia components

    main

    Bootstrap Italia provides an extensive library of components for building websites. These components are categorized into two main types:

    1. Base Components: These are derived from the standard Bootstrap library but are customized in terms of style, accessibility, and functionality to comply with the Italian Public Administration (PA) design guidelines. Because they are based on Bootstrap, they correspond to standard Bootstrap components and can be referenced in the official Bootstrap documentation.

    2. Plugins (Non-native components): These are components not natively present in the standard Bootstrap library that extend the framework's capabilities specifically for the Italian digital ecosystem.

  3. What is a Toolbar and how to structure it

    main

    A Toolbar is a container for links, buttons, or dropdowns. It is structured as a <nav> element containing a <ul> list, where each item is represented by an <li> element.

    To ensure the toolbar doesn't spread too wide, it is recommended to place it within a container of limited horizontal (or vertical, for vertical toolbars) width.

    <nav class="toolbar">
      <ul>
        <li>
          <a href="#">
            <svg class="icon"><use href="#"></use></svg>
            <span class="toolbar-label">label</span>
          </a>
        </li>
      </ul>
    </nav>
  4. What is an Affix element?

    main

    An Affix element remains anchored to a specific area of the page relative to the viewport. This is commonly used for navigation menus or social media sharing buttons to keep them visible while the user scrolls through page content.

    Important: Ensure that an Affix element does not obscure page content, particularly when the viewport size is reduced (e.g., on mobile devices).

  5. Accessibility requirements for Video Player

    main

    While the player controls are accessible to assistive technologies, the video content itself must meet WCAG 1.2 (Time-based Media) guidelines to be truly accessible:

    • Video-only or Audio-only content: Provide a text transcription (Success Criterion 1.2.1).
    • Subtitles: Always provide subtitles (Success Criterion 1.2.2).
    • Audio Descriptions: Provide audio descriptions for scenes or content not described by the primary audio track (Success Criteria 1.2.3 and 1.2.5).
  6. Set user account status indicators in Avatar

    main

    To indicate an account status, insert a <div> with the class .avatar-status inside the .avatar container.

    Available statuses:

    • Approved: Add the .approved class.
    • Declined: Add the .declined class.
    • Notification: Add the .notify class.

    Accessibility: Always include a <span class="visually-hidden"> inside the status div to provide a text description for screen readers (e.g., Stato: approvato).

    <div class="avatar size-xl">
      <img src="path/to/image.jpg" alt="Mario Rossi">
      <div class="avatar-status approved">
        <svg class="icon icon-white"><use href="#it-check"></use></svg>
        <span class="visually-hidden">Stato: approvato</span>
      </div>
    </div>
  7. Structure the Timeline component

    main

    The Timeline component is used to display events chronologically. It requires a wrapper element with the class .it-timeline-wrapper which contains a list of .timeline-element items.

    Each .timeline-element must include a PIN (the event marker), which is a container with the class .it-pin-wrapper. The PIN should be a heading element (h1-h6) containing:

    • An icon with the class .pin-icon.
    • A label with the class .pin-text indicating the event date.

    To ensure accessibility, use the correct heading level for the .it-pin-wrapper based on your page hierarchy. If the .pin-icon (SVG) is purely decorative and carries no semantic meaning, hide it from assistive technologies by adding aria-hidden="true" and removing role="img" and the <title> element.

    <div class="it-timeline-wrapper">
      <div class="timeline-element">
        <div class="it-pin-wrapper">
          <span class="pin-icon">...</span>
          <span class="pin-text">Date</span>
        </div>
        <!-- Event content here -->
      </div>
    </div>
  8. Ensure accessibility for Collapse components

    main

    To make collapsible elements accessible to screen readers:

    • aria-expanded: Add this to the control element (the button or link). Set it to false if the content is closed by default, and true if the content has the .show class. The JavaScript plugin automatically toggles this attribute.
    • role="button": If your control element is not a <button> (e.g., an <a> or <div>), you must add role="button".
    • aria-controls: Add this attribute to the control element, containing the id of the collapsible element it manages. This allows assistive technologies to provide shortcuts to the content.
  9. Use containers to wrap content

    main

    Containers are fundamental elements in Bootstrap Italia and are required when using the grid system. You can choose between a fixed-width container or a fluid container.

    • .container: A fixed-width container where the max-width changes at each breakpoint.
    • .container-fluid: A fluid container that always occupies 100% of the available width.
    <div class="container">
      <!-- Fixed-width content -->
    </div>
    
    <div class="container-fluid">
      <!-- Full-width content -->
    </div>