fundamental icon indicating copy to clipboard operation
fundamental copied to clipboard

Bug: Fundamentals exports raw CSS variables which aren't compatible in IE11

Open mobot11 opened this issue 6 years ago • 10 comments

Describe the bug A clear and concise description of what the bug is.

  • css consumed from the fiori-fundamental npm package contains raw CSS variables which are not compatible with IE 11.

Is this issue related to a specific component?

  • Any component with CSS variables

What version of the Fiori Fundamentals are you using? 0.1.0 What offering/product do you work on? Any pressing ship or release dates we should be aware of?

  • Member of SAP Concur Core UI and fundamental-react team which will rely on this library in the future

What front-end framework are you implementing in, e.g., Angular, React, etc.?

  • fundamental-react

To Reproduce Steps to reproduce the behavior:

  1. Go to https://sap.github.io/fundamental/components/alert.html in IE11
  2. See background color of Alert component isn't the same as in chrome

Expected behavior

  • CSS variables should be compiled at build time using https://github.com/MadLittleMods/postcss-css-variables and webpack (ideally) or Ponyfilled when used in IE (less ideal) https://www.npmjs.com/package/css-vars-ponyfill

Screenshots ie11-fundamentals

Desktop (please complete the following information):

  • OS: [e.g. iOS] IOS 10.14 VirtualBox
  • Browser [e.g. chrome, safari] IE11

mobot11 avatar Feb 01 '19 04:02 mobot11

Additionally, the provided IE11 polyfill file still has CSS variables in it.

First instance https://github.com/SAP/fundamental/blob/develop/dist/fiori-fundamentals-ie11.css#L2090

and plenty more...

bcullman avatar Feb 01 '19 04:02 bcullman

IE11 support is a requirement for fiori3.

bcullman avatar Feb 01 '19 04:02 bcullman

Yes, we opted to go in with CSS custom properties to solve for teams that want run-time theme switching and style encapsulation. The recommendation is to use the IE11-compatible file where we include the fallback values if you need that support.

Thanks for the heads-up on the PostCSS process. That would be a good addition to output a more streamlined IE11-compat file.

xak avatar Feb 01 '19 16:02 xak

screen shot 2019-01-31 at 1 17 32 pm

droshev avatar Feb 01 '19 17:02 droshev

Not supporting IE11 by default will make extremely difficult consuming directly fundamental-ui in fundamental-ngx, fundamental-react, and fundamental-vue. that's why this is a very critical issue. Most of the products we are working on do/require support IE11.

droshev avatar Feb 01 '19 17:02 droshev

@droshev I recommend you update your README to indicate that if IE11 support is needed then use the IE 11 library. The end result will be the same only with a heavier CSS load.

"./node_modules/fiori-fundamentals/dist/fiori-fundamentals-ie11.css"

xak avatar Feb 04 '19 14:02 xak

@xak That is not addressing the issue that was brought up here - the fiori-fundamentals-ie11.css you are distributing contains raw CSS vars that cannot be processed by IE11

You should also be including the fiori-fundamentals-ie11.css in your docs as well. This file can be included optionally, using the IE block you already have here:

https://github.com/SAP/fundamental/blob/develop/docs/_includes/head.html#L35-L38

bcullman avatar Feb 04 '19 17:02 bcullman

@jbadan ~ Since we're hoping to use post-css to get the desired outcome on this issue, doing this after your gulp refactoring should happen right?

eboyer avatar Apr 05 '19 00:04 eboyer

@eboyer yeah! I'm working on a spike right now to figure out how we want to address this.

jbadan avatar Apr 24 '19 15:04 jbadan

It looks like we have some places where there is not fallback yet - we can try to address those in this issue.

droshev avatar May 03 '19 19:05 droshev