Skip to content

Commit

Permalink
FFE-40 condensed table
Browse files Browse the repository at this point in the history
  • Loading branch information
antidecaf committed May 23, 2017
1 parent 76afee7 commit 91981b5
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v.5.1.2

* Specified font size of `--condensed` modifier to 14px
* Added example of condensed table

## v.5.1.1

* Replaced hardcoded transition properties with variables from ffe-core
Expand Down Expand Up @@ -28,12 +33,12 @@ To migrate, update your app to ffe-core version 9.x
* BREAKING: Refactored styling to reflect design guidelines
* More vertical padding in table rows by default
* Added default horizontal padding in table cells on small screens
* `--condensed` modifier to decrease default vertical padding in table rows
* Changed th color to ffe-blue-royal
* Changed background colors in expandable rows
* Different border and text styling in table footers
* Rewrote styling to less syntax
* Specified icon height to fix IE bug where chevron causes table row height issues
* Added `--condensed` modifier to decrease default vertical padding in table rows

## v.3.0.1

Expand Down
20 changes: 20 additions & 0 deletions example/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
</head>

<body class="ffe-body-text">
<div class="condensed-toggle">
<a href='#not-condensed'>regular</a> | <a href='#condensed'>condensed</a>
</div>

<div class="ffe-section-wrapper">
<div class="ffe-content-container">
<h1 class="ffe-h1">Tabeller</h1>
Expand Down Expand Up @@ -293,5 +297,21 @@ <h1 class="ffe-h1">Tabeller</h1>
</div>
</div>
</div>

<script>
(function () {
var tables = document.querySelectorAll('.ffe-responsive-table');

function toggleCondensedModifier() {
var func = window.location.hash === '#condensed' ? 'add' : 'remove';
for (var i = 0; i < tables.length; i++) {
tables[i].classList[func]('ffe-responsive-table--condensed');
}
}

window.onpopstate = toggleCondensedModifier;
toggleModifier();
}());
</script>
</body>
</html>
9 changes: 9 additions & 0 deletions example/example.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@
@import "../less/tables";

@base-url: ".";

.ffe-responsive-table {
margin-top: 60px;
}

.condensed-toggle {
margin: 10px;
outline: none;
}
2 changes: 2 additions & 0 deletions less/responsive-table.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
}

&--condensed {
font-size: 14px;

.ffe-responsive-table__heading,
.ffe-responsive-table__cell {
@media screen and (min-width: @breakpoint-md) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffe-tables",
"version": "5.1.1",
"version": "5.1.2",
"main": "less/tables.less",
"scripts": {
"compile": "npm run lint && lessc example/example.less example/example.css && cp -R node_modules/ffe-core/fonts/ example/fonts/ && echo \"$(date +%T): Updated example\"",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion visual-tests/specs/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ fs.readdirSync('./example')
})
.wait(500);
})
.capture('plain');
.capture('plain')
.capture('condensed', (actions, find) => {
actions.click(find('[href="#condensed"]'));
});
})
});

0 comments on commit 91981b5

Please sign in to comment.