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

Include more performance benefit info in the README #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

philwolstenholme
Copy link

See #27

The code examples might be too opinionated perhaps, but I think they might be useful to show the HTML only approach vs the more dynamic approach.

Copy link

@nucliweb nucliweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏼👏🏼👏🏼👏🏼

@nucliweb
Copy link

nucliweb commented Jul 15, 2020

Btw, You may not need loadCSS…, by Filament Group.

Another approach, without dependencies will be:

<script>
  const media = window.matchMedia('(min-width: 1024px)')
  if (media.matches) {
    const desktopCSS = document.createElement('link');
    desktopCSS.rel = 'stylesheet';
    desktopCSS.href = '/css/desktop.css';
    document.getElementsByTagName('head')[0].appendChild(desktopCSS);
  }
</script>

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

Successfully merging this pull request may close these issues.

2 participants