Back to Modal-guidelines

CSS ComponentThe latest version of this package is: 17.0.1, Opens in new window

Modals communicate information via a secondary window and allow the user to maintain the context of a particular task.

This component provides .css, .styl, .less and .scss -files.

To be able to install this component, please refer to the Project Setup documentation.

$ npm i @ids-core/modal@17.0.1

Table of Contents

Edit this section, Opens in new window

Usage

<div class="if backdrop [is-open]"></div>
<div
  aria-modal="true"
  role="dialog"
  aria-labelledby="modal-title"
  aria-describedby="modal-description"
  class="if modal"
>
  <div class="if title">
    <span class="if" id="modal-title">Title</span>
    <button type="button" class="if close" aria-label="Close modal"></button>
  </div>
  <span class="if axe sr-only" id="modal-description">Some random quotes</span>
  <div class="if content">
    <p class="if">
      Yeah, but John, if The Pirates of the Caribbean breaks down, the pirates don’t eat the
      tourists. God creates dinosaurs. God destroys dinosaurs. God creates Man. Man destroys God.
      Man creates Dinosaurs. What do they got in there? King Kong? Forget the fat lady! You're
      obsessed with the fat lady! Drive us out of here!
    </p>
    <p class="if">
      Hey, you know how I'm, like, always trying to save the planet? Here's my chance. They're using
      our own satellites against us. And the clock is ticking. God help us, we're in the hands of
      engineers. They're using our own satellites against us. And the clock is ticking.
    </p>
    <a class="if external-link" target="_blank" rel="noopener noreferrer" href="https://google.com"
      >An external link</a
    >
    <a class="if external-link" target="_blank" rel="noopener noreferrer" href="https://google.com"
      >An external link</a
    >
  </div>
</div>

Dialog

<div class="if backdrop [is-open]"></div>
<div
  aria-modal="true"
  role="dialog"
  aria-labelledby="dialog-title"
  aria-describedby="dialog-description"
  class="if modal"
>
  <div class="if title" id="dialog-title">
    <span class="if" id="dialog-title">Title</span>
  </div>
  <div class="if content" id="dialog-description">
    <p class="if">Are you sure you want to delete all data?</p>
  </div>
  <div class="if footer">
    <button id="cancelButton" type="button" class="if button">Cancel</button>
    <button id="confirmButton" type="button" class="if button primary">Yes</button>
  </div>
</div>
Edit this section, Opens in new window

Tokens

All of the tokens can be used as preprocessor and CSS variables

Modal tokens

Name Value Is aliased in
$ids-modal-border-radius
0.75rem
$ids-modal-backdrop-depth-eclipse
700
$ids-modal-content-size-font
1.125rem
$ids-modal-content-spacing-inset
1.5rem
$ids-modal-content-spacing-stack-media-query-base
1rem
$ids-modal-content-spacing-stack-media-query-sm
2rem
$ids-modal-footer-size-height
7rem
$ids-modal-footer-spacing-inset-media-query-base
1.5rem
$ids-modal-title-size-height
4rem
$ids-modal-title-color-text
rgb(51, 30, 17)
$ids-modal-title-color-background
rgb(241, 236, 232)
$ids-modal-shadow
0 8px 4px -2px rgba(110,98,94, 0.08), 0 20px 32px rgba(110,98,94, 0.24)
$ids-modal-depth
900
$ids-modal-color-text
rgb(51, 30, 17)
$ids-modal-color-background
rgb(250, 249, 247)
Edit this section, Opens in new window

Changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

14.22.2 (2022-05-03)

Miscellaneous chores

  • package locks: update package locks (813eac7)
  • update deps: package locks updates (38e7a90)

14.22.1 (2022-05-02)

Miscellaneous chores

  • modal: convert html examples to using MDX/React components instead (b6b90b3) , closes #587458

14.22.0 (2022-05-02)

Features

  • modal: add CSS Variables to Modal Component (69354fb) , closes #587389

14.20.1 (2022-04-19)

Miscellaneous chores

  • changelog: regenerate all CHANGELOG.md files (64ab385) , closes #586342
  • changelog: regenerate all changelogs after updating changelog generation (70789c9) , closes #587270

14.18.3 (2022-04-13)

Bug Fixes

  • changelog: generate new CHANGELOG.md files for root and packages (349fda4) , closes #586063 . We regenerate the files to include all relevant commits and to use conventional-commits at 100%

14.16.0 (2022-04-07)

Bug Fixes

  • 🐛 Add missing imports for global CSS Variables (fbf6f06) , closes #582437

14.9.0 (2022-03-03)

Miscellaneous chores

14.8.1 (2022-02-23)

Bug Fixes

  • 🐛 Add missing imports of typography CSS variables (e716c65) , closes #559412

reinstall (d425056)

bootstrap (9a713df)

merge (2b1c5f1)

reinstall (5221600)

reinstall (147df55)

  • use correct versions (f1b5deb)

  • Add engines for all packages (e95dfff)

reinstall (afce1f2)

reinstall (67f3140)

  • Add changelog.md to files (3338314)

Reinstall (a2abf51)

14.2.2 (2021-12-10)

Code Refactoring

reinstall (885c74b)

  • fix changelogs manually (b1232b4)

reinstall (545a069)

reinstall (e149c2c)

13.12.3 (2021-11-09)

⚠ BREAKING CHANGES

  • 🧨 The scope for If Design System npm packages has now changed from @if-design-system to @ids-core. We have also renamed the repository from if-design-system to ids-core
  • 🧨 Util is now renamed to Utils
  • 🧨 We have now changed the navigation structure for the documentation site. Please update any saved links!
  • 🧨 Navigation structure has now changed. Please see release notes!
  • 🧨 JS and Webcomponent for Dialogs and Modals are now in separate packages in scopes @ids-js and @ids-wc

Documentation Updates

  • ✏️ Move position of the quick links (5cb0897)

  • ✏️ Remove unneeded margins for shortcuts (36c7e8d)

  • ✏️ Split out CSS, JS and Webcomponent documentation (6ce90c9) , closes #467386

  • ✏️ Update links and change navigation structure (0bfd27d) , closes #490579

  • ✏️ Use correct js references in examples/dev/demo (f41c249)

Code Refactoring

  • 💡 Categorize components (9965266) , closes #490579

  • 💡 Reduce spacing tokens, use correct size tokens (97aa461)

  • 💡 Rename scope and repository (3ea5423)

  • 💡 Use new navigation structure for documentation (415aee5) , closes #490579

  • another change in the structure (38a0d2e)

Miscellaneous chores

bootstrap (6fc1ed8)

  • fix all old references to util (d57bf17)

  • prepare for merge (0184490)

reinstall (da80dba)

  • Rename scope and repo (257684e)

  • use correct version for utils (49e72d9)

13.11.0 (2021-10-19)

Features

  • 🎸 Input field hot reload (eac76b7)

13.7.0 (2021-09-22)

Documentation Updates

  • ✏️ Update linking layout and naming (15c383b)

13.6.3 (2021-09-17)

Bug Fixes

13.6.0 (2021-09-08)

Documentation Updates

  • Use default shortcut listing for demo links (a746602)

  • 🤖 Rearrange diffs for test, use grey color for unaffected (1834399)

  • continue to fix form input widths (b66977e)

  • 🤖 Use node v14 (4009973)

bootstrap (d23e139)

  • 🤖 Use correct order for diff (cc6a4fd)

12.14.1 (2021-08-12)

Miscellaneous chores

  • 🤖 Add ci task to package.json without tests (21222e0) , closes #457627

12.13.1 (2021-08-11)

Bug Fixes

  • 🐛 Whitelist docs dir for npm packaging (1a5cfd0) , closes #457621

12.13.0 (2021-08-11)

Features

  • 🎸 Add scroll-lock support in js implementatione example (8e9d5c9) , closes #454896

Bug Fixes

  • 🐛 Make sure overlays and modals has correct zindexes (828b572) , closes #454896

  • 🤖 Remove .gitignore, use npm package.json files instead, ignore zip files for npm pack (49f0269) , closes #412081 . This will whitelist files to be used in "npm pack"

  • 🤖 Reinstall (e660696)

12.8.0 (2021-06-03)

Features

  • 🎸 Add modal webcomponent (405b078)

  • 🎸 Add webcomponent focus styling for button (0db8d6e)

12.7.7 (2021-06-02)

Bug Fixes

12.6.0 (2021-05-27)

Bug Fixes

  • 🐛 Manually set firstPublished and lastModified (e83af7d)

  • 🐛 We don't need lastModified (e458a12)

12.0.0 (2021-05-05)

⚠ BREAKING CHANGES

  • 🧨 All of the mixins have now been renamed
  • 🧨 Teasers are no more. It has been replaces with Lifestyle Navigational Card, Text Navigational Card. Studio Teasers is gone, use Studio Navigational Card instead, which is based on the old Studio Crosslinks
  • 🧨 This extracts the Hero variation with no image into a separate, design updated component named Header
  • 🧨 Footer is now renamed to Global Footer

Features

  • 🎸 Rename and extract and update hero with no image to (384eb77) , closes #336508 . Header component

Bug Fixes

Code Refactoring

Miscellaneous chores

  • 🤖 Convert typography tokens from theo to SD (e48f255)

  • 🤖 Convert util tokens from theo to style-dictionary (99fb4f5)

  • 🤖 Finalize breakpoint token conversion (f50ea0d)

  • 🤖 Reinstall (2c763ea)

  • 🤖 Reinstall (69e1a5b)

  • 🤖 Update all design token references (c640d15)

  • 🤖 Update references to util variables (b79ec36)

  • 🤖 Updating links (70f166e)

  • 🤖 Use updated classnames for text button (old tertiary) (694cf67)

rebuild (7edb430)

  • 🤖 Rename Change Log to Changelog (d412e63)

  • 🤖 Remove all references to sketch (35fc554) , closes #339203

  • 🤖 Update package fields (200c0af)

  • reinstall packages (fcfacf4)

9.3.2 (2021-02-12)

Bug Fixes

  • 🐛 Modal size corresponding to visible viewport (1c6350b) , closes #339022

7.8.0 (2020-11-30)

Bug Fixes

  • 🐛 Use scoped kbd tags (89dd3f6)

7.1.0 (2020-11-16)

Features

  • 🎸 Add support for auto generation of components index (9444600) , closes #309650

6.43.3 (2020-11-03)

Miscellaneous chores

  • 🤖 Manually set version (e4d9ca6)

6.43.0 (2020-10-27)

Features

  • 🎸 Add preliminary styles for guide modal (b2a9f07)

  • 🤖 Rename repository from guybrush to if-design-system (c18bccd)

reinstall (2cefe15)

6.36.0 (2020-10-12)

Miscellaneous chores

  • 🤖 Add what-input to demo and dev files (56801b7)

6.34.0 (2020-09-29)

Features

  • 🎸 Add initial support for a drawer modal (9030336)

6.29.4 (2020-09-09)

Documentation Updates

  • ✏️ Use correct strong element with if class (6b484df)

6.29.3 (2020-09-07)

Documentation Updates

  • ✏️ Merge atoms/molecules/organisms into components (90ed590)

6.27.0 (2020-08-27)

Bug Fixes

  • 🐛 Make wider modal cover screen below 960px (fc76701) , closes #271819

6.26.12 (2020-08-03)

Documentation Updates

  • ✏️ Update documentation for the new registry (3e7ba20)

Miscellaneous chores

  • 🤖 lerna bootstrap (d835ec9)

  • 🤖 Temporarily remove package-lock.json-files (87b3f7f)

  • 🤖 Update references to new scope (b5575dd)

6.26.10 (2020-07-14)

Miscellaneous chores

  • 🤖 Manually update some links (ecc0133)

  • 🤖 Update CHANGELOG.md links to workitems and commits (ab2887b)

6.24.0 (2020-07-06)

Bug Fixes

  • 🐛 Fix z-index issues and normalize them (5ab3dbb)

6.23.0 (2020-07-01)

Miscellaneous chores

reinstall (1ab1527)

6.22.0 (2020-07-01)

Features

  • 🎸 Add new color categories, update documentation (5496822)

Miscellaneous chores

  • 🤖 Search and replace old color usage (3e5abb0)

6.21.11 (2020-06-16)

Bug Fixes

  • 🐛 Fix modal layout and add demos (6a28031)

Documentation Updates

  • ✏️ Update documentation for modals (ea6faba)

6.21.6 (2020-06-11)

Miscellaneous chores

  • 🤖 Remove .zip files from .npmignore (b3bc7dc)

6.19.0 (2020-06-02)

Miscellaneous chores

reinstall (3416c65)

6.15.5 (2020-05-15)

Miscellaneous chores

  • prepped and ready to separate documentation site from code (d3e1fd9)

  • pruning and reinstalling (5cda0bc)

reinstall (939dae6)

reinstall (cae55fb)

  • Remove livingcss data and add frontmatter data (b384946)

6.15.4 (2020-05-14)

Miscellaneous chores

6.15.2 (2020-05-11)

Miscellaneous chores

6.15.0 (2020-05-07)

Miscellaneous chores

6.11.0 (2020-04-22)

Bug Fixes

  • 🐛 Add sr only text for footer logo link (2971dd9)

6.10.9 (2020-04-22)

Miscellaneous chores

  • 🤖 Add *.zip-files to .npmignore-files (062b8b0)

  • 🤖 Remove references to verb in package.json files (cfdaaec)

6.10.6 (2020-04-17)

Miscellaneous chores

6.9.1 (2020-04-16)

Documentation Updates

  • ✏️ Use correct badge color in README.md (03b563e)

6.6.0 (2020-04-09)

Documentation Updates

  • ✏️ Change edit this document to edit this section (791b646)

6.5.4 (2020-04-08)

Bug Fixes

6.5.3 (2020-04-06)

Documentation Updates

  • ✏️ Some more sg updates and tweaks (d1d6802)

6.4.2 (2020-04-03)

Bug Fixes

  • 🐛 Remove misuse of unset, none, auto and initial (87624d7)

6.3.4 (2020-04-01)

Miscellaneous chores

  • 🤖 Use more of if styling on documentation site (2eaf386)

5.2.0 (2020-03-17)

Code Refactoring

  • 💡 Reorganized sections in the documentations (dd31802) . Adjust navigation styling on the left hand side. The reorganization is mostly to make the site load a bit smoother

5.0.4 (2020-03-14)

Miscellaneous chores

  • 🤖 Delete really old install files, update README files (c5d4893)

  • 🤖 Remove .npmrc fles (4e26249)

5.0.1-alpha.160 (2020-03-12)

Miscellaneous chores

5.0.1-alpha.150 (2020-03-05)

Bug Fixes

  • 🐛 Add new padding mixin to modal (3f501b5)

  • 🐛 Adjusting components to baseline grid (5a53cd9)

5.0.1-alpha.149 (2020-03-05)

Miscellaneous chores

  • 🤖 Finish adjusting components to baseline grid (50f7a69) . Chang approx 6888 raw values to variables

  • 🤖 Starting to align components to new baseline grid (cf2c073)

  • Align typography to baseline. First attempt (f4447e9)

5.0.1-alpha.147 (2020-03-02)

Miscellaneous chores

5.0.1-alpha.145 (2020-02-26)

Miscellaneous chores

5.0.1-alpha.144 (2020-02-26)

Features

5.0.1-alpha.143 (2020-02-26)

Documentation Updates

5.0.1-alpha.138 (2020-02-26)

Bug Fixes

  • starting to fix cookie settings modal (7911b61)

Miscellaneous chores

  • 🤖 Update preprocessor files (3daba4d)

5.0.1-alpha.133 (2020-02-24)

Features

  • 🎸 Add preprocessor files to modal (551ca91)

Documentation Updates

  • ✏️ Add baseline grid to specs for modals (b739eb0)

Miscellaneous chores

  • 🤖 Finish documentation for modal, adjusted styling (f24d79b)

5.0.1-alpha.131 (2020-02-23)

Bug Fixes

  • 🐛 Adjust design of modal, add specificity to footer (fc9835f) . And add backdrop mixin to utils. Might want to move this into another package

5.0.1-alpha.120 (2020-02-17)

Bug Fixes

  • 🐛 Imports and usage of extend (f22b281)

Miscellaneous chores

  • 🤖 Use variables instead of hardcoded values (db103b1)

5.0.1-alpha.117 (2020-02-06)

Documentation Updates

  • ✏️ Add edit links to documentation files (7c6e770)

  • testing sketch (003a233)

5.0.1-alpha.105 (2020-01-13)

Bug Fixes

5.0.1-alpha.79 (2019-12-03)

Documentation Updates

  • ✏️ Scope all examples to .if (26bd7cd)

5.0.1-alpha.70 (2019-11-28)

Miscellaneous chores

  • 🤖 Remove polymer, updated styling accordingly (04e1941)

5.0.1-alpha.67 (2019-11-26)

Bug Fixes

  • 🐛 Use package-based imports (6822233)

5.0.1-alpha.62 (2019-11-24)

Miscellaneous chores

  • 🤖 Some documentation fixes (8d66129)

5.0.1-alpha.61 (2019-11-22)

Features

  • 🎸 Add mixins for icons (f2f3420)

5.0.1-alpha.58 (2019-11-22)

Features

  • 🎸 Remove normalize.css (2c23c2b)

Miscellaneous chores

5.0.1-alpha.57 (2019-11-22)

Miscellaneous chores

5.0.1-alpha.42 (2019-11-05)

Miscellaneous chores

5.0.1-alpha.40 (2019-11-05)

Bug Fixes

  • 🐛 Fix typography based on latest sketches (2653b61)

5.0.1-alpha.38 (2019-11-04)

Bug Fixes

  • 🐛 Update styling and adjust documentaiton (e379009)

Miscellaneous chores

5.0.1-alpha.37 (2019-11-01)

Features

Miscellaneous chores

  • 🤖 Remove packages not approved for VID (2ef74aa)

5.0.0 (2019-09-11)

Miscellaneous chores

bootstrap (323a639)

4.2.0 (2019-07-08)

Features

  • 🎸 Add new font styles (1c3e3b7)

3.2.11 (2019-08-07)

Miscellaneous chores

  • 🤖 Remove packages not approved for VID (2ef74aa)

5.0.0 (2019-09-11)

Miscellaneous chores

bootstrap (323a639)

4.2.0 (2019-07-08)

Features

  • 🎸 Add new font styles (1c3e3b7)

3.2.11 (2019-08-07)

Miscellaneous chores

  • 🤖 Remove packages not approved for VID (2ef74aa)

5.0.0 (2019-09-11)

Miscellaneous chores

bootstrap (323a639)

4.2.0 (2019-07-08)

Features

  • 🎸 Add new font styles (1c3e3b7)

5.0.0 (2019-09-11)

Miscellaneous chores

bootstrap (323a639)

4.2.0 (2019-07-08)

Features

  • 🎸 Add new font styles (1c3e3b7)

4.2.0 (2019-07-08)

Features

  • 🎸 Add new font styles (1c3e3b7)

Miscellaneous chores

3.1.6 (2019-04-12)

Documentation Updates

  • ✏️ Clarify usage of npm token, and change name to gb (224fe32)

3.0.6 (2019-03-08)

Bug Fixes

  • 🐛 Labels and relationships (67189a9)

3.0.4 (2019-01-25)

Bug Fixes

  • 🐛 Use w and h units for background size, IE11 issue (850f8ce)

3.0.0 (2019-01-15)

⚠ BREAKING CHANGES

  • Class syntax has completely changed.

Features

  • 🎸 Scoping down guybrush (33e0d71)

Miscellaneous chores

  • 🤖 Cleanup and finalized scoping (9324126)

2.11.1 (2018-12-10)

Bug Fixes

  • 🐛 Add missing configuration files (02aa915)

2.9.0 (2018-11-26)

Bug Fixes

  • 🐛 Adjust icon placements (9201fac)

2.8.0 (2018-11-23)

Features

  • 🎸 Add new component: modal (161c0bc)

Documentation Updates

  • ✏️ Remove old text for readme and changelog (540b466)
Edit this section, Opens in new window
Contact us, Opens in new window