From 9a7603cfbfdf7c0b4a2210ef454cecf894c5e172 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 13 Nov 2013 17:00:01 +0100 Subject: [PATCH] Reorganize SCSS files, RWD-ize funding. --- .gitignore | 2 +- apps/funding/static/funding/funding.css | 1 - apps/funding/static/funding/funding.scss | 152 -------------- .../templates/funding/tags/funding.html | 11 +- apps/polls/static/polls/polls.css | 1 - .../static/css/main/_tools.scss | 29 --- .../static/css/main/footer.scss | 30 --- .../static/css/main/fragment.scss | 19 -- apps/wolnelektury_core/static/scss/all.scss | 23 +++ .../static/scss/funding/funding.scss | 174 ++++++++++++++++ .../static/{css => scss}/main/auth.scss | 12 +- .../static/{css => scss}/main/base.scss | 29 ++- .../static/{css => scss}/main/book_box.scss | 195 +++++++++--------- .../static/{css => scss}/main/book_list.scss | 42 ++-- .../static/{css => scss}/main/catalogue.scss | 10 +- .../static/{css => scss}/main/cite.scss | 19 +- .../static/{css => scss}/main/dialogs.scss | 20 +- .../static/scss/main/footer.scss | 26 +++ .../static/{css => scss}/main/form.scss | 0 .../static/scss/main/fragment.scss | 14 ++ .../static/{css => scss}/main/header.scss | 74 ++++--- .../static/{css => scss}/main/hidden.scss | 20 +- .../{css => scss}/main/main_content.scss | 4 +- .../static/{css => scss}/main/main_page.scss | 128 +++++------- .../static/{css => scss}/main/menu.scss | 72 +++---- .../static/{css => scss}/main/search.scss | 40 ++-- .../static/{css => scss}/main/tag.scss | 34 ++- .../static/scss}/polls/polls.scss | 0 apps/wolnelektury_core/static/scss/tools.scss | 70 +++++++ wolnelektury/settings/static.py | 7 +- 30 files changed, 624 insertions(+), 634 deletions(-) delete mode 100755 apps/funding/static/funding/funding.css delete mode 100755 apps/funding/static/funding/funding.scss delete mode 100644 apps/polls/static/polls/polls.css delete mode 100755 apps/wolnelektury_core/static/css/main/_tools.scss delete mode 100755 apps/wolnelektury_core/static/css/main/footer.scss delete mode 100755 apps/wolnelektury_core/static/css/main/fragment.scss create mode 100644 apps/wolnelektury_core/static/scss/all.scss create mode 100644 apps/wolnelektury_core/static/scss/funding/funding.scss rename apps/wolnelektury_core/static/{css => scss}/main/auth.scss (75%) rename apps/wolnelektury_core/static/{css => scss}/main/base.scss (65%) rename apps/wolnelektury_core/static/{css => scss}/main/book_box.scss (58%) rename apps/wolnelektury_core/static/{css => scss}/main/book_list.scss (58%) rename apps/wolnelektury_core/static/{css => scss}/main/catalogue.scss (68%) rename apps/wolnelektury_core/static/{css => scss}/main/cite.scss (52%) rename apps/wolnelektury_core/static/{css => scss}/main/dialogs.scss (84%) create mode 100755 apps/wolnelektury_core/static/scss/main/footer.scss rename apps/wolnelektury_core/static/{css => scss}/main/form.scss (100%) create mode 100755 apps/wolnelektury_core/static/scss/main/fragment.scss rename apps/wolnelektury_core/static/{css => scss}/main/header.scss (69%) rename apps/wolnelektury_core/static/{css => scss}/main/hidden.scss (63%) rename apps/wolnelektury_core/static/{css => scss}/main/main_content.scss (67%) rename apps/wolnelektury_core/static/{css => scss}/main/main_page.scss (55%) rename apps/wolnelektury_core/static/{css => scss}/main/menu.scss (62%) rename apps/wolnelektury_core/static/{css => scss}/main/search.scss (50%) rename apps/wolnelektury_core/static/{css => scss}/main/tag.scss (65%) rename apps/{polls/static => wolnelektury_core/static/scss}/polls/polls.scss (100%) create mode 100644 apps/wolnelektury_core/static/scss/tools.scss diff --git a/.gitignore b/.gitignore index 3224d626b..60e1b516b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ dev.sqlite /static # SCSS output -/apps/wolnelektury_core/static/css/main/*.css +scss/*.css # Python garbage *.pyc diff --git a/apps/funding/static/funding/funding.css b/apps/funding/static/funding/funding.css deleted file mode 100755 index 89dd7aa79..000000000 --- a/apps/funding/static/funding/funding.css +++ /dev/null @@ -1 +0,0 @@ -.funding,.funding-top-header{background:orange;margin:auto;padding:5px 0;position:relative}.funding a.call,.funding-top-header a.call{height:1.2em;width:9em;padding:.35em .5em;margin:.5em;display:inline-block;vertical-align:top;text-align:center;background:rgb(.465%, 59.936%, 63.653%)}.funding .description,.funding-top-header .description{display:inline-block;padding-left:.6em}.funding .description a,.funding-top-header .description a{display:block;color:#000;padding:0 3px}.funding strong,.funding-top-header strong{font-size:1.5em;padding:.2em 0 0}.funding .progress,.funding-top-header .progress{width:95.7em;margin:.3em 0 .4em;border-radius:2em;background-image:url(/static/img/progress-pixel.png);background-repeat:repeat-y;background-color:#f68900;box-shadow:.1em .1em .1em #888}.funding .progress .piece,.funding-top-header .progress .piece{font-size:1.3em;padding:.3em .5em}.funding .with-button .progress,.funding-top-header .with-button .progress{width:78em}.funding .funding .funding-title-strong,.funding .funding-title,.funding-top-header .funding-title,.funding-top-header .funding-top-header .funding-title-strong{font-size:1.1em}.funding .funding-title-strong,.funding-top-header .funding-title-strong{font-weight:bold;font-size:1.5em}.funding .close,.funding-top-header .close{position:absolute;top:0;right:5px}.funding-top-header{width:97.5em}.wlfund{width:100%;border-spacing:0}.wlfund td{padding:1em .5em 1em;text-align:center;border-top:1em solid rgba(255, 255, 255, 0);border-bottom:2px solid #DDD;background-clip:padding-box;-moz-background-clip:padding;-webkit-background-clip:padding}.wlfund td.oneline{white-space:nowrap}.wlfund td:last-child{text-align:right}.wlfund .funding-plus td{background-color:#cfe5e7}.wlfund .funding-minus td{background-color:#fff}.honking{background:#018189;font-size:1.5em;padding:.5em;color:#fff;border:0;box-shadow:.2em .2em .3em #888;position:relative}.honking:hover{box-shadow:none;top:.1em;left:.1em}.share a{margin-right:1.5em}.share a img{vertical-align:middle}.funding-handle{position:absolute;top:0;right:0;z-index:2;background:orange;cursor:pointer;padding:.2em 1em;border-radius:0 0 0 1em;font-size:13px}.funding-cover{float:left;margin-right:10px}.funding-details-intro{padding-top:1em}.funding-details-intro h3:first-of-type{margin-top:0} \ No newline at end of file diff --git a/apps/funding/static/funding/funding.scss b/apps/funding/static/funding/funding.scss deleted file mode 100755 index 13c6ce062..000000000 --- a/apps/funding/static/funding/funding.scss +++ /dev/null @@ -1,152 +0,0 @@ -.funding { - background: orange; - margin: auto; - padding: 5px 0; - position: relative; - a.call { - height: 1.2em; - width: 9em; - padding: .35em .5em; - margin: .5em; - display: inline-block; - vertical-align: top; - text-align: center; - - background: lighten(#018189, .05); - } - .description { - display: inline-block; - padding-left: .6em; - a { - display: block; - color: black; - padding: 0 3px; - } - } - strong { - font-size: 1.5em; - padding: .2em 0 0; - //display: block; - } - .progress { - .piece { - font-size: 1.3em; - padding: .3em .5em; - } - width: 95.7em; - margin: .3em 0 .4em; - border-radius: 2em; - background-image: url(/static/img/progress-pixel.png); - background-repeat: repeat-y; - background-color: mix(#ec6d00, orange, .5); - box-shadow: .1em .1em .1em #888; - } - .with-button .progress { - width: 78em; - } - - .funding-title { - font-size: 1.1em; - } - .funding-title-strong { - @extend .funding-title; - font-weight: bold; - font-size: 1.5em; - } - .close { - position: absolute; - top: 0px; - right: 5px; - } -} - -.funding-top-header { - @extend .funding; - width: 97.5em; -} - - -.wlfund { - width: 100%; - border-spacing:0; - - td { - padding: 1em .5em 1em; - text-align: center; - border-top: 1em solid rgba(255, 255, 255, 0); - border-bottom: 2px solid #DDDDDD; - - background-clip: padding-box; - -moz-background-clip: padding; - -webkit-background-clip: padding; - } - td.oneline { - white-space: nowrap; - } - - td:last-child { - text-align: right; - } - - .funding-plus td { - background-color: mix(#0D7E85, white, .2); - } - - .funding-minus td { - background-color: white; - } -} - - - -.honking { - background: #018189; - font-size: 1.5em; - padding: .5em; - color: white; - border: 0; - box-shadow: 0.2em 0.2em 0.3em #888888; - position: relative; -} -.honking:hover { - box-shadow: none; - top: .1em; - left: .1em; -} - - - -.share { - a { - margin-right: 1.5em; - - img { - vertical-align: middle; - } - } -} - -.funding-handle { - position: absolute; - top: 0; - right: 0; - z-index:2; - background: orange; - cursor:pointer; - padding: .2em 1em; - border-radius: 0 0 0 1em; - font-size: 13px; -} - -.funding-cover { - float:left; - margin-right: 10px; -} - -.funding-details-intro { - padding-top: 1em; - - h3:first-of-type { - margin-top: 0; - } -} diff --git a/apps/funding/templates/funding/tags/funding.html b/apps/funding/templates/funding/tags/funding.html index ffe326e9c..a26c6ca61 100755 --- a/apps/funding/templates/funding/tags/funding.html +++ b/apps/funding/templates/funding/tags/funding.html @@ -5,16 +5,15 @@
{% if closeable %}X{% endif %} {% if link and is_current %} -
+
{% trans "Support!" %} -
+
{% endif %} - diff --git a/apps/polls/static/polls/polls.css b/apps/polls/static/polls/polls.css deleted file mode 100644 index 0dd10fadf..000000000 --- a/apps/polls/static/polls/polls.css +++ /dev/null @@ -1 +0,0 @@ -.poll{width:400px}.poll ul{list-style-type:none}.poll-bar{border:solid 1px #ddd;height:6px;margin-bottom:10px}.poll-bar-inner{background:orange;height:6px}.poll-msg{font-weight:bold} \ No newline at end of file diff --git a/apps/wolnelektury_core/static/css/main/_tools.scss b/apps/wolnelektury_core/static/css/main/_tools.scss deleted file mode 100755 index b3441eff7..000000000 --- a/apps/wolnelektury_core/static/css/main/_tools.scss +++ /dev/null @@ -1,29 +0,0 @@ -@mixin size-px($name, $size) { - #{$name}: $size + px; - #{$name}: ($size / 16) + rem; -} - -@mixin mono { - font-family: "Andale Mono", "Lucida Sans Typewriter", "Courier New"; -} - -@mixin hidden-label { - display: block; - width: 1px; - height: 1px; - overflow:hidden; -} - -@mixin white-box { - border-color: #ddd; - border-style: solid; - @include size-px(border-width, 1); - background: #fff; - - -moz-box-shadow: 2px 2px 2px #ddd; - -webkit-box-shadow: 2px 2px 2px #ddd; - box-shadow: 2px 2px 2px #ddd; - -moz-box-shadow: .125rem .125rem .125rem #ddd; - -webkit-box-shadow: .125rem .125rem .125rem #ddd; - box-shadow: .125rem .125rem .125rem #ddd; -} diff --git a/apps/wolnelektury_core/static/css/main/footer.scss b/apps/wolnelektury_core/static/css/main/footer.scss deleted file mode 100755 index cc37b13da..000000000 --- a/apps/wolnelektury_core/static/css/main/footer.scss +++ /dev/null @@ -1,30 +0,0 @@ -@import "tools"; - -#footer-wrapper { - @include size-px(margin-top, 50); - @include size-px(padding-top, 30); - background: #fff; - color: #767676; - border-top-style: solid; - border-top-color: #ddd; - @include size-px(border-top-width, 1); -} - -footer#main { - @include size-px(font-size, 10); - @include size-px(margin-left, 5); - @include size-px(margin-right, 5); - - @media screen and (min-width: 62.5em) { - @include size-px(width, 975); - margin: auto; - } - - p { - @include size-px(margin-top, 2.5); - @include size-px(margin-bottom, 2.5); - margin-left: 0; - margin-right: 0; - } -} - diff --git a/apps/wolnelektury_core/static/css/main/fragment.scss b/apps/wolnelektury_core/static/css/main/fragment.scss deleted file mode 100755 index f82d50a4e..000000000 --- a/apps/wolnelektury_core/static/css/main/fragment.scss +++ /dev/null @@ -1,19 +0,0 @@ -@import "tools"; - -.Fragment-item { - @include size-px(margin-bottom, 20); - @include white-box; - - .fragment { - color: black; - display: block; - } - .toggle { - @include size-px(font-size, 11); - display: block; - @include size-px(padding-top, 5); - @include size-px(padding-bottom, 5); - @include size-px(padding-left, 0); - @include size-px(padding-right, 0); - } -} diff --git a/apps/wolnelektury_core/static/scss/all.scss b/apps/wolnelektury_core/static/scss/all.scss new file mode 100644 index 000000000..8d6e0d326 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/all.scss @@ -0,0 +1,23 @@ +@import "tools"; + +@import "main/auth"; +@import "main/base"; +@import "main/book_box"; +@import "main/book_list"; +@import "main/catalogue"; +@import "main/cite"; +@import "main/dialogs"; +@import "main/footer"; +@import "main/form"; +@import "main/fragment"; +@import "main/header"; +@import "main/hidden"; +@import "main/main_content"; +@import "main/main_page"; +@import "main/menu"; +@import "main/search"; +@import "main/tag"; + +@import "funding/funding"; + +@import "polls/polls"; diff --git a/apps/wolnelektury_core/static/scss/funding/funding.scss b/apps/wolnelektury_core/static/scss/funding/funding.scss new file mode 100644 index 000000000..61a48d681 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/funding/funding.scss @@ -0,0 +1,174 @@ +.funding { + background: orange; + margin: auto; + @include size(padding, 5px 0); + position: relative; + .close { + @include size(font-size, 10px); + } + .call-area { + float:left; + @include size(padding-right, 6px); + } + a.call { + @include size(height, 18px); + + @include size(padding, 5.25px 7.5px); + @include size(margin, 7.5px); + display: inline-block; + vertical-align: top; + text-align: center; + + background: lighten(#018189, .05); + @include size(width, 135px); + } + .learn-more { + text-align: center; + margin: auto; + @include size(font-size, 10px); + padding: .5em; + @include min-screen(420px) { + padding: 0; + } + } + .description { + @include size(padding-left, 6px); + + a { + display: block; + color: black; + @include size(padding, 0 3px); + } + } + strong { + @include size(font-size, 15px); + @include size(padding, 3px 0 0); + } + .progress { + .piece { + @include size(font-size, 13px); + @include size(padding, 4px 6px); + } + @include size(margin, 3px 12px 4px 0); + @include size(border-radius, 20px); + background-image: url(/static/img/progress-pixel.png); + background-repeat: repeat-y; + background-color: mix(#ec6d00, orange, .5); + @include box-shadow(1px 1px 1px #888); + } + .with-button { + clear: left; + @include min-screen(420px) { + clear: none; + @include size(margin-left, 171px); + } + } + + .funding-title { + @include size(font-size, 11px); + } + .funding-title-strong { + @extend .funding-title; + font-weight: bold; + @include size(font-size, 15px); + } + .close { + position: absolute; + top: 0px; + @include size(right, 5px); + } +} + +.funding-top-header { + @extend .funding; + + @include min-screen(1000px) { + @include size(width, 975px); + } +} + + +.wlfund { + width: 100%; + border-spacing:0; + + td { + @include size(padding, 10px 5px 10px); + text-align: center; + @include size(border-top, 10px solid rgba(255, 255, 255, 0)); + @include size(border-bottom, 2px solid #DDDDDD); + + background-clip: padding-box; + -moz-background-clip: padding; + -webkit-background-clip: padding; + } + td.oneline { + white-space: nowrap; + } + + td:last-child { + text-align: right; + } + + .funding-plus td { + background-color: mix(#0D7E85, white, .2); + } + + .funding-minus td { + background-color: white; + } +} + + + +.honking { + background: #018189; + @include size(font-size, 15px); + @include size(padding, 7.5px); + color: white; + border: 0; + @include box-shadow(3px 3px 4.5px #888888); + position: relative; +} +.honking:hover { + @include box-shadow(none); + @include size(top, 1px); + @include size(left, 1px); +} + + + +.share { + a { + @include size(margin-right, 15px); + + img { + vertical-align: middle; + } + } +} + +.funding-handle { + position: absolute; + top: 0; + right: 0; + z-index: 2; + background: orange; + cursor: pointer; + @include size(padding, 2.6px 13px); + @include size(border-radius, 0 0 0 10px); + @include size(font-size, 13px); +} + +.funding-cover { + float: left; + @include size(margin-right, 10px); +} + +.funding-details-intro { + @include size(padding-top, 10px); + + h3:first-of-type { + margin-top: 0; + } +} diff --git a/apps/wolnelektury_core/static/css/main/auth.scss b/apps/wolnelektury_core/static/scss/main/auth.scss similarity index 75% rename from apps/wolnelektury_core/static/css/main/auth.scss rename to apps/wolnelektury_core/static/scss/main/auth.scss index 8a88e12bb..03cf6150a 100755 --- a/apps/wolnelektury_core/static/css/main/auth.scss +++ b/apps/wolnelektury_core/static/scss/main/auth.scss @@ -1,5 +1,3 @@ -@import "tools"; - .email_list { .verified { display: inline-block; @@ -24,8 +22,8 @@ background-repeat: no-repeat; color: transparent; - @include size-px(height, 40); - @include size-px(width, 40); + @include size(height, 40px); + @include size(width, 40px); vertical-align: middle; &.google { @@ -35,14 +33,12 @@ .socialaccount_providers { - margin: 0; - @include size-px(margin-top, 10); - @include size-px(margin-bottom, 10); + @include size(margin, 10px 0); padding: 0; li { display: inline; list-style: none; - @include size-px(margin-right, 10); + @include size(margin-right, 10px); } } diff --git a/apps/wolnelektury_core/static/css/main/base.scss b/apps/wolnelektury_core/static/scss/main/base.scss similarity index 65% rename from apps/wolnelektury_core/static/css/main/base.scss rename to apps/wolnelektury_core/static/scss/main/base.scss index 0926569fc..02f02a37e 100755 --- a/apps/wolnelektury_core/static/css/main/base.scss +++ b/apps/wolnelektury_core/static/scss/main/base.scss @@ -1,6 +1,3 @@ -@import "tools"; - - /* Basic layout */ html, body { margin: 0; @@ -20,7 +17,7 @@ body { background: #f7f7f7; color: black; - @include size-px(font-size, 13); + @include size(font-size, 13px); } a { @@ -33,9 +30,9 @@ a { } h1 { - @include size-px(font-size, 35); + @include size(font-size, 35px); font-weight: normal; - @include size-px(margin-top, 14); + @include size(margin-top, 14px); a { color: inherit; @@ -43,12 +40,12 @@ h1 { } h2 { - @include size-px(font-size, 20); + @include size(font-size, 20px); font-weight: normal; } h3 { - @include size-px(font-size, 15); + @include size(font-size, 15px); font-weight: normal; } @@ -58,7 +55,7 @@ h3 { } .white-box { - @include size-px(padding, 10); + @include size(padding, 10px); @include white-box; } @@ -72,10 +69,10 @@ ul.plain { .theme-list-link { @include mono; - @include size-px(font-size, 11); + @include size(font-size, 11px); &:after { - @include size-px(padding-left, 11); + @include size(padding-left, 11px); content: url("/static/img/arrow-teal.png"); vertical-align: middle; } @@ -83,22 +80,22 @@ ul.plain { .left-column, .right-column { - @include size-px(max-width, 600); + @include size(max-width, 600px); } @media screen and (min-width: 62.5em) { .left-column { - @include size-px(width, 470); + @include size(width, 470px); float: left; } .right-column { - @include size-px(width, 470); + @include size(width, 470px); float:right; } } .pagination { display: block; - @include size-px(font-size, 12); - @include size-px(padding, 6); + @include size(font-size, 12px); + @include size(padding, 6px); text-align:center; } diff --git a/apps/wolnelektury_core/static/css/main/book_box.scss b/apps/wolnelektury_core/static/scss/main/book_box.scss similarity index 58% rename from apps/wolnelektury_core/static/css/main/book_box.scss rename to apps/wolnelektury_core/static/scss/main/book_box.scss index 02de7a230..0ee26be0f 100755 --- a/apps/wolnelektury_core/static/css/main/book_box.scss +++ b/apps/wolnelektury_core/static/scss/main/book_box.scss @@ -1,28 +1,21 @@ -@import "tools"; - @mixin inner-box { display: block; color: black; - @include size-px(margin, 1); - @include size-px(padding-top, 8); - @include size-px(padding-bottom, 8); - @include size-px(padding-left, 10); - @include size-px(padding-right, 10); - + @include size(margin, 1px); + @include size(padding, 8px 10px); @include white-box; } .book-mini-box img.cover { - @include size-px(height, 193); - @include size-px(width, 139); + @include size(height, 193px); + @include size(width, 139px); } .cover-area { float: left; - @include size-px(margin-right, 15); - @include size-px(margin-bottom, 5); - + @include size(margin-right, 15px); + @include size(margin-bottom, 5px); @media screen and (min-width: 32em) { position: absolute; @@ -32,35 +25,35 @@ } img.cover { - @include size-px(height, 193 / 2); - @include size-px(width, 139 / 2); + @include size(height, 193px / 2); + @include size(width, 139px / 2); @media screen and (min-width: 20em) { - @include size-px(height, 193); - @include size-px(width, 139); + @include size(height, 193px); + @include size(width, 139px); } } } .book-mini-box { - @include size-px(width, 161.5); + @include size(width, 161.5px); display: inline-block; vertical-align: top; a { @include inner-box; - @include size-px(height, 271); - @include size-px(margin, 1); + @include size(height, 271px); + @include size(margin, 1px); overflow: hidden; } img.cover { - @include size-px(margin-bottom, 18); + @include size(margin-bottom, 18px); } .desc { margin-left: 0; } .author { - @include size-px(font-size, 11); + @include size(font-size, 11px); @include mono; color: #6d7877; display: block; @@ -69,7 +62,7 @@ white-space: nowrap; } .title { - @include size-px(font-size, 14); + @include size(font-size, 14px); color: #242424; } } @@ -95,13 +88,13 @@ vertical-align: top; @media screen and (min-width: 32em) { - @include size-px(width, 487.5); + @include size(width, 487.5px); } .book-box-inner { position: relative; @include inner-box; - @include size-px(min-height, 197.5); + @include size(min-height, 197.5px); } } @@ -111,78 +104,78 @@ vertical-align: top; @media screen and (min-width: 62.5em) { - @include size-px(width, 975); + @include size(width, 975px); } .book-box-inner { position: relative; - @include size-px(min-height, 244); + @include size(min-height, 244px); @include inner-box; - @include size-px(margin-left, 0); - @include size-px(margin-right, 0); + @include size(margin-left, 0); + @include size(margin-right, 0); .book-left-column { /* FIXME */ - @include size-px(max-width, 600); + @include size(max-width, 600px); @media screen and (min-width: 62.5em) { float: left; - @include size-px(width, 536); + @include size(width, 536px); } } .license-icon { display: block; - @include size-px(margin-top, 5); + @include size(margin-top, 5px); } @media screen and (min-width: 62.5em) { .book-box-head, .tags, .book-box-tools { - @include size-px(width, 382); + @include size(width, 382px); } } #theme-list-wrapper { - @include size-px(margin-left, 154); + @include size(margin-left, 154px); margin-bottom: 0; - @include size-px(width, 300); + @include size(width, 300px); p { - @include size-px(margin-top, 10); - @include size-px(margin-bottom, 10); + @include size(margin-top, 10px); + @include size(margin-bottom, 10px); } } .right-column { - @include size-px(margin-top, 16); + @include size(margin-top, 16px); @media screen and (min-width: 62.5em) { - @include size-px(width, 415); + @include size(width, 415px); // Eat the padding - @include size-px(margin-top, -8); - @include size-px(margin-right, -10); + @include size(margin-top, -8px); + @include size(margin-right, -10px); } .other-tools, .other-download { float: left; - @include size-px(width, 145); - @include size-px(margin-top, 50); - @include size-px(margin-bottom, 0); - @include size-px(margin-left, 5); - @include size-px(margin-right, 0); - @include size-px(font-size, 11); + @include size(width, 145px); + @include size(margin-top, 50px); + @include size(margin-bottom, 0); + @include size(margin-left, 5px); + @include size(margin-right, 0); + @include size(font-size, 11px); h2 { margin: 0; - @include size-px(font-size, 11); + @include size(font-size, 11px); @include mono; } } .other-download { - @include size-px(margin-left, 15); - @include size-px(width, 220); + @include size(margin-left, 15px); + @include size(width, 220px); } } } @@ -190,20 +183,20 @@ .book-box-body { - margin-bottom: 1em; + @include size(margin-bottom, 10px); @media screen and (min-width: 32em) { margin-bottom: 0; - @include size-px(height, 170); + @include size(height, 170px); } position: relative; .book-box-head { - @include size-px(padding-top, 14); - @include size-px(margin-bottom, 10); + @include size(padding-top, 14px); + @include size(margin-bottom, 10px); @media screen and (min-width: 32em) { - @include size-px(min-height, 70); - @include size-px(width, 310); + @include size(min-height, 70px); + @include size(width, 310px); float: right; } @@ -211,46 +204,46 @@ color: black; } .author { - @include size-px(font-size, 11); + @include size(font-size, 11px); @include mono; - line-height: 1.2em; - max-height: 2.4em; + @include size(line-height, 13.2px); + @include size(max-height, 26.4px); overflow: hidden; @media screen and (min-width: 32em) { - @include size-px(max-width, 264); + @include size(max-width, 264px); } } .title { - @include size-px(font-size, 24); + @include size(font-size, 24px); line-height: 1.2em; - @include size-px(margin-top, 7.2); - margin-bottom: .5em; + @include size(margin-top, 7.2px); + @include size(margin-bottom, 12px); @media screen and (min-width: 32em) { margin-bottom: 0; - height: 2.4em; + @include size(height, 57.6px); overflow: hidden; } } } .tags { - @include size-px(font-size, 11); + @include size(font-size, 11px); line-height: 1.2em; @media screen and (min-width: 32em) { - @include size-px(width, 310); + @include size(width, 310px); float: right; clear: right; - max-height: 4.8em; + @include size(max-height, 57.6px); overflow: hidden; } .category { display: block; - margin-top: .5em; - margin-bottom: .5em; + @include size(margin-top, 6px); + @include size(margin-bottom, 6px); @media screen and (min-width: 32em) { display: inline; @@ -261,8 +254,8 @@ } .book-box-tag { - @include size-px(margin-left, 4.4); - @include size-px(margin-right, 5.5); + @include size(margin-left, 4.4px); + @include size(margin-right, 5.5px); } } } @@ -272,7 +265,7 @@ .book-box-tools { - @include size-px(font-size, 11); + @include size(font-size, 11px); margin: 0; padding: 0; list-style: none; @@ -281,11 +274,11 @@ @media screen and (min-width: 20em) { clear: none; - @include size-px(margin-left, 139 + 15); + @include size(margin-left, 139px + 15px); } @media screen and (min-width: 32em) { - @include size-px(width, 310); + @include size(width, 310px); float: right; clear: right; } @@ -300,7 +293,7 @@ .book-box-read { @media screen and (min-width: 32em) { - @include size-px(width, 126.5); + @include size(width, 126.5px); } a { @@ -309,8 +302,8 @@ a:before { content: url("/static/img/read.png"); - @include size-px(font-size, 25); - @include size-px(margin-right, 3.71); + @include size(font-size, 25px); + @include size(margin-right, 3.71px); vertical-align: middle; font-weight: normal; } @@ -320,7 +313,7 @@ position: relative; @media screen and (min-width: 32em) { - @include size-px(width, 93.5); + @include size(width, 93.5px); } a { @@ -336,8 +329,8 @@ &:before { content: url("/static/img/download.png"); - @include size-px(font-size, 25); - @include size-px(margin-right, 3.71); + @include size(font-size, 25px); + @include size(margin-right, 3.71px); vertical-align: middle; font-weight: normal; } @@ -345,35 +338,35 @@ } .book-box-formats { - @include size-px(padding-left, 25); + @include size(padding-left, 25px); @media screen and (min-width: 32em) { display: none; position: absolute; - @include size-px(width, 180); - @include size-px(padding-top, 38); - @include size-px(padding-bottom, 9); - @include size-px(padding-left, 19); - @include size-px(padding-right, 19); + @include size(width, 180px); + @include size(padding-top, 38px); + @include size(padding-bottom, 9px); + @include size(padding-left, 19px); + @include size(padding-right, 19px); @include white-box; z-index: 100; - @include size-px(top, -16); - @include size-px(left, -19); + @include size(top, -16px); + @include size(left, -19px); } span { display: block; - @include size-px(margin-top, 16); + @include size(margin-top, 16px); @media screen and (min-width: 32em) { - @include size-px(margin-top, 0); + @include size(margin-top, 0); &:first-child { - @include size-px(margin-top, 16); + @include size(margin-top, 16px); } } } @@ -387,13 +380,13 @@ .book-box-audiobook { @media screen and (min-width: 32em) { - @include size-px(width, 77); + @include size(width, 77px); } a:before { content: url("/static/img/listen.png"); - @include size-px(font-size, 25); - @include size-px(margin-right, 3.71); + @include size(font-size, 25px); + @include size(margin-right, 3.71px); vertical-align: middle; font-weight: normal; } @@ -405,8 +398,8 @@ .star { - @include size-px(font-size, 22.5); - @include size-px(margin-right, 11.25); + @include size(font-size, 22.5px); + @include size(margin-right, 11.25px); position: absolute; right: 0; @@ -439,17 +432,17 @@ #book-detail .see-also { h1 { - @include size-px(height, 32); + @include size(height, 32px); margin: 0; - @include size-px(padding-top, 19); - @include size-px(padding-left, 10); + @include size(padding-top, 19px); + @include size(padding-left, 10px); - @include size-px(font-size, 11); + @include size(font-size, 11px); @include mono; font-weight: normal; @media screen and (min-width: 33em) { - @include size-px(padding-left, 19); + @include size(padding-left, 19px); } } } diff --git a/apps/wolnelektury_core/static/css/main/book_list.scss b/apps/wolnelektury_core/static/scss/main/book_list.scss similarity index 58% rename from apps/wolnelektury_core/static/css/main/book_list.scss rename to apps/wolnelektury_core/static/scss/main/book_list.scss index fc2c1343b..d4115dcbb 100755 --- a/apps/wolnelektury_core/static/css/main/book_list.scss +++ b/apps/wolnelektury_core/static/scss/main/book_list.scss @@ -1,19 +1,17 @@ /* listing of all books */ -@import "tools"; - #book-a-list { #book-list-nav { - @include size-px(border-width, 0); - @include size-px(border-bottom-width, 1); + @include size(border-width, 0); + @include size(border-bottom-width, 1px); border-style: solid; border-color: #CFCFCF; - @include size-px(padding, 9.75); + @include size(padding, 9.75px); line-height: 2em; @media screen and (min-width: 30em) { - @include size-px(border-bottom-width, 0); - @include size-px(border-left-width, 1); + @include size(border-bottom-width, 0px); + @include size(border-left-width, 1px); float: right; width: 50%; } @@ -26,7 +24,7 @@ cursor: pointer; &:after { - @include size-px(padding-left, 10); + @include size(padding-left, 10px); content: url("/static/img/arrow-gray.png"); vertical-align: top; } @@ -51,7 +49,7 @@ ul { list-style-type: none; - @include size-px(margin, 5); + @include size(margin, 5px); padding: 0; } .book-list-show-index { @@ -60,24 +58,21 @@ } #book-list { - @include size-px(padding-left, 5); + @include size(padding-left, 5px); line-height: 2em; @media screen and (min-width: 62.5em) { - @include size-px(padding-left, 50); + @include size(padding-left, 50px); line-height: 1.3em; } ol { - @include size-px(padding-left, 13); - @include size-px(margin-top, 4); - @include size-px(margin-bottom, 15.6); - @include size-px(margin-left, 0); - @include size-px(margin-right, 0); + @include size(padding-left, 13px); + @include size(margin, 4px 0 15.6px 0); list-style: none; } h2 { - @include size-px(font-size, 13); + @include size(font-size, 13px); margin: 0; a { color: black; @@ -88,15 +83,10 @@ #book-list-up { display: block; position: fixed; - @include size-px(bottom, 50); - @include size-px(right, 50); - @include size-px(border-left-width, 1); - border-left-style: solid; - border-left-color: #CFCFCF; - @include size-px(padding-top, 20); - @include size-px(padding-bottom, 20); - @include size-px(padding-left, 10); - @include size-px(padding-right, 10); + @include size(bottom, 50px); + @include size(right, 50px); + @include size(border-left, solid 1px #CFCFCF); + @include size(padding, 20px 10px); background-color: white; } } diff --git a/apps/wolnelektury_core/static/css/main/catalogue.scss b/apps/wolnelektury_core/static/scss/main/catalogue.scss similarity index 68% rename from apps/wolnelektury_core/static/css/main/catalogue.scss rename to apps/wolnelektury_core/static/scss/main/catalogue.scss index 4a08b4657..ba30e8271 100755 --- a/apps/wolnelektury_core/static/css/main/catalogue.scss +++ b/apps/wolnelektury_core/static/scss/main/catalogue.scss @@ -1,17 +1,15 @@ /* listing of all books */ -@import "tools"; - .catalogue-catalogue { ul { column-width: 25em; -moz-column-width: 25em; -webkit-column-width: 25em; - @include size-px(padding-left, 10); + @include size(padding-left, 10px); @media screen and (min-width: 20em) { - @include size-px(padding-left, 40); + @include size(padding-left, 40px); } li { @@ -24,8 +22,8 @@ } h2 { - @include size-px(font-size, 26); + @include size(font-size, 26px); margin: 0; - @include size-px(padding, 26); + @include size(padding, 26px); } } diff --git a/apps/wolnelektury_core/static/css/main/cite.scss b/apps/wolnelektury_core/static/scss/main/cite.scss similarity index 52% rename from apps/wolnelektury_core/static/css/main/cite.scss rename to apps/wolnelektury_core/static/scss/main/cite.scss index d15faaaa9..b95628888 100755 --- a/apps/wolnelektury_core/static/css/main/cite.scss +++ b/apps/wolnelektury_core/static/scss/main/cite.scss @@ -1,22 +1,17 @@ -@import "tools"; - .cite { display: block; color: black; background: white; - @include size-px(padding-top, 30); - @include size-px(padding-bottom, 1); - @include size-px(padding-left, 80); - @include size-px(padding-right, 20); + @include size(padding, 30px 20px 1px 80px); .vip { margin: 0; color: #575C63; - @include size-px(font-size, 11); + @include size(font-size, 11px); } .cite-body { - @include size-px(font-size, 18); + @include size(font-size, 18px); line-height: 1.3em; } @@ -33,8 +28,8 @@ { color: #444; @include mono; - @include size-px(font-size, 11); - @include size-px(margin-top, 16); + @include size(font-size, 11px); + @include size(margin-top, 16px); } } @@ -44,7 +39,7 @@ .book-wide-box .cite { background-color: #f7f7f7; vertical-align: middle; - @include size-px(width, 395); + @include size(width, 395px); margin: 0; - @include size-px(padding, 10); + @include size(padding, 10px); } diff --git a/apps/wolnelektury_core/static/css/main/dialogs.scss b/apps/wolnelektury_core/static/scss/main/dialogs.scss similarity index 84% rename from apps/wolnelektury_core/static/css/main/dialogs.scss rename to apps/wolnelektury_core/static/scss/main/dialogs.scss index a5316774a..2902862fc 100755 --- a/apps/wolnelektury_core/static/css/main/dialogs.scss +++ b/apps/wolnelektury_core/static/scss/main/dialogs.scss @@ -1,23 +1,21 @@ -@import "tools"; - .dialog-window { position: absolute; display: none; background-color: transparent; - @include size-px(margin-top, -5); - @include size-px(margin-left, 10); - @include size-px(width, 200); + @include size(margin-top, -5px); + @include size(margin-left, 10px); + @include size(width, 200px); @media screen and (max-width: 29.999999em) { left: 0 !important; right: 0; - @include size-px(margin-left, 0); + @include size(margin-left, 0); width: auto; } div.header { @include mono; - @include size-px(font-size, 11); + @include size(font-size, 11px); width: 4em; background-color: #FFF; padding: 1em; @@ -48,7 +46,7 @@ } h1 { - @include size-px(font-size, 12); + @include size(font-size, 12px); font-weight: normal; margin-top: .4em; } @@ -65,13 +63,13 @@ .cuteform { - @include size-px(font-size, 11); + @include size(font-size, 11px); ol, ul { padding: 0; margin: 0; list-style: none; - @include size-px(font-size, 11); + @include size(font-size, 11px); li { margin-top: 0.7em; @@ -110,7 +108,7 @@ @media screen and (min-width: 30em) { #login-window { - @include size-px(width, 260); + @include size(width, 260px); } #register-window { width: 26em; diff --git a/apps/wolnelektury_core/static/scss/main/footer.scss b/apps/wolnelektury_core/static/scss/main/footer.scss new file mode 100755 index 000000000..8969a5ad7 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/footer.scss @@ -0,0 +1,26 @@ +#footer-wrapper { + @include size(margin-top, 50px); + @include size(padding-top, 30px); + background: #fff; + color: #767676; + @include size(border-top, 1px solid #ddd); +} + +footer#main { + @include size(font-size, 10px); + @include size(margin-left, 5px); + @include size(margin-right, 5px); + + @media screen and (min-width: 62.5em) { + @include size(width, 975px); + margin: auto; + } + + p { + @include size(margin-top, 2.5px); + @include size(margin-bottom, 2.5px); + margin-left: 0; + margin-right: 0; + } +} + diff --git a/apps/wolnelektury_core/static/css/main/form.scss b/apps/wolnelektury_core/static/scss/main/form.scss similarity index 100% rename from apps/wolnelektury_core/static/css/main/form.scss rename to apps/wolnelektury_core/static/scss/main/form.scss diff --git a/apps/wolnelektury_core/static/scss/main/fragment.scss b/apps/wolnelektury_core/static/scss/main/fragment.scss new file mode 100755 index 000000000..1eaf61ce9 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/fragment.scss @@ -0,0 +1,14 @@ +.Fragment-item { + @include size(margin-bottom, 20px); + @include white-box; + + .fragment { + color: black; + display: block; + } + .toggle { + @include size(font-size, 11px); + display: block; + @include size(padding, 5px 0); + } +} diff --git a/apps/wolnelektury_core/static/css/main/header.scss b/apps/wolnelektury_core/static/scss/main/header.scss similarity index 69% rename from apps/wolnelektury_core/static/css/main/header.scss rename to apps/wolnelektury_core/static/scss/main/header.scss index 3bf6fcea3..4edd53e18 100755 --- a/apps/wolnelektury_core/static/css/main/header.scss +++ b/apps/wolnelektury_core/static/scss/main/header.scss @@ -1,5 +1,3 @@ -@import "tools"; - $header_bg: #191919; @@ -13,7 +11,7 @@ $header_bg: #191919; z-index: -1; position: absolute; top: 0; - @include size-px(bottom, 45); + @include size(bottom, 45px); left: 0; width: 100%; background-color: $header_bg; @@ -35,14 +33,14 @@ $header_bg: #191919; header#main { - @include size-px(line-height, 20); /* Make links easier to click when wrapped. */ + @include size(line-height, 20px); /* Make links easier to click when wrapped. */ background-color: $header_bg; color: #bbb; @media screen and (min-width: 62.5em) { position: relative; - @include size-px(height, 94); - @include size-px(width, 975); + @include size(height, 94px); + @include size(width, 975px); margin: auto; } @@ -52,8 +50,8 @@ header#main { #logo { display: block; - @include size-px(height, 94); - @include size-px(width, 94); + @include size(height, 94px); + @include size(width, 94px); @media screen and (min-width: 24em) { float: left; @@ -66,44 +64,44 @@ header#main { #tagline { margin-top: 0; - @include size-px(margin-left, 5); - @include size-px(margin-right, 5); + @include size(margin-left, 5px); + @include size(margin-right, 5px); padding-top: 0; - @include size-px(font-size, 11); + @include size(font-size, 11px); @media screen and (min-width: 24em) { - @include size-px(padding-top, 6); - @include size-px(font-size, 13); + @include size(padding-top, 6px); + @include size(font-size, 13px); text-align: right; } @media screen and (min-width: 62.5em) { position: absolute; - @include size-px(top, 10); - @include size-px(left, 255); - @include size-px(margin-left, 0); + @include size(top, 10px); + @include size(left, 255px); + @include size(margin-left, 0px); } } #user-info { margin-top: 0; - @include size-px(margin-left, 5); - @include size-px(margin-right, 5); + @include size(margin-left, 5px); + @include size(margin-right, 5px); padding-top: 0; @include mono; - @include size-px(font-size, 10); + @include size(font-size, 10px); position: relative; @media screen and (min-width: 24em) { - @include size-px(padding-top, 15); + @include size(padding-top, 15px); text-align: right; } @media screen and (min-width: 62.5em) { position: absolute; top: 0; right: 0; - @include size-px(margin-left, 0); - @include size-px(margin-right, 0); + @include size(margin-left, 0); + @include size(margin-right, 0); } /* We want submenu on far left on small screens. */ @@ -137,22 +135,22 @@ header#main { form#search-area { position: relative; clear: both; - @include size-px(height, 45); + @include size(height, 45px); background: #444444; color: white; @media screen and (min-width: 62.5em) { position: absolute; - @include size-px(top, 49); - @include size-px(left, 240); - @include size-px(right, 0); + @include size(top, 49px); + @include size(left, 240px); + @include size(right, 0); } #search-field { position: absolute; - @include size-px(top, 5); - @include size-px(left, 5); - @include size-px(right, 113); + @include size(top, 5px); + @include size(left, 5px); + @include size(right, 113px); label { @include hidden-label; @@ -160,18 +158,18 @@ header#main { input#search { z-index: 200; position: relative; - @include size-px(height, 33); + @include size(height, 33px); width: 100%; padding: 0; - @include size-px(padding-left, 13); - @include size-px(line-height, 32.5); + @include size(padding-left, 13px); + @include size(line-height, 32.5px); border: none; - @include size-px(border-radius, 5); - box-shadow: 0 0 0.5em #444444 inset; + @include size(border-radius, 5px); + @include box-shadow(0 0 6.5px #444444 inset); font-family: Georgia; - @include size-px(font-size, 13); + @include size(font-size, 13px); background-color: white; color: black; @@ -201,15 +199,15 @@ header#main { position: absolute; top: 0; right: 0; - @include size-px(height, 45); - @include size-px(width, 94); + @include size(height, 45px); + @include size(width, 94px); margin: 0; padding: 0; border: none; @include mono; - @include size-px(font-size, 11); + @include size(font-size, 11px); background: #018189; color: white; } diff --git a/apps/wolnelektury_core/static/css/main/hidden.scss b/apps/wolnelektury_core/static/scss/main/hidden.scss similarity index 63% rename from apps/wolnelektury_core/static/css/main/hidden.scss rename to apps/wolnelektury_core/static/scss/main/hidden.scss index a5596882d..718525be0 100755 --- a/apps/wolnelektury_core/static/css/main/hidden.scss +++ b/apps/wolnelektury_core/static/scss/main/hidden.scss @@ -1,5 +1,3 @@ -@import "tools"; - .hidden-box-wrapper { position: relative; @@ -7,7 +5,7 @@ position: absolute; left: 0; display: none; - padding: 1em 1em .5em 1em; + @include size(padding, 10px 10px 5px 10px); @include white-box; z-index: 500; @@ -16,22 +14,22 @@ list-style: none; padding: 0; margin: 0; - @include size-px(font-size, 11); + @include size(font-size, 11px); - @include size-px(column-width, 132); - @include size-px(-moz-column-width, 132); - @include size-px(-webkit-column-width, 132); + @include size(column-width, 132px); + @include size(-moz-column-width, 132px); + @include size(-webkit-column-width, 132px); @media screen and (min-width: 24em) { - @include size-px(width, 320); + @include size(width, 320px); } @media screen and (min-width: 34em) { - @include size-px(width, 480); + @include size(width, 480px); } @media screen and (min-width: 62.5em) { - @include size-px(width, 528); + @include size(width, 528px); } @@ -49,7 +47,7 @@ @media screen and (min-width: 24em) { #menu-collections ul { - @include size-px(width, 180); + @include size(width, 180px); } } diff --git a/apps/wolnelektury_core/static/css/main/main_content.scss b/apps/wolnelektury_core/static/scss/main/main_content.scss similarity index 67% rename from apps/wolnelektury_core/static/css/main/main_content.scss rename to apps/wolnelektury_core/static/scss/main/main_content.scss index 7d1aad43b..87e140232 100755 --- a/apps/wolnelektury_core/static/css/main/main_content.scss +++ b/apps/wolnelektury_core/static/scss/main/main_content.scss @@ -1,10 +1,8 @@ -@import "tools"; - #main-content { position: relative; @media screen and (min-width: 62.5em) { - @include size-px(width, 975); + @include size(width, 975px); margin: auto; } } diff --git a/apps/wolnelektury_core/static/css/main/main_page.scss b/apps/wolnelektury_core/static/scss/main/main_page.scss similarity index 55% rename from apps/wolnelektury_core/static/css/main/main_page.scss rename to apps/wolnelektury_core/static/scss/main/main_page.scss index 6f45bf67a..ddce4fc21 100755 --- a/apps/wolnelektury_core/static/css/main/main_page.scss +++ b/apps/wolnelektury_core/static/scss/main/main_page.scss @@ -1,5 +1,3 @@ -@import "tools"; - #big-cite { background-color: #444; color: white; @@ -16,66 +14,63 @@ } .cite { - @include size-px(padding-top, 46); - @include size-px(padding-bottom, 48); - @include size-px(padding-left, 0); - @include size-px(padding-right, 10); + @include size(padding, 46px 10px 48px 0); background: none; color: white; @media screen and (min-width: 30em) { - @include size-px(padding-right, 40); + @include size(padding-right, 40px); } .vip { - @include size-px(margin-left, 10); - @include size-px(margin-top, 2.5); - @include size-px(margin-bottom, 5); - @include size-px(font-size, 11); + @include size(margin-left, 10px); + @include size(margin-top, 2.5px); + @include size(margin-bottom, 5px); + @include size(font-size, 11px); @media screen and (min-width: 16em) { padding-left: 10%; - @include size-px(margin-left, -18); + @include size(margin-left, -18px); } @media screen and (min-width: 62.5em) { float: left; padding-left: 0; - @include size-px(margin-left, 16); + @include size(margin-left, 16px); text-align: right; - @include size-px(width, 147); + @include size(width, 147px); } } .cite-body { - @include size-px(margin, .5); - @include size-px(font-size, 20); + @include size(margin, .5px); + @include size(font-size, 20px); line-height: 1.16em; @media screen and (min-width: 30em) { - @include size-px(font-size, 30); + @include size(font-size, 30px); } } .source { - @include size-px(margin-top, 16); - @include size-px(margin-bottom, 16); - @include size-px(margin-right, 2); - @include size-px(font-size, 12); + @include size(margin-top, 16px); + @include size(margin-bottom, 16px); + @include size(margin-right, 2px); + @include size(font-size, 12px); } /* Make cite body and source slide to the left. */ .cite-body, .source { - @include size-px(margin-left, 10); + @include size(margin-left, 10px); @media screen and (min-width: 16em) { padding-left: 21.9%; - @include size-px(margin-left, -38); + @include size(margin-left, -38px); } @media screen and (min-width: 62.5em) { padding-left: 0; - @include size-px(margin-left, 175); + @include size(margin-left, 175px); } } @@ -95,65 +90,57 @@ /* a long cite displays smaller */ .cite-small .cite-body { - @include size-px(font-size, 16); + @include size(font-size, 16px); @media screen and (min-width: 30em) { - @include size-px(font-size, 20); + @include size(font-size, 20px); } } h2 { margin: 0; - @include size-px(font-size, 11); + @include size(font-size, 11px); color: #575c63; } } #promo-box { - @include size-px(margin-top, 16); + @include size(margin-top, 16px); @media screen and (min-width: 33em) { float: right; - @include size-px(margin-top, -51); - @include size-px(width, 320); + @include size(margin-top, -51px); + @include size(width, 320px); } h1 { - @include size-px(padding-top, 20); - @include size-px(height, 31); + @include size(padding, 20px 5px 0 10px); + @include size(height, 31px); margin: 0; - padding-bottom: 0; - @include size-px(padding-left, 10); - @include size-px(padding-right, 5); background: #191919; color: white; @include mono; - @include size-px(font-size, 13); + @include size(font-size, 13px); font-weight: normal; @media screen and (min-width: 33em) { - @include size-px(padding-left, 25); - @include size-px(padding-right, 25); + @include size(padding-left, 25px); + @include size(padding-right, 25px); } } #promo-box-body { - @include size-px(padding-top, 20); - @include size-px(padding-bottom, 20); - @include size-px(padding-left, 5); - @include size-px(padding-right, 5); - border-bottom-style: solid; - border-bottom-color: #efefef; - @include size-px(border-bottom-width, 2); + @include size(padding, 20px 5px); + @include size(border-bottom, 2px solid #efefef); background: #efefef; @media screen and (min-width: 33em) { - @include size-px(padding-left, 28); - @include size-px(padding-right, 28); + @include size(padding-left, 28px); + @include size(padding-right, 28px); } @media screen and (min-width: 62.5em) { - @include size-px(height, 300); + @include size(height, 300px); } a { @@ -162,14 +149,14 @@ } p { margin-top: 0; - @include size-px(font-size, 12); + @include size(font-size, 12px); line-height: 1.55em; color: #6c6c6c; } h2, h3 { color: #0d777e; - @include size-px(font-size, 11); - @include size-px(height, 27.5); + @include size(font-size, 11px); + @include size(height, 27.5px); margin: 0; @include mono; font-weight: normal; @@ -184,17 +171,17 @@ #main-last { h1 { - @include size-px(height, 32); + @include size(height, 32px); margin: 0; - @include size-px(padding-top, 19); - @include size-px(padding-left, 10); + @include size(padding-top, 19px); + @include size(padding-left, 10px); - @include size-px(font-size, 11); + @include size(font-size, 11px); @include mono; font-weight: normal; @media screen and (min-width: 33em) { - @include size-px(padding-left, 19); + @include size(padding-left, 19px); } a { @@ -218,26 +205,23 @@ .infopages-box { margin: 0; - @include size-px(margin-top, 5); - padding-top: 0; - padding-bottom: 0; - @include size-px(padding-left, 5); - @include size-px(padding-right, 5); + @include size(margin-top, 5px); + @include size(padding, 0 5px); vertical-align: top; color: #989898; @media screen and (min-width: 20em) { display: inline-block; - @include size-px(width, 206); - @include size-px(padding-left, 17); - @include size-px(padding-right, 17); + @include size(width, 206px); + @include size(padding-left, 17px); + @include size(padding-right, 17px); } h1 { - @include size-px(height, 28); + @include size(height, 28px); margin: 0; - @include size-px(padding-top, 25); - @include size-px(font-size, 11); + @include size(padding-top, 25px); + @include size(font-size, 11px); color: #017e85; font-weight: normal; @include mono; @@ -248,25 +232,25 @@ } ol, ul { - @include size-px(font-size, 11); + @include size(font-size, 11px); list-style: none; padding: 0; margin: 0; line-height: 1.45em; li { - @include size-px(margin-bottom, 8); + @include size(margin-bottom, 8px); @media screen and (min-width: 62.5em) { - @include size-px(margin-bottom, 2.5); + @include size(margin-bottom, 2.5px); } } } .social-links { - @include size-px(margin-top, 10); + @include size(margin-top, 10px); a { - @include size-px(margin-right, 6); + @include size(margin-right, 6px); } } } diff --git a/apps/wolnelektury_core/static/css/main/menu.scss b/apps/wolnelektury_core/static/scss/main/menu.scss similarity index 62% rename from apps/wolnelektury_core/static/css/main/menu.scss rename to apps/wolnelektury_core/static/scss/main/menu.scss index 496b805e9..38a7d20bc 100755 --- a/apps/wolnelektury_core/static/css/main/menu.scss +++ b/apps/wolnelektury_core/static/scss/main/menu.scss @@ -1,31 +1,26 @@ -@import "tools"; - #nav-line { background-color: #e2e2e2; position: relative; @media screen and (min-width: 62.5em) { - @include size-px(width, 975); + @include size(width, 975px); margin: auto; } #show-menu { display: block; float: left; - @include size-px(line-height, 13); - @include size-px(padding-top, 18); - @include size-px(padding-bottom, 18); - @include size-px(padding-left, 13); - @include size-px(padding-right, 13); + @include size(line-height, 13px); + @include size(padding, 18px 13px); color: #0c7076; - @include size-px(font-size, 11); + @include size(font-size, 11px); @include mono; .long { display: none; &:after { - @include size-px(padding-left, 10); + @include size(padding-left, 10px); content: url("/static/img/arrow-gray.png"); vertical-align: top; } @@ -48,9 +43,9 @@ display: none; position: absolute; - top: 49px; + @include size(top, 49px); left: 0; - right: 10px; + @include size(right, 10px); z-index: 400; @media screen and (min-width: 24em) { @@ -60,7 +55,7 @@ @media screen and (min-width: 53em) { display: block !important; position: static; - @include size-px(margin-left, 6); + @include size(margin-left, 6px); } li.menu { @@ -72,18 +67,11 @@ a.menu { display: block; - @include size-px(line-height, 13); - @include size-px(padding-top, 18); - @include size-px(padding-bottom, 15); - - @include size-px(border-bottom-width, 3); - border-bottom-style: solid; - border-bottom-color: #e2e2e2; - - @include size-px(padding-left, 13); - @include size-px(padding-right, 13); + @include size(line-height, 13px); + @include size(padding, 18px 13px 15px); + @include size(border-bottom, 3px solid #e2e2e2); color: #0c7076; - @include size-px(font-size, 11); + @include size(font-size, 11px); @include mono; } @@ -97,8 +85,8 @@ display: block; float: right; - @include size-px(padding-left, 25); - @include size-px(padding-right, 20); + @include size(padding-left, 25px); + @include size(padding-right, 20px); background: #f7f7f7; @include mono; @@ -108,11 +96,11 @@ #lang-button { display:block; - @include size-px(line-height, 17); - @include size-px(padding-top, 16); - @include size-px(padding-bottom, 16); + @include size(line-height, 17px); + @include size(padding-top, 16px); + @include size(padding-bottom, 16px); - @include size-px(font-size, 10); + @include size(font-size, 10px); color: #717171; .label { @@ -123,15 +111,15 @@ } &:after { - @include size-px(padding-left, 10); + @include size(padding-left, 10px); content: url("/static/img/arrow-gray.png"); vertical-align: top; } } .lang-flag { - @include size-px(font-size, 13); - @include size-px(line-height, 15); + @include size(font-size, 13px); + @include size(line-height, 15px); } } @@ -146,22 +134,16 @@ cursor: pointer; width: 100%; margin: 0; - padding: 0; - - @include size-px(padding-top, 10); - @include size-px(padding-bottom, 10); + @include size(padding, 10px 0); @media screen and (min-width: 62.5em) { - @include size-px(padding-top, 5); - @include size-px(padding-bottom, 5); + @include size(padding, 5px 0); } - border-style: solid; - border-color: #ddd; border-width: 0; - @include size-px(border-bottom-width, 1); + @include size(border-bottom, 1px solid #ddd); - @include size-px(font-size, 13); + @include size(font-size, 13px); &.active { color: #000; @@ -178,8 +160,8 @@ @media screen and (min-width: 15em) { left: auto; - @include size-px(width, 180); - @include size-px(top, 49); + @include size(width, 180px); + @include size(top, 49px); } @media screen and (min-width: 62.5em) { width: 100%; diff --git a/apps/wolnelektury_core/static/css/main/search.scss b/apps/wolnelektury_core/static/scss/main/search.scss similarity index 50% rename from apps/wolnelektury_core/static/css/main/search.scss rename to apps/wolnelektury_core/static/scss/main/search.scss index 2b96361b0..2dac56ab0 100755 --- a/apps/wolnelektury_core/static/css/main/search.scss +++ b/apps/wolnelektury_core/static/scss/main/search.scss @@ -1,5 +1,3 @@ -@import "tools"; - /* jquery UI overrides us */ .ui-menu .ui-menu-item a { color: #0d7e85 !important; @@ -8,8 +6,7 @@ .ui-widget { font-family: Georgia !important; - font-size: 10px !important; - font-size: .625rem !important; + @include size(font-size, 10px !important); } .ui-widget-content { @@ -25,48 +22,45 @@ /* just on search page */ .top-tag-list { - @include size-px(margin-top, 22); - @include size-px(margin-bottom, 16); + @include size(margin-top, 22px); + @include size(margin-bottom, 16px); } .search-result { - @include size-px(width, 975); + @include size(width, 975px); .book-box-body { - @include size-px(width, 310); + @include size(width, 310px); } } .book-list-header { - @include size-px(width, 975); + @include size(width, 975px); padding: 0em; - @include size-px(margin-left, -1); + @include size(margin-left, -1px); .book-box-inner { min-height: 1em; } p { - @include size-px(font-size, 24); - @include size-px(margin, 5); + @include size(font-size, 24px); + @include size(margin, 5px); } } .snippets { - @include size-px(width, 440); + @include size(width, 440px); float: right; - @include size-px(margin-top, -200); + @include size(margin-top, -200px); .snippet-text { - @include size-px(font-size, 12); - @include size-px(margin-top, 13); - @include size-px(margin-bottom, 13); - @include size-px(margin-left, 0); - @include size-px(margin-right, 0); - @include size-px(padding, 12); + @include size(font-size, 12px); + @include size(margin, 13px 0); + @include size(padding, 12px); background: #f7f7f7; } @@ -78,13 +72,13 @@ .search-hint-label { display: inline-block; - @include size-px(font-size, 11); - @include size-px(width, 275); + @include size(font-size, 11px); + @include size(width, 275px); line-height: 1.636em; } .search-hint-category { - @include size-px(font-size, 11); + @include size(font-size, 11px); line-height: 1.636em; } diff --git a/apps/wolnelektury_core/static/css/main/tag.scss b/apps/wolnelektury_core/static/scss/main/tag.scss similarity index 65% rename from apps/wolnelektury_core/static/css/main/tag.scss rename to apps/wolnelektury_core/static/scss/main/tag.scss index a06e0b59f..844d3dac9 100755 --- a/apps/wolnelektury_core/static/css/main/tag.scss +++ b/apps/wolnelektury_core/static/scss/main/tag.scss @@ -1,29 +1,27 @@ -@import "tools"; - .page-desc { - @include size-px(margin-left, 15); + @include size(margin-left, 15px); } #tagged-object-list { @media screen and (min-width: 62.5em) { .left-column, .right-column { - @include size-px(width, 480); + @include size(width, 480px); } } .see-also, .download { float: left; - @include size-px(margin-top, 20); - @include size-px(margin-bottom, 20); + @include size(margin-top, 20px); + @include size(margin-bottom, 20px); h2 { @include mono; - @include size-px(font-size, 11); + @include size(font-size, 11px); margin: 0; } ul { - @include size-px(font-size, 11); + @include size(font-size, 11px); list-style: none; padding: 0; margin: 0; @@ -31,11 +29,11 @@ } .see-also { - @include size-px(margin-left, 80); - @include size-px(width, 143); + @include size(margin-left, 80px); + @include size(width, 143px); } .download { - @include size-px(margin-left, 20); + @include size(margin-left, 20px); } .left-column .see-also { @@ -44,7 +42,7 @@ } #description { - @include size-px(margin-bottom, 26); + @include size(margin-bottom, 26px); cursor: pointer; dl { @@ -70,25 +68,25 @@ #description .meta li { text-align: right; color: #666; - @include size-px(font-size, 11.7); + @include size(font-size, 11.7px); } } .inline-tag-lists { - @include size-px(font-size, 11); + @include size(font-size, 11px); .inline-header { @include mono; display: inline-block; vertical-align: top; - @include size-px(width, 77); + @include size(width, 77px); } .inline-body { display: inline-block; vertical-align: top; - @include size-px(margin-bottom, 5.5); - @include size-px(width, 385); + @include size(margin-bottom, 5.5px); + @include size(width, 385px); ul { list-style: none; @@ -97,7 +95,7 @@ li { display: inline-block; - @include size-px(margin-right, 11); + @include size(margin-right, 11px); } } } diff --git a/apps/polls/static/polls/polls.scss b/apps/wolnelektury_core/static/scss/polls/polls.scss similarity index 100% rename from apps/polls/static/polls/polls.scss rename to apps/wolnelektury_core/static/scss/polls/polls.scss diff --git a/apps/wolnelektury_core/static/scss/tools.scss b/apps/wolnelektury_core/static/scss/tools.scss new file mode 100644 index 000000000..76869c40d --- /dev/null +++ b/apps/wolnelektury_core/static/scss/tools.scss @@ -0,0 +1,70 @@ +$default-em-size: 16px; + +@mixin size($name, $args) { + $rems: snowflake; + @each $val in $args { + $remval: $val; + @if type-of($val) == number { + @if unit($val) == "px" { + $remval: $val / $default-em-size * 1rem; + } + } + // Workaround for PySCSS issue with appending to empty lists. + @if $rems == snowflake { + $rems: $remval; + } + @else { + $rems: append($rems, $remval); + } + } + #{$name}: $args; + #{$name}: $rems; +} + +@mixin min-screen($size) { + @if unit($size) == "px" { + $size: $size / $default-em-size * 1em; + } + + @media screen and (min-width: $size) { + @content; + } +} + + +@mixin vendors($name, $args) { + @include size(-moz + $name, $args); + @include size(-webkit + $name, $args); + @include size(-moz + $name, $args); +} + +@mixin vendors($names, $args) { + @each $name in $names { + @include size($name, $args); + } +} + +@mixin box-shadow($args) { + @include vendors( + -moz-box-shadow + -webkit-box-shadow + box-shadow, + $args); +} + +@mixin mono { + font-family: "Andale Mono", "Lucida Sans Typewriter", "Courier New"; +} + +@mixin hidden-label { + display: block; + @include size(width, 1px); + @include size(height, 1px); + overflow: hidden; +} + +@mixin white-box { + @include size(border, 1px solid #ddd); + background: #fff; + @include box-shadow(2px 2px 2px #ddd); +} diff --git a/wolnelektury/settings/static.py b/wolnelektury/settings/static.py index e7cceed20..9cdc60b2d 100644 --- a/wolnelektury/settings/static.py +++ b/wolnelektury/settings/static.py @@ -22,18 +22,15 @@ PIPELINE_CSS = { 'source_filenames': [ 'css/jquery.countdown.css', - 'css/main/*.scss', - 'sponsors/css/sponsors.css', - 'funding/funding.scss', - 'polls/polls.scss', - 'css/social/shelf_tags.css', 'uni_form/uni-form.css', 'uni_form/default.uni-form.css', 'css/ui-lightness/jquery-ui-1.8.16.custom.css', + + 'scss/all.scss', ], 'output_filename': 'css/compressed/main.css', }, -- 2.20.1