Skip to content

Instantly share code, notes, and snippets.

@davidl
Last active December 16, 2015 01:19
Show Gist options
  • Save davidl/5354271 to your computer and use it in GitHub Desktop.
Save davidl/5354271 to your computer and use it in GitHub Desktop.
Use your devtools-theme colors for source views
// XML source viewer:
#webkit-xml-viewer-source-xml + .header,
#webkit-xml-viewer-source-xml + div + #tree {
background-color: @background !important;
color: @foreground !important;
}
#webkit-xml-viewer-source-xml + .header {
border-bottom: 1px solid @html-comment !important;
color: @html-comment !important;
font-family: 'DroidSansMono', Menlo, monospace !important;
margin: 0 !important;
padding: 10px 10px 15px 10px !important;
}
#webkit-xml-viewer-source-xml + div + #tree {
padding-left: 20px !important;
padding-top: 1em !important;
margin: 0 !important;
}
// view-source:
body > .webkit-line-gutter-backdrop + table .webkit-line-content {
background-color: @background !important;
color: @foreground !important;
}
body > .webkit-line-gutter-backdrop + table .webkit-line-number {
background-color: @background !important;
color: @html-comment !important;
font-size: 0.8125em !important; // = 13px
}
// markup in both views (XML, view-source):
#webkit-xml-viewer-source-xml + div + #tree,
body > .webkit-line-gutter-backdrop + table {
font-family: 'DroidSansMono', Menlo, monospace !important;
.webkit-html-comment { color: @html-comment !important; } // includes processing instructions
.webkit-html-doctype { color: @html-comment !important; }
.webkit-html-tag { color: @html-tag !important; }
.webkit-html-attribute-name { color: @html-attribute-name !important; }
.webkit-html-attribute-value { color: @html-attribute-value !important; }
.webkit-html-attribute-value webkit-html-resource-link { color: @html-link !important; } // anchors
.expand-button,
.collapse-button {
-webkit-filter: invert(100%);
}
::selection {
background: @selection !important;
opacity: 1;
}
}
// fill the viewport in case the source is shorter:
#webkit-xml-viewer-source-xml + div + #tree::before,
.webkit-line-gutter-backdrop::before,
body > .webkit-line-gutter-backdrop + table::before {
background-color: @background !important;
content: "" !important;
height: 100% !important;
left: 0 !important;
position: absolute !important;
top: 0 !important;
width: 100% !important;
z-index: -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment