gulp & styles refactor

This commit is contained in:
nitely 2015-09-06 03:27:02 -03:00
parent 35b8c523fc
commit 864a76de59
89 changed files with 849 additions and 402 deletions

3
.gitignore vendored
View File

@ -3,6 +3,9 @@ spirit/search/whoosh_index/
db.sqlite3
example/media/
# Node
node_modules
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

12
gulpfile.js Normal file
View File

@ -0,0 +1,12 @@
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var assetsPath = 'spirit/core/static/spirit/';
var cssPath = assetsPath + 'stylesheets/';
gulp.task('sass', function () {
return sass(cssPath + 'src/styles.scss')
.on('error', sass.logError)
.pipe(gulp.dest(cssPath));
});

9
package.json Normal file
View File

@ -0,0 +1,9 @@
{
"devDependencies": {
"gulp": "^3.9.0",
"gulp-ruby-sass": "^1.4.0"
},
"scripts": {
"gulp": "gulp"
}
}

View File

@ -38,6 +38,10 @@ class CommentPoll(models.Model):
def is_multiple_choice(self):
return self.choice_limit > 1
@property
def is_closed(self):
return self.close_at >= timezone.now()
@classmethod
def update_or_create_many(cls, comment, polls_raw):
cls.objects \

View File

@ -15,12 +15,14 @@
</a>
{% if user.is_authenticated and user.pk == comment.user.pk %}
<a class="head-edit-link js-post" href="{% url "spirit:topic:poll:close" pk=poll.pk %}">
{% if poll.is_closed %}
<a class="head-edit-link js-post" href="{% url "spirit:topic:poll:open" pk=poll.pk %}">
<i class="fa fa-unlock"></i> {% trans "open" %}
</a>
{% else %}
<a class="head-edit-link js-post" href="{% url "spirit:topic:poll:close" pk=poll.pk %}">
<i class="fa fa-lock"></i> {% trans "close" %}
{% endif %}
</a>
{% endif %}
{% endif %}
</form>

View File

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 970 B

View File

@ -0,0 +1,25 @@
## Installation (Ubuntu 14.04)
Install sass
```
$ sudo apt-get install ruby
$ sudo gem install sass -v 3.4.17
```
Install io.js
```
$ curl -sL https://deb.nodesource.com/setup_iojs_3.x | sudo -E bash -
$ sudo apt-get install -y iojs
```
Install dependencies
```
$ cd ./Spirit
$ npm install -y .
```
## Build
```
$ npm run gulp sass
```

View File

@ -1,4 +1,4 @@
@import "vendors/neat/neat-helpers";
@import "../vendors/neat/neat-helpers";
$visual-grid: false;
$grid-columns: 4; //default for mobile

View File

@ -27,5 +27,5 @@ $ms-ratio: $golden !default;
@function ms($Value: 0, $Bases: $ms-base, $Ratios: $ms-ratio) {
// Bourbon function
@return modular-scale($Bases, $Value, $Ratios);
@return modular-scale($Value, $Bases, $Ratios);
}

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright © 20122015 [thoughtbot, inc.](http://thoughtbot.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -5,3 +5,4 @@
// Settings
@import "settings/grid";
@import "settings/visual-grid";
@import "settings/disable-warnings";

View File

@ -1,14 +1,14 @@
// Bourbon Neat 1.6.0.pre
// MIT Licensed
// Copyright (c) 2012-2013 thoughtbot, inc.
// Neat 1.7.2
// http://neat.bourbon.io
// Copyright 2012-2015 thoughtbot, inc.
// MIT License
// Helpers
@import "neat-helpers";
// Grid
@import "grid/private";
@import "grid/reset";
@import "grid/grid";
@import "grid/box-sizing";
@import "grid/omega";
@import "grid/outer-container";
@import "grid/span-columns";
@ -19,3 +19,5 @@
@import "grid/media";
@import "grid/to-deprecate";
@import "grid/visual-grid";
@import "grid/display-context";
@import "grid/direction-context";

View File

@ -0,0 +1,49 @@
@charset "UTF-8";
/// Returns a media context (media query / grid context) that can be stored in a variable and passed to `media()` as a single-keyword argument. Media contexts defined using `new-breakpoint` are used by the visual grid, as long as they are defined before importing Neat.
///
/// @param {List} $query
/// A list of media query features and values. Each `$feature` should have a corresponding `$value`.
///
/// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.
///
/// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`). For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).
///
/// @param {Number (unitless)} $total-columns [$grid-columns]
/// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.
///
/// @example scss - Usage
/// $mobile: new-breakpoint(max-width 480px 4);
///
/// .element {
/// @include media($mobile) {
/// @include span-columns(4);
/// }
/// }
///
/// @example css - CSS Output
/// @media screen and (max-width: 480px) {
/// .element {
/// display: block;
/// float: left;
/// margin-right: 7.42297%;
/// width: 100%;
/// }
/// .element:last-child {
/// margin-right: 0;
/// }
/// }
@function new-breakpoint($query: $feature $value $columns, $total-columns: $grid-columns) {
@if length($query) == 1 {
$query: $default-feature nth($query, 1) $total-columns;
} @else if is-even(length($query)) {
$query: append($query, $total-columns);
}
@if is-not(belongs-to($query, $visual-grid-breakpoints)) {
$visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma) !global;
}
@return $query;
}

View File

@ -1,30 +1,29 @@
// Not function for Libsass compatibility
// https://github.com/sass/libsass/issues/368
@function is-not($value) {
@return if($value, false, true);
}
// Checks if a number is even
@function is-even($int) {
@if $int%2 == 0 {
@return true;
@return $int % 2 == 0;
}
@return false;
}
// Checks if an element belongs to a list
// Checks if an element belongs to a list or not
@function belongs-to($tested-item, $list) {
@each $item in $list {
@if $item == $tested-item {
@return true;
}
@return is-not(not-belongs-to($tested-item, $list));
}
@return false;
@function not-belongs-to($tested-item, $list) {
@return is-not(index($list, $tested-item));
}
// Contains display value
@function contains-display-value($query) {
@if belongs-to(table, $query) or belongs-to(block, $query) or belongs-to(inline-block, $query) or belongs-to(inline, $query) {
@return true;
}
@return false;
@return belongs-to(table, $query)
or belongs-to(block, $query)
or belongs-to(inline-block, $query)
or belongs-to(inline, $query);
}
// Parses the first argument of span-columns()
@ -32,39 +31,31 @@
@if length($span) == 3 {
$container-columns: nth($span, 3);
@return $container-columns;
}
@else if length($span) == 2 {
} @else if length($span) == 2 {
$container-columns: nth($span, 2);
@return $container-columns;
}
@else {
@return $grid-columns;
}
}
@function container-shift($shift: $shift) {
$parent-columns: $grid-columns !default;
$parent-columns: $grid-columns !default !global;
@if length($shift) == 3 {
$container-columns: nth($shift, 3);
@return $container-columns;
}
@else if length($shift) == 2 {
} @else if length($shift) == 2 {
$container-columns: nth($shift, 2);
@return $container-columns;
}
@else {
@return $parent-columns;
}
}
// Generates a striped background
@function gradient-stops($grid-columns, $color: $visual-grid-color) {
$transparent: rgba(0,0,0,0);
$transparent: transparent;
$column-width: flex-grid(1, $grid-columns);
$gutter-width: flex-gutter($grid-columns);
@ -77,9 +68,7 @@
$values: append($values, $transparent $column-offset, comma);
$values: append($values, $color $column-offset, comma);
$column-offset: $column-offset + $column-width;
}
@else {
} @else {
$values: append($values, $color $column-offset, comma);
$values: append($values, $transparent $column-offset, comma);
$column-offset: $column-offset + $gutter-width;
@ -91,9 +80,9 @@
// Layout direction
@function get-direction($layout, $default) {
$direction: nil;
$direction: null;
@if $layout == LTR or $layout == RTL {
@if to-upper-case($layout) == "LTR" or to-upper-case($layout) == "RTL" {
$direction: direction-from-layout($layout);
} @else {
$direction: direction-from-layout($default);
@ -103,9 +92,9 @@
}
@function direction-from-layout($layout) {
$direction: nil;
$direction: null;
@if $layout == LTR {
@if to-upper-case($layout) == "LTR" {
$direction: right;
} @else {
$direction: left;
@ -117,7 +106,7 @@
@function get-opposite-direction($direction) {
$opposite-direction: left;
@if $direction == left {
@if $direction == "left" {
$opposite-direction: right;
}

View File

@ -0,0 +1,22 @@
@charset "UTF-8";
/// Forces the element to fill its parent container.
///
/// @example scss - Usage
/// .element {
/// @include fill-parent;
/// }
///
/// @example css - CSS Output
/// .element {
/// width: 100%;
/// box-sizing: border-box;
/// }
@mixin fill-parent() {
width: 100%;
@if $border-box-sizing == false {
box-sizing: border-box;
}
}

View File

@ -0,0 +1,92 @@
@charset "UTF-8";
/// Outputs a media-query block with an optional grid context (the total number of columns used in the grid).
///
/// @param {List} $query
/// A list of media query features and values, where each `$feature` should have a corresponding `$value`.
/// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).
///
/// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.
///
/// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`).
///
///
/// @param {Number (unitless)} $total-columns [$grid-columns]
/// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.
///
/// @example scss - Usage
/// .responsive-element {
/// @include media(769px) {
/// @include span-columns(6);
/// }
/// }
///
/// .new-context-element {
/// @include media(min-width 320px max-width 480px, 6) {
/// @include span-columns(6);
/// }
/// }
///
/// @example css - CSS Output
/// @media screen and (min-width: 769px) {
/// .responsive-element {
/// display: block;
/// float: left;
/// margin-right: 2.35765%;
/// width: 48.82117%;
/// }
///
/// .responsive-element:last-child {
/// margin-right: 0;
/// }
/// }
///
/// @media screen and (min-width: 320px) and (max-width: 480px) {
/// .new-context-element {
/// display: block;
/// float: left;
/// margin-right: 4.82916%;
/// width: 100%;
/// }
///
/// .new-context-element:last-child {
/// margin-right: 0;
/// }
/// }
@mixin media($query: $feature $value $columns, $total-columns: $grid-columns) {
@if length($query) == 1 {
@media screen and ($default-feature: nth($query, 1)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns !global;
@content;
$grid-columns: $default-grid-columns !global;
}
} @else {
$loop-to: length($query);
$media-query: "screen and ";
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns !global;
@if is-not(is-even(length($query))) {
$grid-columns: nth($query, $loop-to) !global;
$loop-to: $loop-to - 1;
}
$i: 1;
@while $i <= $loop-to {
$media-query: $media-query + "(" + nth($query, $i) + ": " + nth($query, $i + 1) + ") ";
@if ($i + 1) != $loop-to {
$media-query: $media-query + "and ";
}
$i: $i + 2;
}
@media #{$media-query} {
@content;
$grid-columns: $default-grid-columns !global;
}
}
}

View File

@ -0,0 +1,87 @@
@charset "UTF-8";
/// Removes the element's gutter margin, regardless of its position in the grid hierarchy or display property. It can target a specific element, or every `nth-child` occurrence. Works only with `block` layouts.
///
/// @param {List} $query [block]
/// List of arguments. Supported arguments are `nth-child` selectors (targets a specific pseudo element) and `auto` (targets `last-child`).
///
/// When passed an `nth-child` argument of type `*n` with `block` display, the omega mixin automatically adds a clear to the `*n+1` th element. Note that composite arguments such as `2n+1` do not support this feature.
///
/// **Deprecation warning**: The omega mixin will no longer take a `$direction` argument. To change the layout direction, use `row($direction)` or set `$default-layout-direction` instead.
///
/// @example scss - Usage
/// .element {
/// @include omega;
/// }
///
/// .nth-element {
/// @include omega(4n);
/// }
///
/// @example css - CSS Output
/// .element {
/// margin-right: 0;
/// }
///
/// .nth-element:nth-child(4n) {
/// margin-right: 0;
/// }
///
/// .nth-element:nth-child(4n+1) {
/// clear: left;
/// }
@mixin omega($query: block, $direction: default) {
$table: belongs-to(table, $query);
$auto: belongs-to(auto, $query);
@if $direction != default {
@include -neat-warn("The omega mixin will no longer take a $direction argument. To change the layout direction, use the direction(){...} mixin.");
} @else {
$direction: get-direction($layout-direction, $default-layout-direction);
}
@if $table {
@include -neat-warn("The omega mixin no longer removes padding in table layouts.");
}
@if length($query) == 1 {
@if $auto {
&:last-child {
margin-#{$direction}: 0;
}
}
@else if contains-display-value($query) and $table == false {
margin-#{$direction}: 0;
}
@else {
@include nth-child($query, $direction);
}
} @else if length($query) == 2 {
@if $auto {
&:last-child {
margin-#{$direction}: 0;
}
} @else {
@include nth-child(nth($query, 1), $direction);
}
} @else {
@include -neat-warn("Too many arguments passed to the omega() mixin.");
}
}
@mixin nth-child($query, $direction) {
$opposite-direction: get-opposite-direction($direction);
&:nth-child(#{$query}) {
margin-#{$direction}: 0;
}
@if type-of($query) == number and unit($query) == "n" {
&:nth-child(#{$query}+1) {
clear: $opposite-direction;
}
}
}

View File

@ -0,0 +1,38 @@
@charset "UTF-8";
/// Makes an element a outer container by centring it in the viewport, clearing its floats, and setting its `max-width`.
/// Although optional, using `outer-container` is recommended. The mixin can be called on more than one element per page, as long as they are not nested.
///
/// @param {Number [unit]} $local-max-width [$max-width]
/// Max width to be applied to the element. Can be a percentage or a measure.
///
/// @example scss - Usage
/// .element {
/// @include outer-container(100%);
/// }
///
/// @example css - CSS Output
/// .element {
/// *zoom: 1;
/// max-width: 100%;
/// margin-left: auto;
/// margin-right: auto;
/// }
///
/// .element:before, .element:after {
/// content: " ";
/// display: table;
/// }
///
/// .element:after {
/// clear: both;
/// }
@mixin outer-container($local-max-width: $max-width) {
@include clearfix;
max-width: $local-max-width;
margin: {
left: auto;
right: auto;
}
}

View File

@ -0,0 +1,25 @@
@charset "UTF-8";
/// Adds padding to the element.
///
/// @param {List} $padding [flex-gutter()]
/// A list of padding value(s) to use. Passing `default` in the list will result in using the gutter width as a padding value.
///
/// @example scss - Usage
/// .element {
/// @include pad(30px -20px 10px default);
/// }
///
/// @example css - CSS Output
/// .element {
/// padding: 30px -20px 10px 2.35765%;
/// }
@mixin pad($padding: flex-gutter()) {
$padding-list: null;
@each $value in $padding {
$value: if($value == 'default', flex-gutter(), $value);
$padding-list: join($padding-list, $value);
}
padding: $padding-list;
}

View File

@ -3,7 +3,7 @@ $fg-column: $column;
$fg-gutter: $gutter;
$fg-max-columns: $grid-columns;
$container-display-table: false !default;
$layout-direction: nil !default;
$layout-direction: LTR !default;
@function flex-grid($columns, $container-columns: $fg-max-columns) {
$width: $columns * $fg-column + ($columns - 1) * $fg-gutter;
@ -22,22 +22,14 @@ $layout-direction: nil !default;
@function get-parent-columns($columns) {
@if $columns != $grid-columns {
$parent-columns: $columns;
$parent-columns: $columns !global;
} @else {
$parent-columns: $grid-columns;
$parent-columns: $grid-columns !global;
}
@return $parent-columns;
}
@function is-display-table($container-is-display-table, $display) {
$display-table: false;
@if $container-is-display-table == true {
$display-table: true;
} @else if $display == table {
$display-table: true;
}
@return $display-table;
@return $container-is-display-table == true or $display == table;
}

View File

@ -0,0 +1,52 @@
@charset "UTF-8";
/// Designates the element as a row of columns in the grid layout. It clears the floats on the element and sets its display property. Rows can't be nested, but there can be more than one row element—with different display properties—per layout.
///
/// @param {String} $display [default]
/// Sets the display property of the element and the display context that will be used by its children. Can be `block` or `table`.
///
/// @param {String} $direction [$default-layout-direction]
/// Sets the layout direction. Can be `LTR` (left-to-right) or `RTL` (right-to-left).
///
/// @example scss - Usage
/// .element {
/// @include row();
/// }
///
/// @example css - CSS Output
/// .element {
/// *zoom: 1;
/// display: block;
/// }
///
/// .element:before, .element:after {
/// content: " ";
/// display: table;
/// }
///
/// .element:after {
/// clear: both;
/// }
@mixin row($display: default, $direction: $default-layout-direction) {
@if $direction != $default-layout-direction {
@include -neat-warn("The $direction argument will be deprecated in future versions in favor of the direction(){...} mixin.");
}
$layout-direction: $direction !global;
@if $display != default {
@include -neat-warn("The $display argument will be deprecated in future versions in favor of the display(){...} mixin.");
}
@if $display == table {
display: table;
@include fill-parent;
table-layout: fixed;
$container-display-table: true !global;
} @else {
@include clearfix;
display: block;
$container-display-table: false !global;
}
}

View File

@ -0,0 +1,50 @@
@charset "UTF-8";
/// Translates an element horizontally by a number of columns. Positive arguments shift the element to the active layout direction, while negative ones shift it to the opposite direction.
///
/// @param {Number (unitless)} $n-columns [1]
/// Number of columns by which the element shifts.
///
/// @example scss - Usage
/// .element {
/// @include shift(-3);
/// }
///
/// @example css - CSS output
/// .element {
/// margin-left: -25.58941%;
/// }
@mixin shift($n-columns: 1) {
@include shift-in-context($n-columns);
}
/// Translates an element horizontally by a number of columns, in a specific nesting context.
///
/// @param {List} $shift
/// A list containing the number of columns to shift (`$columns`) and the number of columns of the parent element (`$container-columns`).
///
/// The two values can be separated with any string such as `of`, `/`, etc.
///
/// @example scss - Usage
/// .element {
/// @include shift(-3 of 6);
/// }
///
/// @example css - CSS output
/// .element {
/// margin-left: -52.41458%;
/// }
@mixin shift-in-context($shift: $columns of $container-columns) {
$n-columns: nth($shift, 1);
$parent-columns: container-shift($shift) !global;
$direction: get-direction($layout-direction, $default-layout-direction);
$opposite-direction: get-opposite-direction($direction);
margin-#{$opposite-direction}: $n-columns * flex-grid(1, $parent-columns) + $n-columns * flex-gutter($parent-columns);
// Reset nesting context
$parent-columns: $grid-columns !global;
}

View File

@ -0,0 +1,94 @@
@charset "UTF-8";
/// Specifies the number of columns an element should span. If the selector is nested the number of columns of its parent element should be passed as an argument as well.
///
/// @param {List} $span
/// A list containing `$columns`, the unitless number of columns the element spans (required), and `$container-columns`, the number of columns the parent element spans (optional).
///
/// If only one value is passed, it is assumed that it's `$columns` and that that `$container-columns` is equal to `$grid-columns`, the total number of columns in the grid.
///
/// The values can be separated with any string such as `of`, `/`, etc.
///
/// `$columns` also accepts decimals for when it's necessary to break out of the standard grid. E.g. Passing `2.4` in a standard 12 column grid will divide the row into 5 columns.
///
/// @param {String} $display [block]
/// Sets the display property of the element. By default it sets the display propert of the element to `block`.
///
/// If passed `block-collapse`, it also removes the margin gutter by adding it to the element width.
///
/// If passed `table`, it sets the display property to `table-cell` and calculates the width of the element without taking gutters into consideration. The result does not align with the block-based grid.
///
/// @example scss - Usage
/// .element {
/// @include span-columns(6);
///
/// .nested-element {
/// @include span-columns(2 of 6);
/// }
/// }
///
/// @example css - CSS Output
/// .element {
/// display: block;
/// float: left;
/// margin-right: 2.35765%;
/// width: 48.82117%;
/// }
///
/// .element:last-child {
/// margin-right: 0;
/// }
///
/// .element .nested-element {
/// display: block;
/// float: left;
/// margin-right: 4.82916%;
/// width: 30.11389%;
/// }
///
/// .element .nested-element:last-child {
/// margin-right: 0;
/// }
@mixin span-columns($span: $columns of $container-columns, $display: block) {
$columns: nth($span, 1);
$container-columns: container-span($span);
$parent-columns: get-parent-columns($container-columns) !global;
$direction: get-direction($layout-direction, $default-layout-direction);
$opposite-direction: get-opposite-direction($direction);
$display-table: is-display-table($container-display-table, $display);
@if $display-table {
display: table-cell;
width: percentage($columns / $container-columns);
} @else {
float: #{$opposite-direction};
@if $display != no-display {
display: block;
}
@if $display == collapse {
@include -neat-warn("The 'collapse' argument will be deprecated. Use 'block-collapse' instead.");
}
@if $display == collapse or $display == block-collapse {
width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
&:last-child {
width: flex-grid($columns, $container-columns);
}
} @else {
margin-#{$direction}: flex-gutter($container-columns);
width: flex-grid($columns, $container-columns);
&:last-child {
margin-#{$direction}: 0;
}
}
}
}

View File

@ -0,0 +1,97 @@
@charset "UTF-8";
@mixin breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) {
@include -neat-warn("The breakpoint() mixin was renamed to media() in Neat 1.0. Please update your project with the new syntax before the next version bump.");
@if length($query) == 1 {
@media screen and ($default-feature: nth($query, 1)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@content;
$grid-columns: $default-grid-columns;
}
} @else if length($query) == 2 {
@media screen and (nth($query, 1): nth($query, 2)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@content;
$grid-columns: $default-grid-columns;
}
} @else if length($query) == 3 {
@media screen and (nth($query, 1): nth($query, 2)) {
$default-grid-columns: $grid-columns;
$grid-columns: nth($query, 3);
@content;
$grid-columns: $default-grid-columns;
}
} @else if length($query) == 4 {
@media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@content;
$grid-columns: $default-grid-columns;
}
} @else if length($query) == 5 {
@media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
$default-grid-columns: $grid-columns;
$grid-columns: nth($query, 5);
@content;
$grid-columns: $default-grid-columns;
}
} @else {
@include -neat-warn("Wrong number of arguments for breakpoint(). Read the documentation for more details.");
}
}
@mixin nth-omega($nth, $display: block, $direction: default) {
@include -neat-warn("The nth-omega() mixin is deprecated. Please use omega() instead.");
@include omega($nth $display, $direction);
}
/// Resets the active display property to `block`. Particularly useful when changing the display property in a single row.
///
/// @example scss - Usage
/// .element {
/// @include row(table);
/// // Context changed to table display
/// }
///
/// @include reset-display;
/// // Context is reset to block display
@mixin reset-display {
$container-display-table: false !global;
@include -neat-warn("Resetting $display will be deprecated in future versions in favor of the display(){...} mixin.");
}
/// Resets the active layout direction to the default value set in `$default-layout-direction`. Particularly useful when changing the layout direction in a single row.
///
/// @example scss - Usage
/// .element {
/// @include row($direction: RTL);
/// // Context changed to right-to-left
/// }
///
/// @include reset-layout-direction;
/// // Context is reset to left-to-right
@mixin reset-layout-direction {
$layout-direction: $default-layout-direction !global;
@include -neat-warn("Resetting $direction will be deprecated in future versions in favor of the direction(){...} mixin.");
}
/// Resets both the active layout direction and the active display property.
///
/// @example scss - Usage
/// .element {
/// @include row(table, RTL);
/// // Context changed to table table and right-to-left
/// }
///
/// @include reset-all;
/// // Context is reset to block display and left-to-right
@mixin reset-all {
@include reset-display;
@include reset-layout-direction;
}

View File

@ -1,26 +1,27 @@
@charset "UTF-8";
@mixin grid-column-gradient($values...) {
background-image: deprecated-webkit-gradient(linear, left top, left bottom, $values);
background-image: -webkit-linear-gradient(left, $values);
background-image: -moz-linear-gradient(left, $values);
background-image: -ms-linear-gradient(left, $values);
background-image: -o-linear-gradient(left, $values);
background-image: unquote("linear-gradient(left, #{$values})");
background-image: unquote("linear-gradient(to left, #{$values})");
}
@if $visual-grid == true or $visual-grid == yes {
body:before {
content: '';
display: inline-block;
@include grid-column-gradient(gradient-stops($grid-columns));
content: "";
display: inline-block;
height: 100%;
left: 0;
margin: 0 auto;
max-width: $max-width;
opacity: $visual-grid-opacity;
pointer-events: none;
position: fixed;
right: 0;
width: 100%;
pointer-events: none;
@if $visual-grid-index == back {
z-index: -1;
@ -31,7 +32,7 @@
}
@each $breakpoint in $visual-grid-breakpoints {
@if $breakpoint != nil {
@if $breakpoint {
@include media($breakpoint) {
@include grid-column-gradient(gradient-stops($grid-columns));
}

View File

@ -0,0 +1,51 @@
@charset "UTF-8";
/// Sets the relative width of a single grid column. The unit used should be the same one used to define `$gutter`. To learn more about modular-scale() see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with a `!global` flag.
///
/// @type Number (Unit)
$column: modular-scale(3, 1em, $golden) !default;
/// Sets the relative width of a single grid gutter. The unit used should be the same one used to define `$column`. To learn more about modular-scale() see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with the `!global` flag.
///
/// @type Number (Unit)
$gutter: modular-scale(1, 1em, $golden) !default;
/// Sets the total number of columns in the grid. Its value can be overridden inside a media query using the `media()` mixin. Set with the `!global` flag.
///
/// @type Number (Unitless)
$grid-columns: 12 !default;
/// Sets the max-width property of the element that includes `outer-container()`. To learn more about `em()` see [Bourbon docs](http://bourbon.io/docs/#px-to-em). Set with the `!global` flag.
///
/// @type Number (Unit)
///
$max-width: em(1088) !default;
/// When set to true, it sets the box-sizing property of all elements to `border-box`. Set with a `!global` flag.
///
/// @type Bool
///
/// @example css - CSS Output
/// html {
/// box-sizing: border-box; }
///
/// *, *::after, *::before {
/// box-sizing: inherit;
/// }
$border-box-sizing: true !default;
/// Sets the default [media feature](http://www.w3.org/TR/css3-mediaqueries/#media) that `media()` and `new-breakpoint()` revert to when only a breakpoint value is passed. Set with a `!global` flag.
///
/// @type String
$default-feature: min-width; // Default @media feature for the breakpoint() mixin
///Sets the default layout direction of the grid. Can be `LTR` or `RTL`. Set with a `!global` flag.
///
///@type String
$default-layout-direction: LTR !default;

View File

@ -0,0 +1,27 @@
@charset "UTF-8";
/// Displays the visual grid when set to true. The overlaid grid may be few pixels off depending on the browser's rendering engine and pixel rounding algorithm. Set with the `!global` flag.
///
/// @type Bool
$visual-grid: false !default;
/// Sets the visual grid color. Set with `!global` flag.
///
/// @type Color
$visual-grid-color: #eee !default;
/// Sets the `z-index` property of the visual grid. Can be `back` (behind content) or `front` (in front of content). Set with `!global` flag.
///
/// @type String
$visual-grid-index: back !default;
/// Sets the opacity property of the visual grid. Set with `!global` flag.
///
/// @type Number (unitless)
$visual-grid-opacity: 0.4 !default;
$visual-grid-breakpoints: () !default;

View File

@ -1,8 +1,9 @@
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
html {
box-sizing: border-box; }
*, *::after, *::before {
box-sizing: inherit; }
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
@ -436,15 +437,13 @@ html {
cursor: default; }
body {
*zoom: 1;
max-width: 68em;
margin-left: auto;
margin-right: auto; }
body:before, body:after {
body::after {
clear: both;
content: "";
display: table; }
body:after {
clear: both; }
html {
position: relative;
@ -504,10 +503,9 @@ label {
@font-face {
font-family: ubuntu-light-webfont;
font-weight: normal;
font-style: normal;
src: url("vendors/fonts/ubuntu-light-webfont.eot");
src: url("vendors/fonts/ubuntu-light-webfont.eot?#iefix") format("embedded-opentype"), url("vendors/fonts/ubuntu-light-webfont.woff") format("woff"), url("vendors/fonts/ubuntu-light-webfont.ttf") format("truetype"), url("vendors/fonts/ubuntu-light-webfont.svg#ubuntu-light-webfont") format("svg"); }
font-weight: normal;
src: url("vendors/fonts/ubuntu-light-webfont.eot?#iefix") format("embedded-opentype"), url("vendors/fonts/ubuntu-light-webfont.woff2") format("woff2"), url("vendors/fonts/ubuntu-light-webfont.woff") format("woff"), url("vendors/fonts/ubuntu-light-webfont.ttf") format("truetype"), url("vendors/fonts/ubuntu-light-webfont.svg#ubuntu-light-webfont") format("svg"); }
a {
color: #979797;
text-decoration: none;
@ -527,21 +525,12 @@ h2 {
font-size: 21.33333px;
line-height: 32.0px; }
.comment-media, .container,
.header, .row,
.comment, .comment-info, .menu-item {
*zoom: 1; }
.comment-media:before, .container:before,
.header:before, .row:before,
.comment:before, .comment-info:before, .menu-item:before, .comment-media:after, .container:after,
.header:after, .row:after,
.comment:after, .comment-info:after, .menu-item:after {
.comment-media::after, .container::after,
.header::after, .row::after,
.comment::after, .comment-info::after, .menu-item::after {
clear: both;
content: "";
display: table; }
.comment-media:after, .container:after,
.header:after, .row:after,
.comment:after, .comment-info:after, .menu-item:after {
clear: both; }
.inline-list li,
.tabs li,
@ -654,7 +643,7 @@ input[type="submit"].button,
display: block;
line-height: 42px;
white-space: nowrap;
color: #cccccc;
color: #ccc;
padding-left: 15px; }
.side-menu-link:focus, .side-menu-link:hover {
color: #fefefe;
@ -666,7 +655,7 @@ input[type="submit"].button,
font-size: 35px;
line-height: 75px;
margin-left: 15px;
color: #cccccc; }
color: #ccc; }
.side-menu-close:focus, .side-menu-close:hover {
color: #fefefe; }
@ -710,15 +699,13 @@ input[type="submit"].button,
text-align: left; }
.footer-container {
*zoom: 1;
max-width: 68em;
margin-left: auto;
margin-right: auto; }
.footer-container:before, .footer-container:after {
.footer-container::after {
clear: both;
content: "";
display: table; }
.footer-container:after {
clear: both; }
.footer-logo {
float: right;
@ -877,15 +864,13 @@ input[type="submit"].button,
padding: 6px 0; }
.move-container {
*zoom: 1;
max-width: 68em;
margin-left: auto;
margin-right: auto; }
.move-container:before, .move-container:after {
.move-container::after {
clear: both;
content: "";
display: table; }
.move-container:after {
clear: both; }
.move-link,
.move-label,

View File

@ -1,16 +0,0 @@
@function new-breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) {
@if length($query) == 1 {
$query: $default-feature nth($query, 1) $total-columns;
}
@else if length($query) % 2 == 0 {
$query: append($query, $total-columns);
}
@if not belongs-to($query, $visual-grid-breakpoints) {
$visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma);
}
@return $query;
}

View File

@ -1,7 +0,0 @@
@mixin fill-parent() {
width: 100%;
@if $border-box-sizing == false {
@include box-sizing(border-box);
}
}

View File

@ -1,38 +0,0 @@
@mixin media($query:$feature $value $columns, $total-columns: $grid-columns) {
@if length($query) == 1 {
@media screen and ($default-feature: nth($query, 1)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@content;
$grid-columns: $default-grid-columns;
}
}
@else {
$loopTo: length($query);
$mediaQuery: 'screen and ';
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@if length($query) % 2 != 0 {
$grid-columns: nth($query, $loopTo);
$loopTo: $loopTo - 1;
}
$i: 1;
@while $i <= $loopTo {
$mediaQuery: $mediaQuery + '(' + nth($query, $i) + ': ' + nth($query, $i + 1) + ') ';
@if ($i + 1) != $loopTo {
$mediaQuery: $mediaQuery + 'and ';
}
$i: $i + 2;
}
@media #{$mediaQuery} {
@content;
$grid-columns: $default-grid-columns;
}
}
}

View File

@ -1,61 +0,0 @@
// Remove last element gutter
@mixin omega($query: block, $direction: default) {
$table: if(belongs-to(table, $query), true, false);
$auto: if(belongs-to(auto, $query), true, false);
@if $direction != default {
@warn "The omega mixin will no longer take a $direction argument. To change the layout direction, use row($direction) or set $default-layout-direction instead."
} @else {
$direction: get-direction($layout-direction, $default-layout-direction);
}
@if $table {
@warn "The omega mixin no longer removes padding in table layouts."
}
@if length($query) == 1 {
@if $auto {
&:last-child {
margin-#{$direction}: 0;
}
}
@else if contains-display-value($query) and $table == false {
margin-#{$direction}: 0;
}
@else {
@include nth-child($query, $direction);
}
}
@else if length($query) == 2 {
@if $auto {
&:last-child {
margin-#{$direction}: 0;
}
}
@else {
@include nth-child(nth($query, 1), $direction);
}
}
@else {
@warn "Too many arguments passed to the omega() mixin."
}
}
@mixin nth-child($query, $direction) {
$opposite-direction: get-opposite-direction($direction);
&:nth-child(#{$query}) {
margin-#{$direction}: 0;
}
@if type-of($query) == number {
&:nth-child(#{$query}+1) {
clear: $opposite-direction;
}
}
}

View File

@ -1,8 +0,0 @@
@mixin outer-container {
@include clearfix;
max-width: $max-width;
margin: {
left: auto;
right: auto;
}
}

View File

@ -1,8 +0,0 @@
@mixin pad($padding: flex-gutter()) {
$padding-list: null;
@each $value in $padding {
$value: if($value == 'default', flex-gutter(), $value);
$padding-list: join($padding-list, $value);
}
padding: $padding-list;
}

View File

@ -1,17 +0,0 @@
@mixin row($display: block, $direction: $default-layout-direction) {
@include clearfix;
$layout-direction: $direction;
@if $display == table {
display: table;
@include fill-parent;
table-layout: fixed;
$container-display-table: true;
}
@else {
display: block;
$container-display-table: false;
}
}

View File

@ -1,16 +0,0 @@
@mixin shift($n-columns: 1) {
@include shift-in-context($n-columns);
}
@mixin shift-in-context($shift: $columns of $container-columns) {
$n-columns: nth($shift, 1);
$parent-columns: container-shift($shift);
$direction: get-direction($layout-direction, $default-layout-direction);
$opposite-direction: get-opposite-direction($direction);
margin-#{$opposite-direction}: $n-columns * flex-grid(1, $parent-columns) + $n-columns * flex-gutter($parent-columns);
// Reset nesting context
$parent-columns: $grid-columns;
}

View File

@ -1,43 +0,0 @@
@mixin span-columns($span: $columns of $container-columns, $display: block) {
$columns: nth($span, 1);
$container-columns: container-span($span);
// Set nesting context (used by shift())
$parent-columns: get-parent-columns($container-columns);
$direction: get-direction($layout-direction, $default-layout-direction);
$opposite-direction: get-opposite-direction($direction);
$display-table: is-display-table($container-display-table, $display);
@if $display-table {
display: table-cell;
width: percentage($columns / $container-columns);
} @else {
float: #{$opposite-direction};
@if $display != no-display {
display: block;
}
@if $display == collapse {
@warn "The 'collapse' argument will be deprecated. Use 'block-collapse' instead."
}
@if $display == collapse or $display == block-collapse {
width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
&:last-child {
width: flex-grid($columns, $container-columns);
}
} @else {
margin-#{$direction}: flex-gutter($container-columns);
width: flex-grid($columns, $container-columns);
&:last-child {
margin-#{$direction}: 0;
}
}
}
}

View File

@ -1,57 +0,0 @@
@mixin breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) {
@warn "The breakpoint() mixin was renamed to media() in Neat 1.0. Please update your project with the new syntax before the next version bump.";
@if length($query) == 1 {
@media screen and ($default-feature: nth($query, 1)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@content;
$grid-columns: $default-grid-columns;
}
}
@else if length($query) == 2 {
@media screen and (nth($query, 1): nth($query, 2)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@content;
$grid-columns: $default-grid-columns;
}
}
@else if length($query) == 3 {
@media screen and (nth($query, 1): nth($query, 2)) {
$default-grid-columns: $grid-columns;
$grid-columns: nth($query, 3);
@content;
$grid-columns: $default-grid-columns;
}
}
@else if length($query) == 4 {
@media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns;
@content;
$grid-columns: $default-grid-columns;
}
}
@else if length($query) == 5 {
@media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
$default-grid-columns: $grid-columns;
$grid-columns: nth($query, 5);
@content;
$grid-columns: $default-grid-columns;
}
}
@else {
@warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
}
}
@mixin nth-omega($nth, $display: block, $direction: default) {
@warn "The nth-omega() mixin is deprecated. Please use omega() instead.";
@include omega($nth $display, $direction);
}

View File

@ -1,7 +0,0 @@
$column: golden-ratio(1em, 3) !default; // Column width
$gutter: golden-ratio(1em, 1) !default; // Gutter between each two columns
$grid-columns: 12 !default; // Total number of columns in the grid
$max-width: em(1088) !default; // Max-width of the outer container
$border-box-sizing: true !default; // Makes all elements have a border-box layout
$default-feature: min-width; // Default @media feature for the breakpoint() mixin
$default-layout-direction: LTR !default;

View File

@ -1,5 +0,0 @@
$visual-grid: false !default; // Display the base grid
$visual-grid-color: #EEE !default;
$visual-grid-index: back !default; // Show grid behind content (back) or overlay it over the content (front)
$visual-grid-opacity: 0.4 !default;
$visual-grid-breakpoints: () !default;