Last active
March 22, 2019 12:47
-
-
Save adipascu/10f919b3daa18c2221de934f34f22bec to your computer and use it in GitHub Desktop.
Revisions
-
adipascu revised this gist
Mar 22, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ /* This fixes issues with: - devices that incorrectly state they support hover (Samsung Galaxy Note 9, SM-N960F, Android 8.1, Chrome 73) - devices that do not support media queries for hover, but they are enabled by default in Material-UI */ export default { -
adipascu revised this gist
Mar 22, 2019 . No changes.There are no files selected for viewing
-
adipascu revised this gist
Mar 22, 2019 . 1 changed file with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,6 @@ export default { onProcessStyle(style, rule) { if (rule.type !== 'style') return style; let newProps = []; for (const prop in style) { @@ -21,9 +18,6 @@ export default { throw new Error(`Could not process media query ${prop}`); } } if (newProps.length > 0) { return { ...style, ...Object.fromEntries(newProps) }; } -
adipascu created this gist
Mar 22, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ /* This fixes issues with: - devices that incorrectly state they support hover (Galaxy S9, Android 8.1, Chrome 73) - devices that do not support media queries for hover, but they are enabled by default in Material-UI */ export default { onProcessStyle(style, rule) { if (rule.type !== 'style') return style; /* eslint-disable guard-for-in */ /* eslint-disable no-restricted-syntax */ /* eslint-disable no-param-reassign */ let newProps = []; for (const prop in style) { const isNestedConditional = prop === '@media (hover: none)'; if (isNestedConditional) { newProps = newProps.concat(Object.entries(style[prop])); delete style[prop]; } else if (prop[0] === '@' && prop.includes('hover')) { throw new Error(`Could not process media query ${prop}`); } } /* eslint-enable guard-for-in */ /* eslint-enable no-restricted-syntax */ /* eslint-enable no-param-reassign */ if (newProps.length > 0) { return { ...style, ...Object.fromEntries(newProps) }; } return style; }, };