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

Modern mode: CSS #3

Open
yabab-dev opened this issue Nov 13, 2018 · 2 comments
Open

Modern mode: CSS #3

yabab-dev opened this issue Nov 13, 2018 · 2 comments

Comments

@yabab-dev
Copy link
Contributor

Idea from @academici

Original content:

"Green browsers" support attribute "module" on tag script, old browsers use scripts with attribute "nomodule". But tag link no support "nomodule".

Idea

Create config option modernBrowsers

modernBrowsers = [
    'Chrome >= 60',
    'Safari >= 10.1',
    'iOS >= 10.3',
    'Firefox >= 54',
    'Edge >= 15',
  ]

Configure postcss.config.js

const isModern = process.env.VUE_CLI_MODERN_MODE && !process.env.VUE_CLI_MODERN_BUILD
let autoprefixerConfig = {}

if(isModern) {
  autoprefixerConfig.browsers = modernBrowsers
}

module.exports = {
  plugins: {
    autoprefixer: {
      ...autoprefixerConfig,
    },
  },
};

Files were generated in dist folder and precache-manifest.

Create middleware using useragent parser and modernBrowsers option.

In html file include needed styles.

what do you think of this idea?

@academici
Copy link

@academici
Copy link

Will there be conflicts with Critical Css #2 ?

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

No branches or pull requests

2 participants