Skip to content

Instantly share code, notes, and snippets.

@pixelbacon
Created December 25, 2018 22:29
Show Gist options
  • Save pixelbacon/dc7743cf60bc065367709e93fcf8482d to your computer and use it in GitHub Desktop.
Save pixelbacon/dc7743cf60bc065367709e93fcf8482d to your computer and use it in GitHub Desktop.

Vuetify Debug Component

A simple Vue component for debugging $vuetify's breakpoint object, as well as anything else needed for an app.

<template lang="pug" src="./template.pug"/>
<script src="./script.js"/>
<style lang="stylus" src="./style.styl"/>
export default {
data: () => ({
enableDebug: process.env.enableDebug,
toggleDebug: false
})
}
.debug
position fixed
top 0
left 0
z-index $depth--debug
+at(3)
max-width: 50%
+above(4)
max-width: 100%
&__cta,
&__info
padding 0.5em 0.66em
background alpha(black, 80%)
border-radius 0 0 4px 0
color white
font-size 12px
font-weight $fontWeight-bold
max-width: 80vw
.val
font-weight $fontWeight-light
margin-left 0.33em
a(v-if="enableDebug" @click.stop="toggleDebug = !toggleDebug").debug
div(v-if="toggleDebug" key="info").debug__info
div version:
span.val {{$phood.version}}
div dimensions:
span.val {{ $vuetify.breakpoint.width }}x{{ $vuetify.breakpoint.height }}
div bp:
span.val {{ $vuetify.breakpoint.name }}
div $mobileDetect:
span.val {{ $mobileDetect }}
div(v-else key="cta").debug__cta
v-icon(dark small) bug_report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment