Permalink
Browse files

Merge pull request #1166 from jdlrobson/DeadCodeEliminationAndDocumen…

…tation

Dead code elimination and documentation
  • Loading branch information...
mekarpeles committed Sep 24, 2018
2 parents 0215d39 + be979f1 commit 87b9b1823a60d124fe46cd90c192020824367a44
View
@@ -6,6 +6,7 @@
var/
usr/
static/build/
static/css/page-dev.less
build/
*.tgz
*.tar.gz
@@ -32,3 +33,4 @@ htmlcov
.DS_Store
.cache
node_modules/
View
@@ -25,11 +25,11 @@ css:
lessc -x static/css/page-home.less $(BUILD)/page-home.css
lessc -x static/css/page-plain.less $(BUILD)/page-plain.css
lessc -x static/css/page-user.less $(BUILD)/page-user.css
lessc -x static/css/all-js.less $(BUILD)/all-js.css
lessc -x static/css/book-widget.less $(BUILD)/book-widget.css
lessc -x static/css/books-edit.less $(BUILD)/books-edit.css
lessc -x static/css/design.less $(BUILD)/design.css
lessc -x static/css/dev.less $(BUILD)/dev.css
lessc -x static/css/js-all.less $(BUILD)/js-all.css
lessc -x static/css/page-book-widget.less $(BUILD)/page-book-widget.css
lessc -x static/css/js-books-edit.less $(BUILD)/js-books-edit.css
lessc -x static/css/page-design.less $(BUILD)/page-design.css
lessc -x static/css/page-dev.less $(BUILD)/page-dev.css
js:
mkdir -p $(BUILD)
@@ -7,7 +7,7 @@
<script type="text/javascript">
<!--
loadStyle('/static/build/books-edit.css');
loadStyle("$static_url('build/js-books-edit.css')");
\$().ready(Tabs);
\$().ready(function(){
if(jQuery.support.opacity){
@@ -1,6 +1,5 @@
$def with()
<link rel="stylesheet" type="text/css" href="/static/build/design.css"/>
$ _x = ctx.setdefault('bodyid', 'design')
<div class="design-pattern-library">
<h1>Design Pattern Library</h1>
@@ -24,9 +24,9 @@
<link href="/static/images/openlibrary-128x128.png" rel="icon" sizes="128x128" />
$ style = 'build/page-%s.css'%ctx.get('bodyid', 'user')
<link href="$static_url(style)" rel="stylesheet" type="text/css" />
<link href="$static_url('build/all-js.css')" rel="stylesheet" type="text/css"/>
<link href="$static_url('build/js-all.css')" rel="stylesheet" type="text/css"/>
$if "dev" in ctx.features:
<link href="$static_url('build/dev.css')" rel="stylesheet" type="text/css"/>
<link href="$static_url('build/page-dev.css')" rel="stylesheet" type="text/css"/>
<meta name="google-site-verification" content="KrqcZD4l5BLNVyjzSi2sjZBiwgmkJ1W7n6w7ThD7A74" />
<meta name="google-site-verification" content="vtXGm8q3UgP-f6qXTvQBo85uh3nmIYIotVqqdJDpyz4" />
@@ -10,9 +10,9 @@
<head>
<meta charset="utf-8">
<title>$book_title</title>
<link rel="stylesheet" type="text/css" href="$(canonical_url('/static/build/book-widget.css'))">
<link rel="stylesheet" type="text/css" href="$(canonical_url('/static/build/page-book-widget.css'))">
</head>
<body>
<body id="book-widget">
<div class="widget">
<a href="$(canonical_url(item['key']))" target="_blank" class="noshow">
<img class="bookcover" src="$(cover_url)" alt="$book_title"/>
View
@@ -12,7 +12,7 @@
"bundlesize": [
{
"path": "static/build/page-admin.css",
"maxSize": "25.8KB"
"maxSize": "25.9KB"
},
{
"path": "static/build/page-edit.css",
@@ -32,7 +32,7 @@
},
{
"path": "static/build/page-user.css",
"maxSize": "26.0KB"
"maxSize": "26.1KB"
}
],
"devDependencies": {
View
@@ -1,9 +1,23 @@
ATTENTION: This folder is currently being re-organised. Apologies
in advance for any confusion!
All files in this folder with the '.less' extension specify entry points for CSS files.
Each entry point should correspond to a group of pages.
If you are designing a component, please place the CSS for that component
inside the components folder and reference it from one or more of the entry
points.
There are 2 exceptions:
* legacy.less (kept for legacy reasons - soon to be removed)
* common.less (a common set of styles that should apply to all pages)
## Render blocking CSS
LESS files that begin with the 'page-' prefix specify CSS files which will be loaded in the head of a document as render blocking CSS. Be careful when adding CSS to these files.
## CSS loaded via JavaScript
LESS files that begin with the 'js-' prefix specify CSS files which will be loaded in the document via JavaScript. By design they will not block a page from rendering.
# Components
Groups of styles make up a "component". A "component" is a feature of a page.
If you are designing a component, please place the CSS for that component inside the components folder and reference it from one or more of the entry points.
Note that all.less is an entry point for styles that load on all pages.
If a component is referenced in 'all.less' it should not be referenced in any of the other LESS files.
View

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
View
@@ -1,3 +1,10 @@
/**
* This file provides a sensible and minimal
* set of default styles for all entry points
*
* These styles are loaded as render blocking CSS on every page.
*/
/* RESET EVERYTHING */
body,
div,
@@ -44,13 +51,6 @@ a {
color: @link-blue;
text-decoration: underline;
}
&.on,
&:hover.on,
&:visited.on {
color: @dark-grey;
cursor: default;
text-decoration: none;
}
&:hover {
color: @dark-green;
text-decoration: underline;
@@ -0,0 +1,34 @@
/**
* These styles only apply to the borrowTable on pages where
* the id `admin` or `user` is present on the body element.
* They should be reviewed and cleaned up as necessary.
*/
body#admin,
body#user {
#borrowTable {
margin: 30px 0 25px;
table {
width: 100%;
font-family: "Lucida Grande","Arial",sans-serif;
th {
border-bottom: 1px solid @beige-three;
vertical-align: bottom;
padding-bottom: 10px;
font-family: "Lucida Grande", Verdana, Geneva, Helvetica, Arial, sans-serif;
color: @brown;
font-weight: 600;
font-size: 0.6875em;
text-transform: uppercase;
white-space: nowrap;
text-align: center;
&.titles {
text-align: left;
}
}
}
}
}
@@ -52,79 +52,3 @@
}
}
}
/**
* These styles should be reviewed and split into an appropriate entry point
* so that they only apply to the pages they need to apply.
*/
body#plain {
#borrowTable {
margin: 60px 0 25px;
p {
font-size: 0.875em;
margin: 0;
padding: 0;
}
table {
width: 690px;
margin-bottom: 20px;
th {
border-bottom: 1px solid @beige-three;
vertical-align: bottom;
padding-bottom: 10px;
&.expires {
font-family: "Lucida Grande", Verdana, Geneva, Helvetica, Arial, sans-serif;
color: @brown;
font-weight: 600;
font-size: 0.6875em;
text-transform: uppercase;
white-space: nowrap;
}
&.titles {
font-family: "Lucida Grande", Verdana, Geneva, Helvetica, Arial, sans-serif;
color: @teal;
font-weight: 600;
font-size: 1.125em;
}
}
}
}
}
/**
* These styles should be reviewed and split into an appropriate entry point
* so that they only apply to the pages they need to apply.
*/
body#admin,
body#user {
#borrowTable {
margin: 30px 0 25px;
table {
width: 100%;
font-family: "Lucida Grande","Arial",sans-serif;
th {
border-bottom: 1px solid @beige-three;
vertical-align: bottom;
padding-bottom: 10px;
font-family: "Lucida Grande", Verdana, Geneva, Helvetica, Arial, sans-serif;
color: @brown;
font-weight: 600;
font-size: 0.6875em;
text-transform: uppercase;
white-space: nowrap;
text-align: center;
&.titles {
text-align: left;
}
}
}
}
}
@@ -21,8 +21,3 @@
#resultsList .jcarousel-item-vertical {
width: 918px;
}
body#form .jcarousel-clip,
body#form .jcarousel-container {
width: 525px;
}
@@ -464,11 +464,6 @@ header#header-bar {
}
}
.menu-component {
position: relative;
}
.account-component {
-webkit-box-flex: 1;
-ms-flex: 1;
View

This file was deleted.

Oops, something went wrong.
@@ -3,9 +3,22 @@
* At time of writing, this stylesheet is render blocking.
* However, the long term plan for this stylesheet is not to be render blocking.
*/
@import (less) "less/colors.less";
// slick font is used by Carousel arrow icons
// (this is a lot of bytes for just an icon so should be revisited asap)
@import (less) 'lib/font-awesome.min.css';
@import (less) 'lib/slick.css';
@import (less) 'lib/slick-theme.css';
// Not clear if these are needed. please review.
.tools a {
// The on class is added inside openlibrary/plugins/openlibrary/js/ol.js
&.on,
&.on:hover,
&.on:active {
color: @dark-grey;
cursor: default;
text-decoration: none;
}
}
@@ -1,9 +1,11 @@
@import (less) "less/colors.less";
/**
* CSS Entry point for editors
* CSS in JavaScript entry point for editors
* This can be loaded for any page with 'edit' in the URI
* CSS here will be loaded via JavaScript
* Not to be confused with page-edit.less
*
* E.g.
* /books/<id>/<title>/edit?mode=add-work
* /works/<id>/<title>/edit
@@ -1,15 +1,29 @@
@charset "utf-8";
/**
* This is the main entry point for CSS for ALL pages.
* Any CSS loaded here will be render blocking.
* New components should be placed inside the components folder and imported
* either here or one of the other entry points.
* This file exists for historic reasons and will be deleted
* at the first available opportunity.
* DO NOT ADD NEW CSS here.
*
* We are currently in the process of:
* - moving styles from this file into the components
* - removing dead code
* - removing redundant CSS in favor of common reusable styles
*
* DO NOT ADD NEW CSS HERE
*
* New components should be placed inside the components folder
* and imported directly in one of the entry points that are prefixed
* with `page-` or `js-`
*/
@import (less) "less/colors.less";
@import (less) "less/breakpoints.less";
@import (less) "less/mixins.less";
@import (less) 'components/datatables.less';
@import (less) 'components/diff.less';
@import (less) 'components/wmd.less';
@import (less) 'components/iconochive.less';
@import (less) "components/carousel.less";
@import (less) "components/editions.less";
@import (less) "components/header-bar.less";
Oops, something went wrong.

0 comments on commit 87b9b18

Please sign in to comment.