Refactor CSS

pull/185/head
Thibaut 10 years ago
parent b29d6ca002
commit bec7ebbfea

@ -35,27 +35,21 @@
'pages/chai', 'pages/chai',
'pages/clojure', 'pages/clojure',
'pages/coffeescript', 'pages/coffeescript',
'pages/cordova',
'pages/d3', 'pages/d3',
'pages/ember', 'pages/ember',
'pages/express', 'pages/express',
'pages/git',
'pages/go', 'pages/go',
'pages/haskell', 'pages/haskell',
'pages/jquery', 'pages/jquery',
'pages/knockout', 'pages/knockout',
'pages/git',
'pages/grunt',
'pages/laravel', 'pages/laravel',
'pages/less',
'pages/lua', 'pages/lua',
'pages/marionette',
'pages/markdown',
'pages/maxcdn', 'pages/maxcdn',
'pages/mdn', 'pages/mdn',
'pages/meteor', 'pages/meteor',
'pages/modernizr', 'pages/modernizr',
'pages/moment', 'pages/moment',
'pages/mongoose',
'pages/nginx', 'pages/nginx',
'pages/node', 'pages/node',
'pages/php', 'pages/php',

@ -35,27 +35,21 @@
'pages/chai', 'pages/chai',
'pages/clojure', 'pages/clojure',
'pages/coffeescript', 'pages/coffeescript',
'pages/cordova',
'pages/d3', 'pages/d3',
'pages/ember', 'pages/ember',
'pages/express', 'pages/express',
'pages/git',
'pages/go', 'pages/go',
'pages/haskell', 'pages/haskell',
'pages/jquery', 'pages/jquery',
'pages/knockout', 'pages/knockout',
'pages/git',
'pages/grunt',
'pages/laravel', 'pages/laravel',
'pages/less',
'pages/lua', 'pages/lua',
'pages/marionette',
'pages/markdown',
'pages/maxcdn', 'pages/maxcdn',
'pages/mdn', 'pages/mdn',
'pages/meteor', 'pages/meteor',
'pages/modernizr', 'pages/modernizr',
'pages/moment', 'pages/moment',
'pages/mongoose',
'pages/nginx', 'pages/nginx',
'pages/node', 'pages/node',
'pages/php', 'pages/php',

@ -1,10 +1,7 @@
%simple { %simple {
padding-left: 1rem; padding-left: 1rem;
h1, h2, h3 { h1, h2, h3 { margin-left: -1rem; }
position: relative;
left: -1rem;
}
h2 { @extend %block-heading; } h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; } h3 { @extend %block-label, %label-blue; }
h4 { font-size: inherit; } h4 { font-size: inherit; }
@ -12,14 +9,21 @@
._mobile & { ._mobile & {
padding-left: 0; padding-left: 0;
h1, h2, h3 { left: 0; } h1, h2, h3 { margin-left: 0; }
} }
code { @extend %label; } p > code, li > code { @extend %label; }
blockquote { @extend %note; }
} }
._cordova,
._grunt,
._less,
._lodash, ._lodash,
._sinon, ._marionette,
._mocha { ._markdown,
._mocha,
._mongoose,
._sinon {
@extend %simple; @extend %simple;
} }

@ -1,13 +1,5 @@
._chai { ._chai {
padding-left: 1rem; @extend %simple;
> h1, > h2, h3 { margin-left: -1rem; }
> h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
h4 { font-size: 1em; }
code { @extend %label; }
blockquote { @extend %note; }
li.tag span { margin-right: 5px; } li.tag span { margin-right: 5px; }
} }

@ -1,10 +1,5 @@
._coffeescript { ._coffeescript {
padding-left: 1rem; @extend %simple;
> h1, > h2 { margin-left: -1rem; }
> h2 { @extend %block-heading; }
code { @extend %label; }
// CoffeeScript / JavaScript code blocks // CoffeeScript / JavaScript code blocks
> .code { > .code {

@ -1,10 +0,0 @@
._cordova {
padding-left: 1rem;
> h1, > h2 { margin-left: -1rem; }
> h2 { @extend %block-heading; }
> h3 { font-size: 1rem; }
code { @extend %label; }
blockquote { @extend %note; }
}

@ -1,10 +1,6 @@
._express { ._express {
padding-left: 1rem; @extend %simple;
h1, h2, h3 { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
p > code { @extend %label; }
.doc-box { @extend %note; } .doc-box { @extend %note; }
.doc-warn { @extend %note-red; } .doc-warn { @extend %note-red; }
} }

@ -1,7 +1,5 @@
._go { ._go {
padding-left: 1rem; @extend %simple;
h1, h2, #short-nav, table.dir { margin-left: -1rem; } #short-nav, table.dir { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
} }

@ -1,8 +0,0 @@
._grunt {
padding-left: 1rem;
h1, h2, h3 { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
p > code { @extend %label; }
}

@ -1,8 +0,0 @@
._less {
padding-left: 1rem;
> h1, > h2, h3, h4 { margin-left: -1rem; }
> h2 { @extend %block-heading; }
h3, h4 { @extend %block-label, %label-blue; }
code { @extend %label; }
}

@ -1,10 +1,5 @@
._lua { ._lua {
padding-left: 1rem; @extend %simple;
h1, h2 { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
h4 { font-size: inherit; }
.apii { float: right; } .apii { float: right; }
} }

@ -1,8 +0,0 @@
._marionette {
padding-left: 1rem;
> h1, > h2 { margin-left: -1rem; }
> h2 { @extend %block-heading; }
> h3 { @extend %block-label, %label-blue; }
blockquote { @extend %note; }
}

@ -1,7 +0,0 @@
._markdown {
padding-left: 1rem;
h1, h2, h3, h1 + ul { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
}

@ -1,11 +1,5 @@
._maxcdn { ._maxcdn {
padding-left: 1rem; @extend %simple;
h1, h2, h3 { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
h4 { font-size: 1em; }
p > code { @extend %label; }
.url { .url {
padding: .5rem; padding: .5rem;

@ -1,8 +0,0 @@
._mongoose {
padding-left: 1rem;
> h1, > h2, > h3 { margin-left: -1rem; }
> h2 { @extend %block-heading; }
> h3 { @extend %block-label, %label-blue; }
h4 { font-size: 1em; }
}

@ -1,10 +1,5 @@
._requirejs { ._requirejs {
padding-left: 1rem; @extend %simple;
h1, h2, h3, ul.index { margin-left: -1rem; }
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
h4 { font-size: 1em; }
ul.index ul { margin: .5em 0; } ul.index ul { margin: .5em 0; }
} }

@ -22,7 +22,7 @@ module Docs
end end
css('h1, h2, h3, h4').each do |node| css('h1, h2, h3, h4').each do |node|
node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } node.name = node.name.sub(/\d/) { |i| [i.to_i + 1, 3].min }
end end
css('pre').each do |node| css('pre').each do |node|

@ -23,7 +23,7 @@ module Docs
end end
css('h3[id^="import-options-"]').each do |node| css('h3[id^="import-options-"]').each do |node|
entries << ["@import #{node.content}", node['id']] entries << ["@import #{node.content}", node['id']] unless node.content =~ /example/i
end end
entries.concat [ entries.concat [
@ -52,7 +52,7 @@ module Docs
if node.name == 'h2' if node.name == 'h2'
type = node.content type = node.content
type.sub! %r{(.+) Functions}, 'Functions: \1' type.sub! %r{(.+) Functions}, 'Functions: \1'
elsif node.name == 'h4' elsif node.name == 'h3'
entries << [node.content, node['id'], type] entries << [node.content, node['id'], type]
end end
end end

Loading…
Cancel
Save