Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for generating a StyleSheet targeting multiple Platforms worth of browser prefixes #326

Open
ryan-richt opened this issue Feb 27, 2022 · 0 comments

Comments

@ryan-richt
Copy link

This awesome library, does not seem to be currently capable of generating a style sheet statically and ahead of time (as opposed to, on-demand in response to a known JS environment) to be served to potentially many different browsers on different Platforms for which a union of browser prefix Transforms are needed. For instance, I might want to generate my css with both Firefox and Safari prefixes. Currently, you can subclass DevDefaults to override the default implicit def cssEnv with any singular Platform you wish, e.g.:

object DevDefaults extends Exports with DefaultSettings.Dev {
  override implicit val cssEnv: CssEnv = {
//    val platform: Platform[Option] = Platform[Option](Some("Chrome"),Some("Blink"),Some("40.0.2214.115"),Some("Chrome 40.0.2214.115 on Linux 64-bit"),None,None,Some("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36"),Some(OS[Option](Some(Bits64),Some("Linux"),None)))
    val platform: Platform[Option] = Platform[Option](Some("Firefox"),Some("Gecko"),Some("36.0"),Some("Firefox 36.0 on Linux 64-bit"),None,None,Some("Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"),Some(OS[Option](Some(Bits64),Some("Linux"),None)))
    CssEnv(platform, CssEnv.Media.empty(None))
  }
}
import DevDefaults._

However, it does not seem to be possible to configure this to generate prefixes for TWO Platforms at the same time. Since Platform and Env are both declared final you cannot subclass and override Env.prefixWhitelist and CanIUse2 is an object that cannot be swapped out.

Is there a current, or could there be a feature added, to permit statically generating style sheets targeting multiple `Platforms simultaneously?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant