Skip to content

Instantly share code, notes, and snippets.

@abe33
Created February 23, 2015 15:19
Show Gist options
  • Save abe33/721f4a82e27c4be8d95d to your computer and use it in GitHub Desktop.
Save abe33/721f4a82e27c4be8d95d to your computer and use it in GitHub Desktop.
Collect markdown preview styles
rules = []
ruleRegExp = /\.markdown-preview/
for stylesheet in document.styleSheets
if stylesheet.rules?
for rule in stylesheet.rules
if rule.selectorText?.match(ruleRegExp)?
rules.push(rule.cssText)
console.log rules.join('\n')
@abe33
Copy link
Author

abe33 commented Feb 23, 2015

With my setup it gives:

.markdown-preview { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; line-height: 1.6; overflow: scroll; box-sizing: border-box; padding: 20px; background-color: rgb(255, 255, 255); }
.markdown-preview code { color: rgb(51, 51, 51); }
.markdown-preview code, .markdown-preview tt, .markdown-preview atom-text-editor { font-size: 12px; font-family: Consolas, 'Liberation Mono', Courier, monospace; }
.markdown-preview a, .markdown-preview a code { color: rgb(65, 131, 196); }
.markdown-preview ol > li { list-style-type: decimal; }
.markdown-preview ul > li { list-style-type: disc; }
.markdown-preview li > atom-text-editor { display: inline-block; vertical-align: top; width: 100%; }
.markdown-preview li:last-child > atom-text-editor { margin-bottom: 0px; }
.markdown-preview > :first-child { margin-top: 0px !important; }
.markdown-preview > :last-child { margin-bottom: 0px !important; }
.markdown-preview a.absent { color: rgb(204, 0, 0); }
.markdown-preview a.anchor { display: block; padding-left: 30px; margin-left: -30px; cursor: pointer; position: absolute; top: 0px; left: 0px; bottom: 0px; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 { font-family: 'Helvetica Neue', Helvetica, sans-serif; margin: 20px 0px 10px; padding: 0px 0px 10px; font-weight: bold; -webkit-font-smoothing: antialiased; cursor: text; position: relative; }
.markdown-preview h1 .octicon-link, .markdown-preview h2 .octicon-link, .markdown-preview h3 .octicon-link, .markdown-preview h4 .octicon-link, .markdown-preview h5 .octicon-link, .markdown-preview h6 .octicon-link { display: none; color: rgb(0, 0, 0); }
.markdown-preview h1:hover a.anchor, .markdown-preview h2:hover a.anchor, .markdown-preview h3:hover a.anchor, .markdown-preview h4:hover a.anchor, .markdown-preview h5:hover a.anchor, .markdown-preview h6:hover a.anchor { text-decoration: none; line-height: 1; padding-left: 0px; margin-left: -22px; top: 15%; }
.markdown-preview h1:hover a.anchor .octicon-link, .markdown-preview h2:hover a.anchor .octicon-link, .markdown-preview h3:hover a.anchor .octicon-link, .markdown-preview h4:hover a.anchor .octicon-link, .markdown-preview h5:hover a.anchor .octicon-link, .markdown-preview h6:hover a.anchor .octicon-link { display: inline-block; }
.markdown-preview h1 tt, .markdown-preview h2 tt, .markdown-preview h3 tt, .markdown-preview h4 tt, .markdown-preview h5 tt, .markdown-preview h6 tt, .markdown-preview h1 code, .markdown-preview h2 code, .markdown-preview h3 code, .markdown-preview h4 code, .markdown-preview h5 code, .markdown-preview h6 code { font-size: inherit; }
.markdown-preview h1 { font-size: 28px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(221, 221, 221); color: rgb(0, 0, 0); }
.markdown-preview h2 { font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(0, 0, 0); }
.markdown-preview h3 { font-size: 18px; }
.markdown-preview h4 { font-size: 16px; }
.markdown-preview h5 { font-size: 14px; }
.markdown-preview h6 { color: rgb(119, 119, 119); font-size: 14px; }
.markdown-preview p, .markdown-preview blockquote, .markdown-preview ul, .markdown-preview ol, .markdown-preview dl, .markdown-preview table, .markdown-preview atom-text-editor { margin: 15px 0px; }
.markdown-preview hr { border: 0px none; color: rgb(204, 204, 204); height: 4px; padding: 0px; margin: 15px 0px; background: url(atom://markdown-preview/assets/hr.png) 0px 0px repeat-x transparent; }
.markdown-preview > h2:first-child, .markdown-preview > h1:first-child, .markdown-preview > h1:first-child + h2, .markdown-preview > h3:first-child, .markdown-preview > h4:first-child, .markdown-preview > h5:first-child, .markdown-preview > h6:first-child { margin-top: 0px; padding-top: 0px; }
.markdown-preview a:first-child h1, .markdown-preview a:first-child h2, .markdown-preview a:first-child h3, .markdown-preview a:first-child h4, .markdown-preview a:first-child h5, .markdown-preview a:first-child h6 { margin-top: 0px; padding-top: 0px; }
.markdown-preview h1 + p, .markdown-preview h2 + p, .markdown-preview h3 + p, .markdown-preview h4 + p, .markdown-preview h5 + p, .markdown-preview h6 + p { margin-top: 0px; }
.markdown-preview li p.first { display: inline-block; }
.markdown-preview ul, .markdown-preview ol { padding-left: 30px; }
.markdown-preview ul.no-list, .markdown-preview ol.no-list { list-style-type: none; padding: 0px; }
.markdown-preview ul li > :first-child, .markdown-preview ol li > :first-child, .markdown-preview ul li ul:first-of-type, .markdown-preview ol li ul:first-of-type { margin-top: 0px; }
.markdown-preview ul ul, .markdown-preview ul ol, .markdown-preview ol ol, .markdown-preview ol ul { margin-bottom: 0px; }
.markdown-preview dl { padding: 0px; }
.markdown-preview dl dt { font-size: 14px; font-weight: bold; font-style: italic; padding: 0px; margin: 15px 0px 5px; }
.markdown-preview dl dt:first-child { padding: 0px; }
.markdown-preview dl dt > :first-child { margin-top: 0px; }
.markdown-preview dl dt > :last-child { margin-bottom: 0px; }
.markdown-preview dl dd { margin: 0px 0px 15px; padding: 0px 15px; }
.markdown-preview dl dd > :first-child { margin-top: 0px; }
.markdown-preview dl dd > :last-child { margin-bottom: 0px; }
.markdown-preview blockquote { border-left-width: 4px; border-left-style: solid; border-left-color: rgb(221, 221, 221); padding: 0px 15px; color: rgb(119, 119, 119); }
.markdown-preview blockquote > :first-child { margin-top: 0px; }
.markdown-preview blockquote > :last-child { margin-bottom: 0px; }
.markdown-preview blockquote p { font-size: 16px; line-height: 1.5; }
.markdown-preview table th { font-weight: bold; }
.markdown-preview table th, .markdown-preview table td { border: 1px solid rgb(204, 204, 204); padding: 6px 13px; }
.markdown-preview table tr { border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(255, 255, 255); }
.markdown-preview table tr:nth-child(2n) { background-color: rgb(248, 248, 248); }
.markdown-preview img { max-width: 100%; }
.markdown-preview span.frame { display: block; overflow: hidden; }
.markdown-preview span.frame > span { border: 1px solid rgb(221, 221, 221); display: block; float: left; overflow: hidden; margin: 13px 0px 0px; padding: 7px; width: auto; }
.markdown-preview span.frame span img { display: block; float: left; }
.markdown-preview span.frame span span { clear: both; color: rgb(51, 51, 51); display: block; padding: 5px 0px 0px; }
.markdown-preview span.align-center { display: block; overflow: hidden; clear: both; }
.markdown-preview span.align-center > span { display: block; overflow: hidden; margin: 13px auto 0px; text-align: center; }
.markdown-preview span.align-center span img { margin: 0px auto; text-align: center; }
.markdown-preview span.align-right { display: block; overflow: hidden; clear: both; }
.markdown-preview span.align-right > span { display: block; overflow: hidden; margin: 13px 0px 0px; text-align: right; }
.markdown-preview span.align-right span img { margin: 0px; text-align: right; }
.markdown-preview span.float-left { display: block; margin-right: 13px; overflow: hidden; float: left; }
.markdown-preview span.float-left span { margin: 13px 0px 0px; }
.markdown-preview span.float-right { display: block; margin-left: 13px; overflow: hidden; float: right; }
.markdown-preview span.float-right > span { display: block; overflow: hidden; margin: 13px auto 0px; text-align: right; }
.markdown-preview code, .markdown-preview tt { margin: 0px 2px; padding: 0px 5px; border: 1px solid rgb(234, 234, 234); border-radius: 3px; text-shadow: none; background-color: rgb(248, 248, 248); }
.markdown-preview code { white-space: nowrap; }
.markdown-preview atom-text-editor { font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-radius: 3px; border: 1px solid rgb(22, 25, 29); background: rgb(43, 49, 59); }
.markdown-preview kbd { border-radius: 2px; border-width: 1px; border-style: solid; border-color: rgb(221, 221, 221) rgb(204, 204, 204) rgb(204, 204, 204) rgb(221, 221, 221); padding: 1px 4px; line-height: 10px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-image: linear-gradient(rgb(241, 241, 241), rgb(221, 221, 221)); background-color: rgb(221, 221, 221); background-repeat: repeat-x; }
.markdown-preview .emoji { height: 20px; width: 20px; }

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