Update to the latest version of MDC #1070
Labels
feature
New feature or request
released
usability
Things that make it harder or easier for users to understand or use elements
visual design
Visual styling that may or may not affect usability
New feature motivation
We are using MDC v4.0.0, released 2 November 2019, while the latest available version is v8.0.0 released 2 November 2020. We want to update the package to take advantage of all the new stuff in the newer versions, obviously, but keeping up to date is also important to make sure that the components keep working in new browsers, make use of new advances in usability and accessibility, etc etc. And the more we tweak the components while using v4, the more work it will be to upgrade.
In other words, the longer we wait to upgrade, the more work it will be.
New feature description
For a quick idea of the amount of fixes and improvements, here is the relevant part of the changelog:
Click to expand changelog
8.0.0 (2020-11-02)
Bug Fixes
[@use](https://github.com/use)
(098ae32)data-mdc-dialog-initial-focus
doesn't work (a0ec7e2)width: 100%
to account for margin around slider track. (16c563e)Code Refactoring
Documentation
Features
indeterminate
checkbox (b273afa)aria-valuetext
on slider thumbs. (fd608ff)Reverts
BREAKING CHANGES
typography.baseline-top()
andtypography.baseline-bottom()
are now private. Usetypography.baseline()
for containers andtypography.text-baseline()
for text with $top and $bottom params.mdc-select__selected-text-container
span; see README for updated markupripple()
=>ripple-styles()
in MDC checkboxripple()
=>ripple-styles()
in MDC checkboxripple()
=>ripple-styles()
in MDC checkbox@material/theme/css
hover-label-color()
) are combined into the non-stateful mixin (e.g.label-color()
). The default state of the mixin can be set as normal, or a Map of states can be provided to optionally set one or more states of the mixin (e.g.label-color((hover: blue))
). See the@material/theme/state
package for more details.getAttr
added on helper text subcomponent; adapter methodsetInputAttr
andremoveInputAttr
added on main component$default-size
,$stroke-width
, and$container-side-length
variables removed.mdc-snackbar--stacked
variant will now have an additional 8pxgetTableBodyHeight()
=>getTableHeaderHeight()
and changed return types of this method.$input-padding
,$input-padding-top
,$input-padding-bottom
,$outlined-input-padding-top
,$outlined-input-padding-bottom
,$input-border-bottom
getBuffer
,getPrimaryBar
,setStyle
removed. MDCLinearProgressAdapter methodsetBufferBarStyle
,setPrimaryBarStyle
added.getBuffer
,getPrimaryBar
,setStyle
removed. MDCLinearProgressAdapter methodsetBufferBarStyle
,setPrimaryBarStyle
added.7.0.0 (2020-06-23)
Bug Fixes
[@use](https://github.com/use)
(098ae32)transform:none
(9ea5207)Code Refactoring
Features
indeterminate
checkbox (b273afa)BREAKING CHANGES
getBuffer
,getPrimaryBar
,setStyle
removed. MDCLinearProgressAdapter methodsetBufferBarStyle
,setPrimaryBarStyle
added.getBuffer
,getPrimaryBar
,setStyle
removed. MDCLinearProgressAdapter methodsetBufferBarStyle
,setPrimaryBarStyle
added.addMenuClass
,removeMenuClass
isTypeaheadInProgress
,typeaheadMatchItem
$dropdown-color
renamed to$dropdown-icon-color
,$dropdown-opacity
removed,$disabled-dropdown-opacity
removed.isSelectedTextFocused
,getSelectedTextAttr
,setSelectedTextAttr
; ADDED adapter methodsisSelectAnchorFocused
,getSelectAnchorAttr
,setSelectAnchorAttr
; removed variablesoutlined-dense-label-position-y
,icon-padding
; added variablesminimum-height-for-filled-label
,filled-baseline-top
,selected-text-height
,anchor-padding-left
,anchor-padding-left-with-leading-icon
,anchor-padding-right
.density
mixin split intofilled-density
,filled-with-leading-icon-density
;height
mixin split intofilled-height
,filled-with-leading-icon-height
mdc-menu--fullwidth
class replaces custom width class for the menu markup in selectremoveSelectAnchorAttr
mdc-select__dropdown-icon-graphic
class.mdc-list-item__text
spans removed in select markupmdc-select-helper-text--persistent
removedmdc-select--filled
class on its rootdemo-width-class
) on the root instead of the anchor for width adjustments; alternately, use the newmdc-select--fullwidth
on the root to expand width to that of its parent container$outline-disabled-border
renamed to$disabled-outline-color
; icon variable$icon-opacity
removed, use alpha channel of$icon-color
instead.$input-padding
,$input-padding-top
,$input-padding-bottom
,$outlined-input-padding-top
,$outlined-input-padding-bottom
,$input-border-bottom
mdc-text-field__resizer
span around the textarea (and internal counter if present) if they are resizablemdc-text-field--with-internal-counter
class. Character counters should move after the textarea element.color-hash()
(and checkbox container-colors mixins) no longer works withvar()
values and now only works with custom property Maps created bycustom-properties.create()
typography.baseline-top()
andtypography.baseline-bottom()
are now private. Usetypography.baseline()
for containers andtypography.text-baseline()
for text with $top and $bottom params.6.0.0 (2020-04-22)
Bug Fixes
[@use](https://github.com/use)
(098ae32)Code Refactoring
Features
indeterminate
checkbox (b273afa)Reverts
BREAKING CHANGES
select: HTML Markup significantly changed, see README; REMOVED adapter methods
isSelectedTextFocused
,getSelectedTextAttr
,setSelectedTextAttr
; ADDED adapter methodsisSelectAnchorFocused
,getSelectAnchorAttr
,setSelectAnchorAttr
; removed variablesoutlined-dense-label-position-y
,icon-padding
; added variablesminimum-height-for-filled-label
,filled-baseline-top
,selected-text-height
,anchor-padding-left
,anchor-padding-left-with-leading-icon
,anchor-padding-right
.text-field: Redundant mixins
mdc-text-field-textarea-fill-color
,mdc-text-field-textarea-stroke-color
,mdc-text-field-fullwidth-bottom-line-color
removed. Instead, usemdc-text-field-fill-color
,mdc-text-field-outline-color
, andmdc-text-field-bottom-line-color
respectively to achieve the same effect.textfield: mdc-text-field--dense and associated mixins/variables have been removed. Use the density() mixin instead.
textfield: removed the following variables:
$input-padding
,$input-padding-top
,$input-padding-bottom
,$outlined-input-padding-top
,$outlined-input-padding-bottom
,$input-border-bottom
linear-progress: DOM for linear progress buffer changed. MDCLinearProgressAdapter method
getBuffer
,getPrimaryBar
,setStyle
removed. MDCLinearProgressAdapter methodsetBufferBarStyle
,setPrimaryBarStyle
added.linear-progress: DOM for linear progress buffer changed. MDCLinearProgressAdapter method
getBuffer
,getPrimaryBar
,setStyle
removed. MDCLinearProgressAdapter methodsetBufferBarStyle
,setPrimaryBarStyle
added.typography:
typography.baseline-top()
andtypography.baseline-bottom()
are now private. Usetypography.baseline()
for containers andtypography.text-baseline()
for text with $top and $bottom params.chips: The touch target and text now appear inside the primary action element. Please see the readme for markup changes.
textfield: filled text fields must include a
<div class="mdc-text-field__ripple"></div>
textfield: Filled textfields will no longer show a floating label at certain densities. This can be overridden by setting
$mdc-text-field-minimum-height-for-filled-label: 40px
chips: Both
MDCChipAdapter
andMDCChipSetAdapter
have new methods.MDCChipSetFoundation
event handlers now accept the corresponding chip event detail interface as the sole argument. Theroot
property has been removed from theMDCChipRemovalEventDetail
interface.line-ripple:
mdc-line-ripple-color()
mixin has been renamed tomdc-line-ripple-active-color()
textfield: Default textfields must now specify mdc-text-field--filled. Disabled outlined textfields no longer have a shaded background. Height mixin no longer specifies a baseline override, use typography's baseline-top mixin.
Four variables and a mixin in mdc-textfield were renamed to use a mdc-text-field- prefix when depended on via @import (formerly mdc-required-text-field-label-asterisk_, now required-label-asterisk_).
textfield: icons must use
.mdc-text-field__icon--leading
or.mdc-text-field__icon--trailing
classes.mdc-text-field-icon-color()
mixin has been split intomdc-text-field-leading-icon-color()
andmdc-text-field-trailing-icon-color()
.switch: Added setNativeControlAttr method in mdc-switch adapter.
checkbox: remove event listener for 'change' and add event listener for 'click'.
$mdc-button-disabled-container-fill-color
renamed to
$mdc-button-disabled-container-color
.$edgeOptOut
option frommdc-theme-prop()
Sass mixin.removed from MDC-Web. Some of its functionalities are available in the MDC Image List package instead. It is recommended that you migrate to the mdc-image-list package to continue to receive new features and updates.
New feature implementation
We need to update the package, and then go through our different components, find the things that don't work or look to bad to be acceptable, and fix those issues 🙂
The text was updated successfully, but these errors were encountered: