Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Commit

Permalink
Un-vendorize datatables-responsive.
Browse files Browse the repository at this point in the history
Also import vendor styles before custom styles such that our styles get
higher priority.
  • Loading branch information
jmcarp committed Jun 3, 2015
1 parent b987963 commit f13e6e1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 54 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"browserify": ">= 10.1.2",
"d3": "^3.5.3",
"datatables": "^1.10.7",
"drmonty-datatables-responsive": "^1.0.6",
"eventemitter2": "~0.4.14",
"gulp": "^3.8.11",
"gulp-rename": "^1.2.2",
Expand Down
1 change: 1 addition & 0 deletions static/js/modules/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var $ = require('jquery');
var _ = require('underscore');
var URI = require('URIjs');
require('datatables');
require('drmonty-datatables-responsive');

function yearRange(first, last) {
if (first === last) {
Expand Down
18 changes: 9 additions & 9 deletions static/styles/_base/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ table.dataTable {

.table__cell--heading {
font-weight: bold;
}
}

.table__row--note {
@include font-size(1.0);
Expand Down Expand Up @@ -205,7 +205,7 @@ table.dataTable {
line-height: 1.5em;
padding: 0;
width: 50%;

&:first-child {
width: 50%;
}
Expand All @@ -215,11 +215,11 @@ table.dataTable {
margin-bottom: 0;
}
}

.table__row--header {
padding: .5em 0;
}

.table__row--nested {
.table__cell,
.table__cell:first-child {
Expand Down Expand Up @@ -315,18 +315,18 @@ table.dataTable {
@include media($medium) {
.table__cell:first-child {
width: 50%;
}
}
}
}

// Style overrides to the datatables defaults

table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
background-color: $blue;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.child > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.child > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.child > th:first-child:before {
display: none;
}
Expand All @@ -353,8 +353,8 @@ table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child:before {
table.dataTable tbody tr.child {
background-color: $lightest-gray;
padding: 0 30px;

ul {
width: 100%;
}
}
}
38 changes: 0 additions & 38 deletions static/styles/responsive-tables.css

This file was deleted.

10 changes: 5 additions & 5 deletions static/styles/styles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Include vendor styles
@import "themify-icons";
@import "datatables/media/css/jquery.dataTables";
@import "drmonty-datatables-responsive/css/dataTables.responsive";

@import "bourbon";
@import "neat";

Expand All @@ -7,8 +12,3 @@
@import "_base/base";
@import "_layout/layout";
@import "_components/components";

// Include vendor styles
@import "themify-icons";
@import "responsive-tables";
@import "datatables/media/css/jquery.dataTables";
2 changes: 0 additions & 2 deletions templates/layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<link rel="icon" type="image/png" href="/static/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="/static/img/favicon-16x16.png" sizes="16x16" />
<link rel="stylesheet" href="//cdn.datatables.net/responsive/1.0.6/css/dataTables.responsive.css">
<link rel="stylesheet" href="/{{ assets['static/styles/styles.css'] }}" />
{% if api_location %}
<script>
Expand Down Expand Up @@ -125,7 +124,6 @@ <h3>This site is in alpha. Tell us what you think!</h3>
{% include './partials/glossary.html' %}

<script src="/{{ assets['static/js/app.js'] }}"></script>
<script src="/static/js/vendor/datatables.responsive.js"></script>
{% block scripts %}{% endblock %}

{% if config.USE_ANALYTICS %}
Expand Down

0 comments on commit f13e6e1

Please sign in to comment.