Since launching in summer 2017, the MDS library has continued to grow and evolve to meet customer needs. While the vast majority of updates are compatible with earlier releases, a handful of revisions have required breaking changes to the design and code API. As a result, MDS launched a second major release version 2.0.0 in June 2018. Teams upgrading from any version of MDS prior to v2.0.0 must take specific steps to upgrade as described in this guide.
It is recommmended that teams always upgrade to the most recent MDS version. For details see the release history. Unless otherwise specified, information in this guide applies to all versions of MDS v2.x.x up to and including the most recent.
Please refer to this page over time or even print it as a checklist as you complete your upgrade.
The MDS v2 release significantly evolves how adopting product squads consume the MDS package and includes updates to the visual language (like Color) and UI component library (like Button or List Group).
MDS reduced the complexity of the package by optimizing assets so that adopting teams consume the visual language and UI component library more easily. The changes include:
MDS fortified tooling that applies the visual language of color, typography, space, and more, including:
mds-
, as well as improving their documentation.MDS web components are Custom Elements that internalize HTML markup within each component, which greatly streamlines integration and maintenance. As alternative to upgrading the HTML markup, teams can choose to adopt MDS web components when available. Currently only a subset of UI components are have been released as web components. See the Component Status page for details on availability.
In addition to the release of web components, other significant changes to the component library include:
Namespacing makes it possible to use multiple versions of MDS within the same application by specifying the MDS version used by each component. See namespacing style dependencies for more information.
Upgrading to version 2 should not require a significant investment for adopting teams.
For existing MDS adopters, upgrading is mostly a technical exercise to revise how your product installs MDS code followed by itemized changes to the visual language and UI components.
An engineer on your team should:
mds-button
) to find all instances.node_modules/morningstar-design-system/dist/mds.css
node_modules/morningstar-design-system/dist/mds.svg
node_modules/morningstar-design-system/fonts/*
node_modules/morningstar-design-system/constants/constants.css
node_modules/morningstar-design-system/components/**/*.scss
node_modules/morningstar-design-system/styles/**/*.scss
For AutoPrefixer, use the following configuration:
{
browsers: ['last 2 versions'],
grid: true
}
For CleanCSS, use the following configuration:
{
level: 2
}
The version 2 release includes many updates across the MDS visual language. Impacted features include Constants, mixins, and CSS classes that are applied throughout the component library as well as adopting products creating their own style, components, and layout.
Follow the checklist items below to trace breaking changes relative to your team’s implementation.
v1 Constant
|
v2 Constant
|
---|---|
|
|
|
|
|
|
v1 Class
|
v2 Class
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
MDS-3839 PR-659 Altered tense of asset allocation color constants.
MDS-3006 PR-611 Renamed Asset Allocation colors and removed $mds-visualization-color-asset-allocation-non-local-stocks
.
v1 Constant
|
v2 Constant
|
---|---|
|
|
|
|
|
|
v1 Constant
|
v2 Constant
|
---|---|
|
|
|
|
MDS-3893 PR-672 Removed text coloring mixin from typography mixins applied for headings and body text.
In MDS version 1.x, the mds-level-2-heading()
mixin included a reference to the mds-text-color-primary()
mixin.
[.your-custom-css-rule-using-v1] {
@include mds-level-2-heading(); // includes text coloring
}
In MDS version 2, the mds-level-2-heading()
mixin does not reference the mds-text-color-primary()
mixin, which therefore must be invoked separately.
[.your-custom-css-rule-using-v2] {
@include mds-level-2-heading(); // omits text coloring
@include mds-text-color-primary();
}
v1 Icon Name
|
v2 Icon Name
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
v1 Mixin Name
|
v2 Mixin Name
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When upgrading UI components, teams have two options:
These approaches are not mutually-exclusive. Adoption of MDS web components may be done gradually on a per-component basis as new web components become available.
MDS-4090 PR-733 Updated Alert markup to improve out-of-the-box accessibility of the component.
Alert markup in 1.x
:
...
<div class="mds-alert__content">
<h4 class="mds-alert__title">[Alert Title]</h4>
...
Alert markup in 2.x
:
...
<aside class="mds-alert__content">
<strong class="mds-alert__title">[Alert Title]</strong>
...
MDS-2354 PR-681 Adjust button icon size to properly show the correct medium icon for large and medium size flat buttons.
Card markup in 1.x
:
...
<div class="mds-card__title"> Core Bond Funds </div>
...
Card markup in 2.x
:
...
<h2 class="mds-card__title"> Core Bond Funds </h2>
...
MDS-3406 PR-630 Applied dialog max width of 350px and added a width: 100%
rule to account for responsiveness.
MDS-3392 PR-650 Refactored Dialog class names and styling.
MDS-3829 PR-669 Adjusted the size of many form elements, including checkbox, input, label, radio button, select, and textarea, to align with each other and other MDS components across the library, including changes to font-weight
, line-height
, and font sizes applied across small, medium and large component sizes.
MDS-3305 PR-602 Added sizing features and support for icons per item. Removed and renamed element and modifier classes across many features including toggling and highlighting a selected item.
v1 Class
|
v2 Class
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MDS-3704 PR-683 Corrected the paired display of icon and label within the selected item of a list group item within a menu.
Menu markup in 1.x
:
...
<div class="mds-popover mds-popover--width-200px" role="tooltip">
<header class="mds-popover__header">
<h3 class="mds-popover__title"> Workbook </h3>
...
Menu markup in 2.x
:
...
<section class="mds-popover mds-popover--width-200px" role="tooltip">
<header class="mds-popover__header">
<h2 class="mds-popover__title"> Workbook </h2>
...
MDS-3840 PR-685 Removed default modal dimensions and t-shirt sizes available from modals and updated MDS doc site demonstration displays and scripting to reflect less opinionated sizing.
MDS-4250 PR-730 Renamed mds-modal__body
class to mds-modal__content
and removed font style properties.
MDS-3362 PR-680 Removed the deprecated version of Notification, promoting “Notification Enhanced” (released previously) to be the default Notification component.
MDS-4090 PR-733 Updated Notification title markup to improve out-of-the-box accessibility of the component.
Notification markup in 1.x
:
...
<h4 class="mds-notification-enhanced__title">[Notification Title]</h4>
...
Notification markup in 2.x
:
...
<strong class="mds-notification__title">[Notification Title]</strong>
...
MDS-2684 PR-677 Removed default t-shirt sizes used to specify Popover width, and renamed the referenced trigger.
MDS-4250 PR-730 Removed the mds-popover__paragraph
class and removed font style properties from the mds-popover__content
class.
Popover markup in 1.x
:
...
<div class="mds-popover mds-popover--width-200px" role="tooltip">
<header class="mds-popover__header">
<h3 class="mds-popover__title"> Workbook </h3>
...
Popover markup in 2.x
:
...
<section class="mds-popover mds-popover--width-200px" role="tooltip">
<header class="mds-popover__header">
<h2 class="mds-popover__title"> Workbook </h2>
...
MDS-3433 PR-625 Removed Site Navigation-specific mixins, integrating styling directly into CSS rules.
The Morningstar Design System uses SemVer versioning to signal that major versions of the system are not backwards compatible. To use multiple versions of MDS within the same application, style references can optionally be namespaced to specify the major MDS version used by specific components. For example, this makes it possible to upgrade specific components to take advantage of new functionality, while other components continue to use the older version.
When namespacing styles, the following should be taken into consideration:
If using MDS HTML components, product teams need to update the HTML markup for each component instance they want to namespace. This may add to the cost of ongoing maintenance.
If using MDS Web Components, the logic to support namespacing is internalized within each component, and can be enabled by setting a property on the component instance. This approach streamlines implementation and maintenance because each component automatically resolves to the proper namespaced version.
Loading multiple major versions of MDS on the same page may cause performance concerns. Before implementing this approach, consider if loading multiple major versions of the MDS library on the same page is necessary.
Namespacing is optional, and only need be enabled on the specific components instances that need it. For example if you want to selectively upgrade buttons to a newer MDS version, or only upgrade components on specific pages within an application, all other components instances can be left as is. Style references that are not namespaced to a specific major version will default to the current installed MDS version.
These instructions assume MDS has already been installed in the product. If not, please follow the installation instructions before proceeding.
Beginning with MDS version 2.20.0, MDS includes a namespaced CSS file in addition to the standard compiled MDS CSS file. The file is named mds.v2.css
and can be found at /dist/mds.v2.css
in the MDS npm package.
mds.v2.css
in the application in addition to loading the standard mds.css
before updating the markup files to make use of the namespaced styles. (Both versions are required to ensure support for both namespaced and non-namespaced components; specific requirements may vary by application.)If an application team is compiling the MDS SCSS files at built time, developers on that team will need to add the namespace at compile time. If using the MDS Web Components the namespace value needs to be set to mds-v[current major version of MDS]
(e.g. for version 2.x.x, the value will be mds-v2
).
Depending on the method used to compile SCSS to CSS, several solutions are already available:
Gulp MDS custom solution: https://msstash.morningstar.com/projects/TECHSTD/repos/mds/browse/library/tasks/namespace.js
If using MDS HTML markup, developers will need to update MDS classnames to reference the namespaced version as shown in the following example:
<button class="mds-button mds-button--primary" type="button">My Button</button>
// Set constant to manage MDS version (do this in a central location)
const namespace = "mds-v2";
// Update MDS HTML Component instance to use namespaced style
<button class="${namespace}-button ${namespace}-button--primary" type="button">My Button</button>
mds-v[current major version of MDS]
(e.g. for version 2.x.x, the value will be mds-v2
).MDS web components provide built-in namespacing functionality. Web components will always be namespaced to the major version of MDS that matches the internal component template to ensure the correct style versions are used. To namespace a web component enable the Boolean prop namespaced
on the component.
<mds-button>My Button</mds-button>
`<mds-button namespaced>My Button</mds-button>`