Commit cdf77c53 by Usman Khalid

Merge pull request #639 from edx/usman/tnl813-rtl

Sass changes for RTL.
parents 93238bcf fd6da7dc
......@@ -267,7 +267,13 @@ class OpenAssessmentBlock(
template = get_template("openassessmentblock/oa_base.html")
context = Context(context_dict)
frag = Fragment(template.render(context))
frag.add_css(load("static/css/openassessment.css"))
i18n_service = self.runtime.service(self, 'i18n')
if hasattr(i18n_service, 'get_language_bidi') and i18n_service.get_language_bidi():
frag.add_css(load("static/css/openassessment-rtl.css"))
else:
frag.add_css(load("static/css/openassessment-ltr.css"))
frag.add_javascript(load("static/js/openassessment-lms.min.js"))
frag.initialize_js('OpenAssessmentBlock')
return frag
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -73,6 +73,7 @@
// specific UI for this application
// --------------------
@import 'vendor/hint'; // vendor - hint/tooltip UI
@import 'oa/utilities/mixins'; // open assessment mixins
@import 'oa/utilities/variables'; // specific variables and overrides
@import 'oa/utilities/extends'; // open assessment extends
@import 'oa/elements/header'; // view/app headers
......
......@@ -7,6 +7,7 @@
// --------------------
// collapse/expand
// --------------------
.ui-toggle-visibility {
// control to toggle
......@@ -23,11 +24,11 @@
> .ico {
@include transition(all $tmg-f2 ease-in-out 0s);
@include transform(rotate(90deg));
@include transform(rotate(bidi-rotate-angle(90deg)));
}
.ui-toggle-visibility__control__copy {
margin-left: ($baseline-h/4);
@include margin-left(($baseline-h/4));
}
&:hover, &:focus {
......@@ -45,15 +46,15 @@
@extend %trans-opacity;
max-height: ($baseline-v*2000);
opacity: 1.0;
padding-left: ($baseline-h/20);
padding-right: ($baseline-h/20);
@include padding-left(($baseline-h/20));
@include padding-right(($baseline-h/20));
}
// STATE: is collapsed
&.is--collapsed {
>.ui-toggle-visibility__control > .ico {
@include transform(rotate(0deg));
@include transform(rotate(bidi-rotate-angle(0deg)));
@include transform-origin(50% 50%);
}
......@@ -79,7 +80,7 @@
@extend %fake-link;
.ico {
margin-left: ($baseline-h/8);
@include margin-left(($baseline-h/8));
}
// STATE: hover
......@@ -89,7 +90,7 @@
// actual tooltip rendered
&:after {
left: 0;
@include left(0);
display: block;
white-space: normal;
width: ($baseline-h*5);
......@@ -97,7 +98,7 @@
}
&.hint--top:after {
left: 0;
margin-left: -($baseline-v);
@include left(0);
@include margin-left(-($baseline-v));
}
}
......@@ -11,9 +11,9 @@
// general: staff UI
// --------------------
.wrapper--ui-staff {
box-shadow: inset 0 1px -2px 1px $shadow-d1;
@include single-box-shadow(0, 1px, -2px, 1px, $shadow-d1, inset);
margin-top: ($baseline-v*2);
border-radius: ($baseline-v/10);
@include border-radius(($baseline-v/10));
border: 1px solid shade($color-decorative-staff, 25%);
border-top: ($baseline-v/4) solid $color-decorative-staff;
padding: $baseline-v ($baseline-h/2);
......@@ -26,7 +26,7 @@
&.ui-toggle-visibility {
.staff-info__title__copy {
margin-left: ($baseline-h/4);
@include margin-left(($baseline-h/4));
}
// STATE: is collapsed
......@@ -75,7 +75,7 @@
}
.label {
margin-right: ($baseline-h/4);
@include margin-right(($baseline-h/4));
}
.value {
......@@ -90,12 +90,12 @@
.staff-info__status__table, .staff-info__classifierset__table {
@extend %copy-3;
border-radius: ($baseline-v/10);
@include border-radius(($baseline-v/10));
color: $copy-staff-color;
.title {
@extend %hd-2;
text-align: left;
@include text-align(left);
color: $heading-staff-color;
margin-bottom: ($baseline-v/2);
}
......@@ -115,7 +115,7 @@
}
th, td[scope] {
text-align: left;
@include text-align(left);
}
......
......@@ -37,8 +37,8 @@
%ui-section {
@include transition(all $tmg-f1 ease-in-out);
@include transform(scale(1.0));
border-radius: ($baseline-v/10);
box-shadow: 0 1px 1px $shadow-l1;
@include border-radius(($baseline-v/10));
@include single-box-shadow(0, 1px, 1px, 0, $shadow-l1);
margin-bottom: $baseline-v;
border: 1px solid $color-decorative-tertiary;
border-top: ($baseline-v/4) solid $color-decorative-tertiary;
......@@ -53,13 +53,13 @@
&:hover, &:focus {
@include transform(scale(1.0));
border-color: $color-decorative-tertiary;
box-shadow: 0 1px 1px $shadow-l2;
@include single-box-shadow(0, 1px, 1px, 0, $shadow-l2);
}
// STATE: is collapsed
&.is--collapsed {
@include transform(scale(0.99));
box-shadow: 0 1px 1px $shadow-l2;
@include single-box-shadow(0, 1px, 1px, 0, $shadow-l2);
&:hover, &:focus {
@include transform(scale(1.0));
......@@ -69,7 +69,7 @@
// STATE: is loading
&.is--loading {
@include transform(scale(0.99));
box-shadow: 0 1px 1px $shadow-l2;
@include single-box-shadow(0, 1px, 1px, 0, $shadow-l2);
}
// STATE: is empty
......@@ -139,7 +139,7 @@
// UI: well
// --------------------
%ui-well {
box-shadow: inset 0 1px 2px 1px $shadow-l1;
@include single-box-shadow(0, 1px, 2px, 1px, $shadow-l1, inset);
padding: $baseline-v ($baseline-h/2);
background: $color-decorative-quinternary;
}
......@@ -174,8 +174,9 @@
.question__title__copy {
@extend %t-heading;
margin-left: ($baseline-h/4);
@include margin-left(($baseline-h/4));
white-space: pre-wrap;
display: inline;
color: $heading-color;
}
}
......@@ -184,7 +185,7 @@
%ui-rubric-answers {
margin-top: $baseline-v;
margin-bottom: $baseline-v;
margin-left: ($baseline-h/2);
@include margin-left(($baseline-h/2));
.answer, .answer--feedback {
@include row();
......@@ -210,7 +211,7 @@
}
.answer__value {
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
// STATE: checked
&:checked {
......@@ -226,17 +227,17 @@
display: block;
@include media($bp-dm) {
@include span-columns(8 of 12);
@include bidi-span-columns(8 of 12);
margin-bottom: 0;
}
@include media($bp-dl) {
@include span-columns(8 of 12);
@include bidi-span-columns(8 of 12);
margin-bottom: 0;
}
@include media($bp-dx) {
@include span-columns(8 of 12);
@include bidi-span-columns(8 of 12);
margin-bottom: 0;
}
}
......@@ -250,24 +251,24 @@
white-space: pre-wrap;
@extend %copy-3;
margin-right: $baseline-v;
@include margin-right($baseline-v);
color: $copy-secondary-color;
@include media($bp-dm) {
@include span-columns(6 of 8);
float: left;
@include bidi-span-columns(6 of 8);
@include float(left);
margin-bottom: 0;
}
@include media($bp-dl) {
@include span-columns(6 of 8);
float: left;
@include bidi-span-columns(6 of 8);
@include float(left);
margin-bottom: 0;
}
@include media($bp-dx) {
@include span-columns(6 of 8);
float: left;
@include bidi-span-columns(6 of 8);
@include float(left);
margin-bottom: 0;
}
......@@ -281,24 +282,24 @@
color: $copy-secondary-color;
@include media($bp-dm) {
float: right;
text-align: right;
@include float(right);
@include text-align(right);
}
@include media($bp-dl) {
float: right;
text-align: right;
@include float(right);
@include text-align(right);
}
@include media($bp-dx) {
float: right;
text-align: right;
@include float(right);
@include text-align(right);
}
}
.answer__points__label {
display: inline-block; // FIX: need to reset base label style
margin-left: ($baseline-v/4);
@include margin-left(($baseline-v/4));
color: $copy-secondary-color;
}
......@@ -307,21 +308,21 @@
.wrapper--input {
@include media($bp-ds) {
@include span-columns(6 of 6);
@include bidi-span-columns(6 of 6);
}
@include media($bp-dm) {
@include span-columns(4 of 12);
@include bidi-span-columns(4 of 12);
margin-bottom: 0;
}
@include media($bp-dl) {
@include span-columns(4 of 12);
@include bidi-span-columns(4 of 12);
margin-bottom: 0;
}
@include media($bp-dx) {
@include span-columns(4 of 12);
@include bidi-span-columns(4 of 12);
margin-bottom: 0;
}
}
......@@ -337,7 +338,7 @@
.answer__value {
@extend %ui-content-longanswer;
min-height: ($baseline-v*5);
margin-right: 0;
@include margin-right(0);
}
}
}
// openassessment: utilities - mixins
// ====================
@mixin single-box-shadow($offset-x, $offset-y, $blur-radius: 0, $spread-radius: 0, $color: grey, $inset: null) {
$shadow : "";
@if $bi-app-direction == ltr {
$shadow: $offset-x $offset-y $blur-radius $spread-radius $color;
} @else {
$shadow: -($offset-x) $offset-y $blur-radius $spread-radius $color;
}
@if $inset == inset {
$shadow: inset $shadow;
}
box-shadow: $shadow;
}
@function bidi-rotate-angle($degrees) {
@if $bi-app-direction == ltr {
@return $degrees;
} @else {
@return 180deg - $degrees;
}
}
// Bidi versions of neat mixins.
@mixin bidi-omega($query: block, $direction: default) {
@if $bi-app-direction == ltr {
@include direction-context(left-to-right) {
@include omega($query: $query, $direction: $direction);
}
} @else {
@include direction-context(right-to-left) {
@include omega($query: $query, $direction: $direction);
}
}
}
@mixin bidi-span-columns($span: $columns of $container-columns, $display: block) {
@if $bi-app-direction == ltr {
@include direction-context(left-to-right) {
@include span-columns($span: $span, $display: $display);
}
} @else {
@include direction-context(right-to-left) {
@include span-columns($span: $span, $display: $display);
}
}
}
......@@ -38,26 +38,26 @@
// step title/name
h2.step__title {
margin-top: 0 !important;
text-align: left !important;
@include text-align(left);
@include media($bp-m) {
margin-bottom: ($baseline-v/2);
}
@include media($bp-ds) {
@include span-columns(4 of 6);
@include bidi-span-columns(4 of 6);
}
@include media($bp-dm) {
@include span-columns(8 of 12);
@include bidi-span-columns(8 of 12);
}
@include media($bp-dl) {
@include span-columns(8 of 12);
@include bidi-span-columns(8 of 12);
}
@include media($bp-dx) {
@include span-columns(9 of 12);
@include bidi-span-columns(9 of 12);
}
.step__label {
......@@ -97,7 +97,7 @@
.list--actions {
list-style: none !important;
padding-left: 0 !important;
@include padding-left(0);
text-indent: 0 !important;
li {
......@@ -132,7 +132,7 @@
// peer assessment
.step--peer-assessment .list--peer-assessments {
list-style: none outside none !important;
padding-left: 0 !important;;
@include padding-left(0);
}
// self assessment
......@@ -144,7 +144,7 @@
// shown submission/results
.question__answers {
padding-left: 0 !important;
@include padding-left(0);
}
......
......@@ -50,22 +50,22 @@
margin-bottom: ($baseline-v/2);
@include media($bp-ds) {
@include span-columns(4 of 6);
@include bidi-span-columns(4 of 6);
margin-bottom: 0;
}
@include media($bp-dm) {
@include span-columns(8 of 12);
@include bidi-span-columns(8 of 12);
margin-bottom: 0;
}
@include media($bp-dl) {
@include span-columns(8 of 12);
@include bidi-span-columns(8 of 12);
margin-bottom: 0;
}
@include media($bp-dx) {
@include span-columns(9 of 12);
@include bidi-span-columns(9 of 12);
margin-bottom: 0;
}
......@@ -75,14 +75,14 @@
}
.wrapper--copy {
margin-left: ($baseline-h/2);
border-left: 1px solid $color-decorative-tertiary;
padding-left: ($baseline-h/2);
@include margin-left(($baseline-h/2));
@include border-left(1px solid $color-decorative-tertiary);
@include padding-left(($baseline-h/2));
@include media($bp-m) {
margin-left: 0;
border-left: none;
padding-left: 0;
@include margin-left(0);
@include border-left(none);
@include padding-left(0);
}
}
......@@ -153,7 +153,7 @@
@extend %icon-3;
display: inline-block;
vertical-align: baseline;
margin-right: ($baseline-h/4);
@include margin-right(($baseline-h/4));
}
.copy {
......@@ -166,29 +166,29 @@
}
@include media($bp-ds) {
@include span-columns(2 of 6);
@include omega();
@include bidi-span-columns(2 of 6);
@include bidi-omega();
position: relative;
top: -12px;
}
@include media($bp-dm) {
@include span-columns(4 of 12);
@include omega();
@include bidi-span-columns(4 of 12);
@include bidi-omega();
position: relative;
top:-12px;
}
@include media($bp-dl) {
@include span-columns(4 of 12);
@include omega();
@include bidi-span-columns(4 of 12);
@include bidi-omega();
position: relative;
top: -12px;
}
@include media($bp-dx) {
@include span-columns(3 of 12);
@include omega();
@include bidi-span-columns(3 of 12);
@include bidi-omega();
position: relative;
top: -12px;
}
......@@ -234,22 +234,22 @@
// step actions
.step__actions {
margin-bottom: ($baseline-v/2);
text-align: center;
@include text-align(center);
@include media($bp-ds) {
text-align: right;
@include text-align(right);
}
@include media($bp-dm) {
text-align: right;
@include text-align(right);
}
@include media($bp-dl) {
text-align: right;
@include text-align(right);
}
@include media($bp-dx) {
text-align: right;
@include text-align(right);
}
.action--submit {
......@@ -263,6 +263,11 @@
.ico {
@extend %icon-2;
}
.icon-caret-right:before {
@include transform(rotate(bidi-rotate-angle(0deg)));
}
}
// STATE: actions has an error
......@@ -270,7 +275,7 @@
.message {
margin-bottom: $baseline-v;
text-align: left;
@include text-align(left);
}
}
}
......@@ -464,8 +469,8 @@
position: relative;
margin-bottom: $baseline-v;
border: 1px solid $color-decorative-tertiary;
border-left: ($baseline-h/4) solid $color-decorative-secondary;
padding-left: ($baseline-h*0.75);
@include border-left(($baseline-h/4) solid $color-decorative-secondary);
@include padding-left(($baseline-h*0.75));
}
.openassessment__prompt__title {
......@@ -525,7 +530,7 @@
.response__submission__status {
display: inline-block;
vertical-align: middle;
margin-left: ($baseline-h/4);
@include margin-left(($baseline-h/4));
}
.response__submission__status__title {
......@@ -539,31 +544,31 @@
@extend %btn--secondary;
@extend %action-2;
display: block;
text-align: center;
@include text-align(center);
margin-bottom: ($baseline-v/2);
min-width: 215px;
@include media($bp-ds) {
display: inline-block;
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
margin-bottom: 0;
}
@include media($bp-dm) {
display: inline-block;
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
margin-bottom: 0;
}
@include media($bp-dl) {
display: inline-block;
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
margin-bottom: 0;
}
@include media($bp-dx) {
display: inline-block;
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
margin-bottom: 0;
}
}
......@@ -633,7 +638,7 @@
}
.question__title__copy {
margin-left: 0;
@include margin-left(0);
white-space: pre-wrap;
}
......@@ -716,9 +721,9 @@
}
.wrapper--copy {
margin-left: 0;
border-left: none;
padding-left: 0;
@include margin-left(0);
@include border-left(none);
@include padding-left(0);
}
}
......@@ -726,23 +731,23 @@
.step__title {
@include media($bp-m) {
@include span-columns(4 of 4);
@include bidi-span-columns(4 of 4);
}
@include media($bp-ds) {
@include span-columns(6 of 6);
@include bidi-span-columns(6 of 6);
}
@include media($bp-dm) {
@include span-columns(12 of 12);
@include bidi-span-columns(12 of 12);
}
@include media($bp-dl) {
@include span-columns(12 of 12);
@include bidi-span-columns(12 of 12);
}
@include media($bp-dx) {
@include span-columns(12 of 12);
@include bidi-span-columns(12 of 12);
}
.step__label, .grade__value {
......@@ -751,7 +756,7 @@
}
.step__label {
margin-right: ($baseline-h/4);
@include margin-right(($baseline-h/4));
}
.grade__value__title {
......@@ -858,15 +863,15 @@
.question__title__copy {
@extend %t-heading;
margin-left: ($baseline-h/4);
@include margin-left(($baseline-h/4));
white-space: pre-wrap;
color: $heading-color;
}
.question__score {
@extend %t-score;
float: right;
margin-left: $baseline-v;
@include float(right);
@include margin-left($baseline-v);
}
.question__score__value {
......@@ -875,7 +880,7 @@
&:after {
content: "/";
margin-left: ($baseline-v/4);
@include margin-left(($baseline-v/4));
color: $heading-secondary-color;
}
}
......@@ -886,7 +891,7 @@
.unit {
@extend %t-strong;
margin-left: ($baseline-v/4);
@include margin-left(($baseline-v/4));
}
}
......@@ -902,29 +907,29 @@
margin-bottom: $baseline-v;
@include media($bp-ds) {
@include span-columns(3 of 6);
@include omega(2n);
@include bidi-span-columns(3 of 6);
@include bidi-omega(2n);
}
@include media($bp-dm) {
@include span-columns(4 of 12);
@include omega(3n);
@include bidi-span-columns(4 of 12);
@include bidi-omega(3n);
}
@include media($bp-dl) {
@include span-columns(4 of 12);
@include omega(3n);
@include bidi-span-columns(4 of 12);
@include bidi-omega(3n);
}
@include media($bp-dx) {
@include span-columns(4 of 12);
@include omega(3n);
@include bidi-span-columns(4 of 12);
@include bidi-omega(3n);
}
// CASE: self assessment
&.self-assessment {
border-left: ($baseline-h/8) solid $color-decorative-quaternary;
padding-left: ($baseline-h/2);
@include border-left(($baseline-h/8) solid $color-decorative-quaternary);
@include padding-left(($baseline-h/2));
.answer__source {
color: $color-decorative-tertiary;
......@@ -977,19 +982,19 @@
.answer--feedback {
@include media($bp-ds) {
@include span-columns(6 of 6);
@include bidi-span-columns(6 of 6);
}
@include media($bp-dm) {
@include span-columns(12 of 12);
@include bidi-span-columns(12 of 12);
}
@include media($bp-dl) {
@include span-columns(12 of 12);
@include bidi-span-columns(12 of 12);
}
@include media($bp-dx) {
@include span-columns(12 of 12);
@include bidi-span-columns(12 of 12);
}
.answer--feedback__title {
......@@ -997,7 +1002,7 @@
}
.answer--feedback__title__copy {
margin-left: ($baseline-h/4);
@include margin-left(($baseline-h/4));
}
.answer--feedback__content {
......@@ -1050,7 +1055,7 @@
.submission__feedback__title__copy {
@extend %t-heading;
margin-left: ($baseline-h/4);
@include margin-left(($baseline-h/4));
}
.submission__feeedback__content {
......@@ -1102,7 +1107,7 @@
.action--submit {
@extend %btn--secondary;
@extend %action-2;
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
}
}
......
@import 'bi-app-ltr';
@import 'openassessment';
@import 'bi-app-rtl';
@import 'openassessment';
// ------------------------------------------
// left to right module
// authors:
// twitter.com/anasnakawa
// twitter.com/victorzamfir
// licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.php
// ------------------------------------------
@import 'variables-ltr';
@import 'mixins';
\ No newline at end of file
// ------------------------------------------
// right to left module
// authors:
// twitter.com/anasnakawa
// twitter.com/victorzamfir
// licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.php
// ------------------------------------------
@import 'variables-rtl';
@import 'mixins';
\ No newline at end of file
// ------------------------------------------
// bi app mixins
// authors:
// twitter.com/anasnakawa
// twitter.com/victorzamfir
// licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.php
// ------------------------------------------
// ------------------------------------------
// Table of contents
// ------------------------------------------
// padding
// margin
// float
// text align
// clear
// left / right
// border
// - width
// - style
// - color
// - generic
// - radius
// ltr / rtl contents
// ------------------------------------------
// generic mixin for properties with values
// (top right bottom left)
// ------------------------------------------
@mixin bi-app-compact($property, $top, $right, $bottom, $left) {
@if $bi-app-direction == ltr {
#{$property}: $top $right $bottom $left;
} @else {
#{$property}: $top $left $bottom $right;
}
}
// padding
// ------------------------------------------
@mixin padding-left($distance) {
padding-#{$bi-app-left}: $distance;
}
@mixin padding-right($distance) {
padding-#{$bi-app-right}: $distance;
}
@mixin padding($top, $right, $bottom, $left) {
@include bi-app-compact(padding, $top, $right, $bottom, $left);
}
// margin
// ------------------------------------------
@mixin margin-left($distance) {
margin-#{$bi-app-left}: $distance;
}
@mixin margin-right($distance) {
margin-#{$bi-app-right}: $distance;
}
@mixin margin($top, $right, $bottom, $left) {
@include bi-app-compact(margin, $top, $right, $bottom, $left);
}
// float
// ------------------------------------------
@mixin bi-app-float-left {
float: $bi-app-left;
}
@mixin bi-app-float-right {
float: $bi-app-right;
}
@mixin float($direction) {
@if $direction == left {
@include bi-app-float-left;
} @else if $direction == right {
@include bi-app-float-right;
} @else {
float: $direction;
}
}
// text align
// ------------------------------------------
@mixin bi-app-text-align-left {
text-align: $bi-app-left;
}
@mixin bi-app-text-align-right {
text-align: $bi-app-right;
}
@mixin text-align($direction) {
@if $direction == left {
@include bi-app-text-align-left;
} @else if $direction == right {
@include bi-app-text-align-right;
} @else {
text-align: $direction;
}
}
// clear
// ------------------------------------------
@mixin bi-app-clear-left {
clear: $bi-app-left;
}
@mixin bi-app-clear-right {
clear: $bi-app-right;
}
@mixin clear($direction) {
@if $direction == left {
@include bi-app-clear-left;
} @else if $direction == right {
@include bi-app-clear-right;
} @else {
clear: $direction;
}
}
// left / right
// ------------------------------------------
@mixin left($distance) {
@if $bi-app-direction == ltr {
left: $distance;
} @else if $bi-app-direction == rtl {
right: $distance;
}
}
@mixin right($distance) {
@if $bi-app-direction == ltr {
right: $distance;
} @else if $bi-app-direction == rtl {
left: $distance;
}
}
// border
// ------------------------------------------
// width
@mixin border-left-width($width) {
border-#{$bi-app-left}-width: $width;
}
@mixin border-right-width($width) {
border-#{$bi-app-right}-width: $width;
}
@mixin border-width($top, $right, $bottom, $left) {
@include bi-app-compact(border-width, $top, $right, $bottom, $left);
}
// style
@mixin border-left-style($style) {
border-#{$bi-app-left}-style: $style;
}
@mixin border-right-style($style) {
border-#{$bi-app-right}-style: $style;
}
@mixin border-style($top, $right, $bottom, $left) {
@include bi-app-compact(border-style, $top, $right, $bottom, $left);
}
// color
@mixin border-left-color($color) {
border-#{$bi-app-left}-color: $color;
}
@mixin border-right-color($color) {
border-#{$bi-app-right}-color: $color;
}
@mixin border-color($top, $right, $bottom, $left) {
@include bi-app-compact(border-color, $top, $right, $bottom, $left);
}
// generic
@mixin border-left($border-style) {
border-#{$bi-app-left}: $border-style;
}
@mixin border-right($border-style) {
border-#{$bi-app-right}: $border-style;
}
// radius
@mixin border-top-left-radius($radius) {
-webkit-border-top-#{$bi-app-left}-radius: $radius;
-moz-border-top#{$bi-app-left}-radius: $radius;
border-top-#{$bi-app-left}-radius: $radius;
}
@mixin border-top-right-radius($radius) {
-webkit-border-top-#{$bi-app-right}-radius: $radius;
-moz-border-top#{$bi-app-right}-radius: $radius;
border-top-#{$bi-app-right}-radius: $radius;
}
@mixin border-bottom-left-radius($radius) {
-webkit-border-bottom-#{$bi-app-left}-radius: $radius;
-moz-border-bottom#{$bi-app-left}-radius: $radius;
border-bottom-#{$bi-app-left}-radius: $radius;
}
@mixin border-bottom-right-radius($radius) {
-webkit-border-bottom-#{$bi-app-right}-radius: $radius;
-moz-border-bottom#{$bi-app-right}-radius: $radius;
border-bottom-#{$bi-app-right}-radius: $radius;
}
@mixin border-right-radius($radius) {
@include border-top-right-radius($radius);
@include border-bottom-right-radius($radius);
}
@mixin border-left-radius($radius) {
@include border-top-left-radius($radius);
@include border-bottom-left-radius($radius);
}
@mixin border-top-radius($radius) {
@include border-top-left-radius($radius);
@include border-top-right-radius($radius);
}
@mixin border-bottom-radius($radius) {
@include border-bottom-left-radius($radius);
@include border-bottom-right-radius($radius);
}
@mixin border-radius($topLeft, $topRight: null, $bottomRight: null, $bottomLeft: null) {
@if $topRight != null {
@include border-top-left-radius($topLeft);
@include border-top-right-radius($topRight);
@include border-bottom-right-radius($bottomRight);
@include border-bottom-left-radius($bottomLeft);
} @else {
-webkit-border-radius: $topLeft;
-moz-border-radius: $topLeft;
-ms-border-radius: $topLeft;
-o-border-radius: $topLeft;
border-radius: $topLeft;
}
}
// Returns "en" or "ar", useful for image suffixes.
// Usage: background-image: url(/img/header-#{lang()}.png);
@function lang() {
@if $bi-app-direction == ltr {
@return 'en';
} @else {
@return 'ar';
}
}
// Support for "direction" declaration (renders ltr/rtl).
// Useful for form elements as they swap the text-indent property and align the text accordingly.
@mixin direction {
direction: $bi-app-direction;
}
// Inverts a percentage value. Example: 97% becames 3%.
// Useful for background-position.
@function bi-app-invert-percentage($percentage) {
@if $bi-app-direction == rtl {
@return 100% - $percentage;
} @else {
@return $percentage;
}
}
// ltr / rtl contents
// ------------------------------------------
@mixin ltr {
@if $bi-app-direction == ltr {
@content;
}
}
@mixin rtl {
@if $bi-app-direction == rtl {
@content;
}
}
// ------------------------------------------
// left to right variables to be used by bi-app mixins
// authors:
// twitter.com/anasnakawa
// twitter.com/victorzamfir
// licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.php
// ------------------------------------------
// namespacing variables with bi-app to
// avoid conflicting with other global variables
$bi-app-left : left;
$bi-app-right : right;
$bi-app-direction : ltr;
$bi-app-invert-direction: rtl;
\ No newline at end of file
// ------------------------------------------
// right to left variables to be used by bi-app mixins
// authors:
// twitter.com/anasnakawa
// twitter.com/victorzamfir
// licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.php
// ------------------------------------------
// namespacing variables with bi-app to
// avoid conflicting with other global variables
$bi-app-left : right;
$bi-app-right : left;
$bi-app-direction : rtl;
$bi-app-invert-direction: ltr;
\ No newline at end of file
......@@ -87,7 +87,7 @@
}
.copy {
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
}
}
......
......@@ -108,7 +108,7 @@
}
.option__input {
margin-right: ($baseline-v/2);
@include margin-right(($baseline-v/2));
// STATE: checked
&:checked {
......
......@@ -5,3 +5,4 @@
// Settings
@import "settings/grid";
@import "settings/visual-grid";
@import "settings/disable-warnings";
// Bourbon Neat 1.5.0
// MIT Licensed
// Copyright (c) 2012-2013 thoughtbot, inc.
/* Neat 1.7.0
* http://neat.bourbon.io
* Copyright 2012-2014 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";
@function new-breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) {
/// 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 length($query) == 2 or length($query) == 4 {
@else if is-even(length($query)) {
$query: append($query, $total-columns);
}
@if not belongs-to($query, $visual-grid-breakpoints) {
$visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma);
$visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma) !global;
}
@return $query;
......
// Checks if a number is even
@function is-even($int) {
@if $int%2 == 0 {
@return true;
}
@return false;
@return $int % 2 == 0
}
// 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 not not-belongs-to($tested-item, $list);
}
@return false;
@function not-belongs-to($tested-item, $list) {
@return 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,34 +25,26 @@
@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;
}
@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;
}
@return $parent-columns;
}
// Generates a striped background
......@@ -77,9 +62,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 +74,9 @@
// Layout direction
@function get-direction($layout, $default) {
$direction: nil;
@if $layout == LTR or $layout == RTL {
$direction: null;
@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 +86,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 +100,7 @@
@function get-opposite-direction($direction) {
$opposite-direction: left;
@if $direction == left {
@if $direction == "left" {
$opposite-direction: right;
}
......
@if $border-box-sizing == true {
html { // http://bit.ly/1qk2tVR
@include box-sizing(border-box);
}
* {
&, &:before, &:after {
@include box-sizing(inherit);
}
}
}
/// Changes the direction property used by other mixins called in the code block argument.
///
/// @param {String} $direction (left-to-right)
/// Layout direction to be used within the block. Can be `left-to-right` or `right-to-left`.
///
/// @example scss - Usage
/// @include direction(right-to-left) {
/// .right-to-left-block {
/// @include span-columns(6);
/// }
/// }
///
/// @example css - CSS Output
/// .right-to-left-block {
/// float: right;
/// ...
/// }
@mixin direction-context($direction: left-to-right) {
$scope-direction: $layout-direction;
@if to-lower-case($direction) == "left-to-right" {
$layout-direction: LTR !global;
} @else if to-lower-case($direction) == "right-to-left" {
$layout-direction: RTL !global;
}
@content;
$layout-direction: $scope-direction !global;
}
/// Changes the display property used by other mixins called in the code block argument.
///
/// @param {String} $display (block)
/// Display value to be used within the block. Can be `table` or `block`.
///
/// @example scss
/// @include display(table) {
/// .display-table {
/// @include span-columns(6);
/// }
/// }
///
/// @example css
/// .display-table {
/// display: table-cell;
/// ...
/// }
@mixin display-context($display: block) {
$scope-display: $container-display-table;
$container-display-table: $display == table !global;
@content;
$container-display-table: $scope-display !global;
}
/// Forces the element to fill its parent container.
///
/// @example scss - Usage
/// .element {
/// @include fill-parent;
/// }
///
/// @example css - CSS Output
/// .element {
/// width: 100%;
/// -webkit-box-sizing: border-box;
/// -moz-box-sizing: border-box;
/// box-sizing: border-box;
/// }
@mixin fill-parent() {
width: 100%;
......
@mixin media($query:$feature $value $columns, $total-columns: $grid-columns) {
/// 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;
$grid-columns: $total-columns !global;
@content;
$grid-columns: $default-grid-columns;
$grid-columns: $default-grid-columns !global;
}
}
@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 {
$loop-to: length($query);
$media-query: 'screen and ';
$default-grid-columns: $grid-columns;
$grid-columns: $total-columns !global;
@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;
@if not is-even(length($query)) {
$grid-columns: nth($query, $loop-to) !global;
$loop-to: $loop-to - 1;
}
}
@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;
$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;
}
}
@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);
@media #{$media-query} {
@content;
$grid-columns: $default-grid-columns;
$grid-columns: $default-grid-columns !global;
}
}
@else {
@warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
}
}
// Remove last element gutter
/// 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: if(belongs-to(table, $query), true, false);
$auto: if(belongs-to(auto, $query), true, false);
$table: belongs-to(table, $query);
$auto: belongs-to(auto, $query);
@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."
@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 {
......@@ -16,14 +50,8 @@
}
}
@else if contains-display-value($query) {
@if $table {
padding-#{$direction}: 0;
}
@else {
margin-#{$direction}: 0;
}
@else if contains-display-value($query) and $table == false {
margin-#{$direction}: 0;
}
@else {
......@@ -32,35 +60,19 @@
}
@else if length($query) == 2 {
@if $table {
@if $auto {
&:last-child {
padding-#{$direction}: 0;
}
}
@else {
&:nth-child(#{nth($query, 1)}) {
padding-#{$direction}: 0;
}
@if $auto {
&:last-child {
margin-#{$direction}: 0;
}
}
@else {
@if $auto {
&:last-child {
margin-#{$direction}: 0;
}
}
@else {
@include nth-child(nth($query, 1), $direction);
}
@include nth-child(nth($query, 1), $direction);
}
}
@else {
@warn "Too many arguments passed to the omega() mixin."
@include -neat-warn("Too many arguments passed to the omega() mixin.");
}
}
......
@mixin outer-container {
/// 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: $max-width;
max-width: $local-max-width;
margin: {
left: auto;
right: auto;
......
/// 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 {
......
......@@ -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,29 +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;
}
@function get-padding-for-table-layout($columns, $total-columns) {
$total-padding: flex-gutter($total-columns) * ($columns - 1);
$padding: $total-padding / $columns;
@return $padding;
@return $container-is-display-table == true or $display == table;
}
@mixin row($display: block, $direction: $default-layout-direction) {
@include clearfix;
$layout-direction: $direction;
/// 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;
$container-display-table: true !global;
}
@else {
@include clearfix;
display: block;
$container-display-table: false;
$container-display-table: false !global;
}
}
/// 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);
$parent-columns: container-shift($shift) !global;
$direction: get-direction($layout-direction, $default-layout-direction);
$opposite-direction: get-opposite-direction($direction);
......@@ -12,5 +44,5 @@
margin-#{$opposite-direction}: $n-columns * flex-grid(1, $parent-columns) + $n-columns * flex-gutter($parent-columns);
// Reset nesting context
$parent-columns: $grid-columns;
$parent-columns: $grid-columns !global;
}
/// 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.
///
/// @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);
// Set nesting context (used by shift())
$parent-columns: get-parent-columns($container-columns);
$parent-columns: get-parent-columns($container-columns) !global;
$direction: get-direction($layout-direction, $default-layout-direction);
$opposite-direction: get-opposite-direction($direction);
......@@ -11,10 +58,8 @@
$display-table: is-display-table($container-display-table, $display);
@if $display-table {
$padding: get-padding-for-table-layout($columns, $container-columns);
display: table-cell;
padding-#{$direction}: $padding;
width: flex-grid($columns, $container-columns) + $padding;
width: percentage($columns / $container-columns);
} @else {
float: #{$opposite-direction};
......@@ -23,7 +68,7 @@
}
@if $display == collapse {
@warn "The 'collapse' argument will be deprecated. Use 'block-collapse' instead."
@include -neat-warn("The 'collapse' argument will be deprecated. Use 'block-collapse' instead.");
}
@if $display == collapse or $display == block-collapse {
......
@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.";
@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)) {
......@@ -47,11 +47,59 @@
}
@else {
@warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
@include -neat-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 -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;
}
@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: -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(to left, #{$values})");
}
@if $visual-grid == true or $visual-grid == yes {
......@@ -31,7 +30,7 @@
}
@each $breakpoint in $visual-grid-breakpoints {
@if $breakpoint != nil {
@if $breakpoint {
@include media($breakpoint) {
@include grid-column-gradient(gradient-stops($grid-columns));
}
......
/// Disable all deprecation warnings. Defaults to `false`. Set with a `!global` flag.
///
/// @type Bool
$disable-warnings: false !default;
@mixin -neat-warn($message) {
@if $disable-warnings == false {
@warn "#{$message}";
}
}
$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
/// 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 golden-ratio() see [Bourbon docs](http://bourbon.io/docs/#golden-ratio). Set with a `!global` flag.
///
/// @type Number (Unit)
$column: golden-ratio(1em, 3) !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 golden-ratio() see [Bourbon docs](http://bourbon.io/docs/#golden-ratio). Set with the `!global` flag.
///
/// @type Number (Unit)
$gutter: golden-ratio(1em, 1) !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 {
/// -webkit-box-sizing: border-box;
/// -moz-box-sizing: border-box;
/// box-sizing: border-box; }
///
/// *, *:before, *:after {
/// -webkit-box-sizing: inherit;
/// -moz-box-sizing: inherit;
/// 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;
$visual-grid: false !default; // Display the base grid
/// 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;
$visual-grid-index: back !default; // Show grid behind content (back) or overlay it over the content (front)
/// 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;
......@@ -370,7 +370,7 @@
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
@include padding(0.35em, 0.625em, 0.75em, 0.625em);
}
/**
......
#!/usr/bin/env bash
cd `dirname $BASH_SOURCE` && cd ../openassessment/xblock/static
sass --update sass:css --force --style compressed
sass --update sass:css --force --style compressed -I ./sass/vendor/bi-app
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment