Commit 6e3d5568 by Brian Talbot

Merge pull request #7345 from edx/talbs/certs-webview-uicleanup

Certificates: Revising Web Templates + UI for Open edX Use
parents ae5cbf8b 10e9fed6
......@@ -12,23 +12,15 @@ class Migration(DataMigration):
Bootstraps the HTML view template with some default configuration parameters
"""
json_config = """{
{
"default": {
"accomplishment_class_append": "accomplishment--certificate--honorcode",
"certificate_verify_url_prefix": "https://verify-test.edx.org/cert/",
"certificate_verify_url_suffix": "/verify.html",
"company_about_url": "http://www.edx.org/about-us",
"company_courselist_url": "http://www.edx.org/course-list",
"company_careers_url": "http://www.edx.org/jobs",
"company_contact_url": "http://www.edx.org/contact-us",
"accomplishment_class_append": "accomplishment-certificate",
"platform_name": "edX",
"company_privacy_url": "http://www.edx.org/edx-privacy-policy",
"company_tos_url": "http://www.edx.org/edx-terms-service",
"company_verified_certificate_url": "http://www.edx.org/verified-certificate",
"document_script_src_modernizr": "https://verify-test.edx.org/v2/static/js/vendor/modernizr-2.6.2.min.js",
"document_stylesheet_url_normalize": "https://verify-test.edx.org/v2/static/css/vendor/normalize.css",
"document_stylesheet_url_fontawesome": "https://verify-test.edx.org/v2/static/css/vendor/font-awesome.css",
"document_stylesheet_url_application": "https://verify-test.edx.org/v2/static/css/style-application.css",
"logo_src": "https://verify-test.edx.org/v2/static/images/logo-edx.svg",
"document_stylesheet_url_application": "/static/certificates/css/main-ltr.css",
"logo_src": "/static/certificates/images/logo-edx.svg",
"logo_url": "http://www.edx.org"
},
"honor": {
......@@ -41,13 +33,9 @@ class Migration(DataMigration):
},
"xseries": {
"certificate_type": "XSeries",
"document_body_class_append": "is-xseries",
"document_script_src_modernizr": "https://verify-test.edx.org/xseries/static/js/vendor/modernizr-2.6.2.min.js",
"document_stylesheet_url_normalize": "https://verify-test.edx.org/xseries/static/css/vendor/normalize.css",
"document_stylesheet_url_fontawesome": "https://verify-test.edx.org/xseries/static/css/vendor/font-awesome.css",
"document_stylesheet_url_application": "https://verify-test.edx.org/xseries/static/css/style-application.css",
"logo_src": "https://verify-test.edx.org/xseries/static/images/logo-edx.svg"
"document_body_class_append": "is-xseries"
}
}
}"""
orm.CertificateHtmlViewConfiguration.objects.create(
configuration=json_config,
......
......@@ -22,22 +22,13 @@ class CertificateHtmlViewConfigurationFactory(DjangoModelFactory):
enabled = True
configuration = """{
"default": {
"accomplishment_class_append": "accomplishment--certificate--honorcode",
"certificate_verify_url_prefix": "https://verify-test.edx.org/cert/",
"certificate_verify_url_suffix": "/verify.html",
"company_about_url": "http://www.edx.org/about-us",
"company_courselist_url": "http://www.edx.org/course-list",
"company_careers_url": "http://www.edx.org/jobs",
"company_contact_url": "http://www.edx.org/contact-us",
"accomplishment_class_append": "accomplishment-certificate",
"platform_name": "edX",
"company_privacy_url": "http://www.edx.org/edx-privacy-policy",
"company_tos_url": "http://www.edx.org/edx-terms-service",
"company_verified_certificate_url": "http://www.edx.org/verified-certificate",
"document_script_src_modernizr": "https://verify-test.edx.org/v2/static/js/vendor/modernizr-2.6.2.min.js",
"document_stylesheet_url_normalize": "https://verify-test.edx.org/v2/static/css/vendor/normalize.css",
"document_stylesheet_url_fontawesome": "https://verify-test.edx.org/v2/static/css/vendor/font-awesome.css",
"document_stylesheet_url_application": "https://verify-test.edx.org/v2/static/css/style-application.css",
"logo_src": "https://verify-test.edx.org/v2/static/images/logo-edx.svg",
"document_stylesheet_url_application": "/static/certificates/css/main-ltr.css",
"logo_src": "/static/certificates/images/logo-edx.svg",
"logo_url": "http://www.edx.org"
},
"honor": {
......@@ -50,11 +41,6 @@ class CertificateHtmlViewConfigurationFactory(DjangoModelFactory):
},
"xseries": {
"certificate_type": "XSeries",
"document_body_class_append": "is-xseries",
"document_script_src_modernizr": "https://verify-test.edx.org/xseries/static/js/vendor/modernizr-2.6.2.min.js",
"document_stylesheet_url_normalize": "https://verify-test.edx.org/xseries/static/css/vendor/normalize.css",
"document_stylesheet_url_fontawesome": "https://verify-test.edx.org/xseries/static/css/vendor/font-awesome.css",
"document_stylesheet_url_application": "https://verify-test.edx.org/xseries/static/css/style-application.css",
"logo_src": "https://verify-test.edx.org/xseries/static/images/logo-edx.svg"
"document_body_class_append": "is-xseries"
}
}"""
......@@ -241,13 +241,21 @@ def render_html_view(request):
This view generates an HTML representation of the specified student's certificate
If a certificate is not available, we display a "Sorry!" screen instead
"""
# Initialize the template context and bootstrap with default values from configuration
context = {}
configuration = CertificateHtmlViewConfiguration.get_config()
context = configuration.get('default', {})
invalid_template_path = 'certificates/invalid.html'
# Translators: This text is bound to the HTML 'title' element of the page and appears
# in the browser title bar when a requested certificate is not found or recognized
context['document_title'] = _("Invalid Certificate")
# Feature Flag check
if not settings.FEATURES.get('CERTIFICATES_HTML_VIEW', False):
return render_to_response(invalid_template_path)
return render_to_response(invalid_template_path, context)
context = {}
course_id = request.GET.get('course', None)
context['course'] = course_id
if not course_id:
......@@ -271,9 +279,6 @@ def render_html_view(request):
except GeneratedCertificate.DoesNotExist:
return render_to_response(invalid_template_path, context)
# Load static output values from configuration,
configuration = CertificateHtmlViewConfiguration.get_config()
context = configuration.get('default', {})
# Override the defaults with any mode-specific static values
context.update(configuration.get(certificate.mode, {}))
# Override further with any course-specific static values
......
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
// ------------------------------
// Open edX Certificates: Shared Build Compile
@import '../vendor/normalize/normalize';
// ------------------------------
// #UTILITIES
// ------------------------------
@import 'utilities/mixins';
// ------------------------------
// #BASE
// ------------------------------
@import 'base/fonts';
@import 'base/graphics';
@import 'base/anims';
@import 'base/typography';
@import 'base/reset';
// ------------------------------
// #COMPONENTS
// ------------------------------
@import 'components/controls';
@import 'components/navigation';
@import 'components/header';
@import 'components/footer';
// ------------------------------
// #VIEWS
// ------------------------------
@import 'views/certificate';
@import 'views/valid';
@import 'views/invalid';
@import 'views/validate';
// ------------------------------
// #CONTEXTS
// ------------------------------
@import 'contexts/print';
@import 'contexts/ie';
// ------------------------------
// #SHAME
// ------------------------------
@import 'utilities/shame';
// ------------------------------
// Open edX Certificates: Animations
// fade in
@include keyframes(fadeIn) {
0% {
opacity: 0.0;
}
50% {
opacity: 0.5;
}
100% {
opacity: 1.0;
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-fadeIn {
@include animation(fadeIn $tmg-f2 linear 1);
}
// fade in + up
@include keyframes(fadeInUp) {
0% {
opacity: 0;
transform: translateY($baseline-v);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-fadeIn {
@include animation(fadeInUp $tmg-f2 linear 1);
}
// fade in + down
@include keyframes(fadeInDown) {
0% {
opacity: 0;
transform: translateY(-($baseline-v));
}
100% {
opacity: 1;
transform: translateY(0);
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-fadeInDown {
@include animation(fadeInDown $tmg-f2 linear 1);
}
// fade out
@include keyframes(fadeOut) {
0% {
opacity: 1.0;
}
50% {
opacity: 0.5;
}
100% {
opacity: 0.0;
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-fadeOut {
@include animation(fadeOut $tmg-f2 linear 1);
}
// canned animation - use if you want out of the box/non-customized anim
%anim-slideOutUp {
@include animation(slideOutUp $tmg-f2 linear 1);
}
// rotate up
@include keyframes(rotateUp) {
0% {
@include transform(rotate(0deg));
}
50% {
@include transform(rotate(-90deg));
}
100% {
@include transform(rotate(-180deg));
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-rotateUp {
@include animation(rotateUp $tmg-f2 ease-in-out 1);
}
// rotate down
@include keyframes(rotateDown) {
0% {
@include transform(rotate(0deg));
}
50% {
@include transform(rotate(90deg));
}
100% {
@include transform(rotate(180deg));
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-rotateDown {
@include animation(rotateDown $tmg-f2 ease-in-out 1);
}
// rotate clockwise
@include keyframes(rotateCW) {
0% {
@include transform(rotate(0deg));
}
50% {
@include transform(rotate(180deg));
}
100% {
@include transform(rotate(360deg));
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-rotateCW {
@include animation(rotateCW $tmg-s1 linear infinite);
}
// rotate counter-clockwise
@include keyframes(rotateCCW) {
0% {
@include transform(rotate(0deg));
}
50% {
@include transform(rotate(-180deg));
}
100% {
@include transform(rotate(-360deg));
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-rotateCCW {
@include animation(rotateCCW $tmg-s1 linear infinite);
}
// bounce in
@include keyframes(bounceIn) {
0% {
opacity: 0.0;
@include transform(scale(0.3));
}
50% {
opacity: 1.0;
@include transform(scale(1.05));
}
100% {
@include transform(scale(1));
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-bounceIn {
@include animation(bounceIn $tmg-f1 ease-in-out 1);
}
// bounce out
@include keyframes(bounceOut) {
0% {
@include transform(scale(1));
}
50% {
opacity: 1.0;
@include transform(scale(1.05));
}
100% {
opacity: 0.0;
@include transform(scale(0.3));
}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-bounceOut {
@include animation(bounceOut $tmg-f1 ease-in-out 1);
}
// flash
@include keyframes(flash) {
0%, 50%, 100% {opacity: 1.0;}
25%, 75% {opacity: 0;}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-flash {
@include animation(flash $tmg-f1 ease-in-out 1);
}
// shake
@include keyframes(shake) {
0%, 100% {transform: translateX(0);}
10%, 30%, 50%, 70%, 90% {transform: translateX(-($baseline-h/2));}
20%, 40%, 60%, 80% {transform: translateX(($baseline-h/2));}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-shake {
@include animation(shake $tmg-f1 ease-in-out 1);
}
// bounce
@include keyframes(bounce) {
0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
40% {transform: translateY(($baseline-v*1.5));}
60% {transform: translateY(($baseline-v*0.75));}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-shake {
@include animation(shake $tmg-f1 ease-in-out 1);
}
// bounce
@include keyframes(bounce) {
0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
40% {transform: translateY(($baseline-v*1.5));}
60% {transform: translateY(($baseline-v*0.75));}
}
// canned animation - use if you want out of the box/non-customized anim
%anim-shake {
@include animation(shake $tmg-f1 ease-in-out 1);
}
// ------------------------------
// Open edX Certificates: Fonts
// Open Sans (within the LMS at large)
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-Light-webfont', 300, $file-formats: eot woff ttf svg);
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-LightItalic-webfont', 300, italic, $file-formats: eot woff ttf svg);
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-Regular-webfont', 400, $file-formats: eot woff ttf svg);
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-Italic-webfont', 400, italic, $file-formats: eot woff ttf svg);
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-Semibold-webfont', 600, $file-formats: eot woff ttf svg);
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-SemiboldItalic-webfont', 600, italic, $file-formats: eot woff ttf svg);
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-Bold-webfont', 700, $file-formats: eot woff ttf svg);
@include font-face('Open Sans', '../../fonts/OpenSans/OpenSans-BoldItalic-webfont', 700, italic, $file-formats: eot woff ttf svg);
// ------------------------------
// Open edX Certificates: Graphics
// sprites, background images, decorative elements are placed/defined here
// ------------------------------
// Open edX Certificates: Reset
html, body {
height: 100%;
}
html {
font-size: 62.5%;
overflow-y: scroll;
}
body {
@extend %t-copy-base;
}
[class^="wrapper-"] {
@extend %wrapper !optional;
padding: 0;
}
.sr, hr.divider {
@extend %ui-text-sr;
}
.wrapper-view {
background: $bg-view;
}
[class^="content-"]{
a {
@extend %link-copy;
}
}
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
@extend %t-weight1;
margin: 0;
padding: 0;
border: 0;
outline: 0;
vertical-align: baseline;
}
abbr[title] {
border-bottom: none;
text-decoration: none;
cursor: help;
}
strong {
@extend %t-weight3;
}
// reset: lists
.list-actions,
.list-docs,
.list-steps,
.list-controls,
.list-fields,
.list-help,
.nav-wizard,
.list-tips,
.field-group {
@extend %ui-no-list;
}
// ------------------------------
// Open edX Certificates: Typogrpahy
// misc
%t-weight0 {
font-weight: 300;
}
%t-weight1 {
font-weight: 400;
}
%t-weight2 {
font-weight: 500;
}
%t-weight3 {
font-weight: 600;
}
%t-weight4 {
font-weight: 700;
}
// headings/titles
%t-title-1, %t-title-2, %t-title-3, %t-title-4, %t-title-5, %t-title-5, %t-title-6, %t-title-7, %t-title-8, %t-title-9 {
font-family: $f-sans-serif;
}
%t-title-0 {
@include font-size(72);
@include lh(72);
}
%t-title-1 {
@include font-size(60);
@include lh(60);
}
%t-title-2 {
@include font-size(48);
@include lh(48);
}
%t-title-3 {
@include font-size(36);
@include lh(36);
}
%t-title-4 {
@include font-size(24);
@include lh(24);
}
%t-title-5 {
@include font-size(20);
@include lh(20);
}
%t-title-6 {
@include font-size(18);
@include lh(18);
}
%t-title-7 {
@include font-size(16);
@include lh(16);
}
%t-title-8 {
@include font-size(14);
@include lh(14);
}
%t-title-9 {
@include font-size(12);
@include lh(12);
}
%t-title-10 {
@include font-size(10);
@include lh(10);
}
// copy
%t-copy {
font-family: $f-sans-serif;
}
%t-copy-base {
@extend %t-copy;
@include font-size(16);
@include lh(16);
}
%t-copy-lead1 {
@extend %t-copy;
@include font-size(18);
@include lh(18);
}
%t-copy-lead2 {
@extend %t-copy;
@include font-size(20);
@include lh(20);
}
%t-copy-lead3 {
@extend %t-copy;
@include font-size(24);
@include lh(24);
}
%t-copy-sub1 {
@extend %t-copy;
@include font-size(14);
@include lh(14);
}
%t-copy-sub2 {
@extend %t-copy;
@include font-size(12);
@include lh(12);
}
%t-copy-sub3 {
@extend %t-copy;
@include font-size(10);
@include lh(10);
}
// code
%t-code {
font-family: $f-monospace;
}
// actions/labels
%t-action1 {
@include font-size(24);
@include lh(24);
}
%t-action2 {
@include font-size(18);
@include lh(18);
}
%t-action3 {
@include font-size(16);
@include lh(16);
}
%t-action4 {
@include font-size(14);
@include lh(14);
}
%t-action5 {
@include font-size(12);
@include lh(12);
}
// icons
%t-icon {
}
%t-icon-s {
@extend %t-icon !optional;
@include font-size(12);
}
%t-icon-m {
@extend %t-icon !optional;
@include font-size(16);
}
%t-icon-l {
@extend %t-icon !optional;
@include font-size(24);
}
%t-icon-xl {
@extend %t-icon !optional;
@include font-size(36);
}
// ------------------------------
// Open edX Certificates: Controls
// archetype: buttons
%btn {
@include transition(color 0.25s ease-in-out, background 0.25s ease-in-out, box-shadow 0.25s ease-in-out);
box-sizing: border-box;
display: inline-block;
cursor: pointer;
text-decoration: none;
&:hover, &:active, &:focus {
text-decoration: none;
}
&.disabled, &[disabled] {
cursor: default;
pointer-events: none;
}
}
%btn-pill {
@extend %btn;
border-radius: $baseline-v/5;
}
%btn-rounded {
@extend %btn;
border-radius: ($baseline-v/2);
}
%btn-edged {
@extend %btn;
border-radius: ($baseline-v/10);
}
// primary button
%btn-primary {
@extend %btn-edged;
@extend %t-weight3;
padding: ($baseline-v/2) ($baseline-h);
background: $bg-action-primary;
border-color: $bordercolor-action-primary;
color: $color-action-primary;
&:hover, &:active, &:focus {
background: $bg-action-primary-focus;
border-color: $bordercolor-action-primary-focus;
color: $color-action-primary-focus
}
&.current, &.active {
&:hover, &:active, &:focus {
}
}
&.disabled, &.is-disabled, &[disabled] {
opacity: 0.5;
}
}
// primary button
%btn-secondary {
@extend %btn-edged;
@extend %t-weight3;
padding: ($baseline-v/2) ($baseline-h);
background: $bg-action-secondary;
border-color: $bordercolor-action-secondary;
color: $color-action-secondary;
&:hover, &:active, &:focus {
background: $bg-action-secondary-focus;
border-color: $bordercolor-action-secondary-focus;
color: $color-action-secondary-focus
}
&.current, &.active {
&:hover, &:active, &:focus {
}
}
&.disabled, &.is-disabled, &[disabled] {
opacity: 0.5;
}
}
// links - subtle
%link-subtle {
@include transition(color $tmg-f1 ease-in-out);
color: $color-link;
text-decoration: none;
&:hover, &:focus, &:active {
color: $color-link-focus;
}
}
// links - copy
%link-copy {
@include transition(color $tmg-f1 ease-in-out, border $tmg-f1 ease-in-out);
border-bottom: 1px solid transparent;
color: $color-link;
text-decoration: none;
&:hover, &:focus, &:active {
color: $color-link-focus;
border-color: $color-link-focus;
}
}
// ------------------------------
// Open edX Certificates: Footer
.wrapper-footer {
padding: 0 ($baseline-h*2);
background: $bg-footer-main;
color: $color-footer-main;
@include media($bp-medium) {
padding: 0 ($baseline-h);
}
@include media($bp-small) {
padding: 0 ($baseline-h);
}
}
.footer-app {
@include outer-container;
border-top: 2px solid $gray-l5;
margin-top: $baseline-v;
padding-top: $baseline-v;
a {
@extend %link-copy;
}
}
.footer-app-copyright {
@extend %t-copy-sub1;
@include span-columns(4 of 12);
@include media($bp-large) {
@include fill-parent;
margin-bottom: ($baseline-v);
}
@include media($bp-medium) {
@include fill-parent;
margin-bottom: ($baseline-v);
}
@include media($bp-small) {
@include fill-parent;
margin-bottom: ($baseline-v);
}
}
.footer-app-nav {
@include span-columns(8 of 12);
@include omega();
@include text-align(right);
@include media($bp-large) {
@include fill-parent;
@include text-align(left);
}
@include media($bp-medium) {
@include fill-parent;
@include text-align(left);
}
@include media($bp-small) {
@include fill-parent;
@include text-align(left);
}
.list {
display: inline-block;
vertical-align: middle;
@include margin-right($baseline-h*2);
&:last-child {
@include margin-right(0);
}
@include media($bp-large) {
@include fill-parent;
margin: 0 0 $baseline-v 0;
@include text-align(left);
}
@include media($bp-medium) {
@include fill-parent;
margin: 0 0 $baseline-v 0;
@include text-align(left);
}
@include media($bp-small) {
@include fill-parent;
margin: 0 0 $baseline-v 0;
@include text-align(left); }
}
.nav-item {
@extend %t-action5;
display: inline-block;
@include margin-right($baseline-h/2);
@include media($bp-large) {
@include font-size(14);
@include lh(14);
}
@include media($bp-medium) {
@include font-size(14);
@include lh(14);
display: block;
margin: 0 0 ($baseline-v/4) 0;
}
@include media($bp-small) {
@include font-size(14);
@include lh(14);
display: block;
margin: 0 0 ($baseline-v/4) 0;
}
}
}
// ------------------------------
// Open edX Certificates: Header
// grid/layout
.wrapper-header {
@extend %ui-shadow-subtle-down;
margin-bottom: ($baseline-v*2);
padding: ($baseline-v) ($baseline-h*2);
background: $white-t;
color: $black;
@include media($bp-medium) {
padding: ($baseline-v) ($baseline-h);
}
@include media($bp-small) {
padding: ($baseline-v) ($baseline-h);
}
}
.header-app {
@include outer-container;
}
// masthead
.title-logo {
text-align: center;
.logo {
display: inline-block;
vertical-align: middle;
@include margin-right($baseline-h);
}
.title-sub {
@extend %ui-text-sr;
@extend %t-title-5;
display: inline-block;
vertical-align: middle;
text-transform: uppercase;
letter-spacing: 0.1rem;
}
}
// ------------------------------
// Open edX Certificates: Navigation
// general
%nav {
ol, ul {
@extend %no-list !optional;
}
.nav-item {
.action {
}
}
}
// archetype: nav - horizontal
%nav-inline {
@extend %nav !optional;
.nav-item, .item {
display: inline-block;
vertical-align: middle;
.action {
}
}
}
// archetype: nav - vertical
%nav-blocks {
@extend %nav !optional;
.nav-item {
display: block;
.action {
}
}
}
// archetype: nav - tabs
%nav-tabs {
@extend %nav !optional;
.nav-item {
.action {
}
}
}
// archetype: nav - pagination
%nav-pagination {
@extend %nav !optional;
.nav-item {
.action {
}
}
}
// archetype: nav - dropdown
%nav-dropdown {
@extend %nav !optional;
.nav-item {
.action {
}
}
}
// ====================
// application: secondary navigation
%nav-secondary {
.nav-item {
.action {
}
}
&.horizontal {
}
&.vertical {
}
}
// ------------------------------
// Open edX Certificates: IE-Specific Styling
// less than IE10
.lt-ie10 {
}
// less than IE9
.lt-ie9 {
}
// less than IE8
.lt-ie8 {
}
// less than IE7
.lt-ie7 {
}
// ------------------------------
// Open edX Certificates: Print-Specific Styling
// print - general
@include media(print) {
}
// print - portrait
@include media(print orientation portrait) {
}
// print - landscape
@include media(print orientation landscape) {
}
// print - color
@include media(print color) {
}
// print - monochrome
@include media(print monochrome) {
}
// ------------------------------
// Open edX Certificates: Main Style Compile (LTR)
// About: Sass compile for Open edX certificates. This does not contain styles for other Open edX products/experiences (e.g. account/onboarding).
// ------------------------------
// #VENDOR
// ------------------------------
@import '../vendor/bourbon/bourbon';
@import '../vendor/neat/neat';
@import '../vendor/bi-app/bi-app-ltr'; // LTR support
// ------------------------------
// #UTILITIES
// ------------------------------
@import 'utilities/variables';
@import 'build';
// ------------------------------
// Open edX Certificates: Main Style Compile (RTL)
// About: Sass compile for Open edX certificates. This does not contain styles for other Open edX products/experiences (e.g. account/onboarding).
// ------------------------------
// #VENDOR
// ------------------------------
@import '../vendor/bourbon/bourbon';
@import '../vendor/neat/neat';
@import '../vendor/bi-app/bi-app-rtl'; // RTL support
// ------------------------------
// #UTILITIES
// ------------------------------
@import 'utilities/variables';
@import 'utilities/variables-rtl';
@import 'build';
// ------------------------------
// Open edX Certificates: Mixins
// utility - font sizing
@mixin font-size($sizeValue: 16){
font-size: $sizeValue + px;
font-size: ($sizeValue/10) + rem;
}
// utility - line height
@mixin lh($fontSize: auto){
line-height: ($fontSize*1.55) + px;
line-height: (($fontSize/10)*1.55) + rem;
}
// utility - nth-type style clearing
%wipe-first-child {
&:first-child {
margin-top: 0;
@include margin-left(0);
border: none;
padding-top: 0;
@include padding-left(0);
}
}
// utility - nth-type style clearing
%wipe-last-child {
&:last-child {
margin-bottom: 0;
@include margin-left(0);
border: none;
padding-bottom: 0;
@include padding-right(0);
}
}
// UI - wrapper elements
%ui-wrapper {
@include clearfix();
box-sizing: border-box;
width: 100%;
}
// UI - lists
%ui-no-list {
list-style: none;
margin: 0;
padding: 0;
text-indent: 0;
li, dt, dd {
margin: 0;
padding: 0;
}
}
// UI - image-replacement hidden text
%ui-text-hide {
text-indent: 200%;
white-space: nowrap;
overflow: hidden;
}
// UI - hidden elements for screenreaders
%ui-text-sr {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
// UI - text-wrapping
%ui-text-wrap {
text-wrap: wrap;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
word-wrap: break-word;
}
// UI - controls
%ui-fake-link {
cursor: pointer;
}
%ui-disabled {
pointer-events: none;
outline: none;
}
// UI - depth levels
%ui-depth0 { z-index: 0; }
%ui-depth1 { z-index: 10; }
%ui-depth2 { z-index: 100; }
%ui-depth3 { z-index: 1000; }
%ui-depth4 { z-index: 10000; }
%ui-depth5 { z-index: 100000; }
// UI - transitions
%trans-size {
@include transition(width 0.25s ease-in-out, height 0.25s ease-in-out);
}
%trans-color {
@include transition(color 0.25s ease-in-out);
}
// UI - cosmetics - shadows
%ui-shadow-up {
box-shadow: 0 -2px 2px 0 $shadow-d1;
}
%ui-shadow-down {
box-shadow: 0 2px 2px 0 $shadow-d1;
}
%ui-shadow-subtle-up {
box-shadow: 0 -2px 2px 0 $shadow-l1;
}
%ui-shadow-subtle-down {
box-shadow: 0 2px 2px 0 $shadow-l1;
}
// ------------------------------
// Open edX Certificates: Shame Styles
// About: used for any bad-form/orphaned scss that knowingly violate edX FED architecture/standards (http://csswizardry.com/2013/04/shame-css)
// ------------------------------
// Open edX Certificates: Variables (RTL)
// grid
$default-layout-direction: RTL !global;
// ------------------------------
// Open edX Certificates: Variables (LTR)
// units
$baseline-v: 20px; // vertical baseline
$baseline-h: 20px; // horizontal baseline
// colors - basic
$black: rgb(10,10,10); // system black
$black-t: rgb(0,0,0);
$black-t0: rgba($black,0.125);
$black-t1: rgba($black,0.25);
$black-t2: rgba($black,0.50);
$black-t3: rgba($black,0.75);
$white: rgb(250,250,250); // system white
$white-t: rgb(255,255,255);
$white-t0: rgba($white,0.125);
$white-t1: rgba($white,0.25);
$white-t2: rgba($white,0.50);
$white-t3: rgba($white,0.75);
$gray: rgb(53, 58, 61);
$gray-l1: tint($gray,20%);
$gray-l2: tint($gray,40%);
$gray-l3: tint($gray,60%);
$gray-l4: tint($gray,80%);
$gray-l5: tint($gray,90%);
$gray-l6: tint($gray,95%);
$gray-d1: shade($gray,20%);
$gray-d2: shade($gray,40%);
$gray-d3: shade($gray,60%);
$gray-d4: shade($gray,80%);
$gray-d5: shade($gray,90%);
$gray-d6: shade($gray,95%);
$gray-t0: rgba($gray,0.125);
$gray-t1: rgba($gray,0.25);
$gray-t2: rgba($gray,0.50);
$gray-t3: rgba($gray,0.75);
// shadows
$shadow: rgba($black-t,0.2);
$shadow-l1: rgba($black-t,0.1);
$shadow-l2: rgba($black-t,0.05);
$shadow-d1: rgba($black-t,0.4);
$shadow-d2: rgba($black-t,0.6);
// colors - default
$blue: rgb(58, 162, 224);
$blue-l1: tint($blue,20%);
$blue-l2: tint($blue,40%);
$blue-l3: tint($blue,60%);
$blue-l4: tint($blue,80%);
$blue-l5: tint($blue,90%);
$blue-d1: shade($blue,20%);
$blue-d2: shade($blue,40%);
$blue-d3: shade($blue,60%);
$blue-d4: shade($blue,80%);
$blue-d5: shade($blue,90%);
$blue-s1: saturate($blue,15%);
$blue-s2: saturate($blue,30%);
$blue-s3: saturate($blue,45%);
$blue-u1: desaturate($blue,15%);
$blue-u2: desaturate($blue,30%);
$blue-u3: desaturate($blue,45%);
$blue-t0: rgba($blue,0.125);
$blue-t1: rgba($blue,0.25);
$blue-t2: rgba($blue,0.50);
$blue-t3: rgba($blue,0.75);
$pink: rgb(182,37,104);
$pink-l1: tint($pink,20%);
$pink-l2: tint($pink,40%);
$pink-l3: tint($pink,60%);
$pink-l4: tint($pink,80%);
$pink-l5: tint($pink,90%);
$pink-d1: shade($pink,20%);
$pink-d2: shade($pink,40%);
$pink-d3: shade($pink,60%);
$pink-d4: shade($pink,80%);
$pink-d5: shade($pink,90%);
$pink-s1: saturate($pink,15%);
$pink-s2: saturate($pink,30%);
$pink-s3: saturate($pink,45%);
$pink-u1: desaturate($pink,15%);
$pink-u2: desaturate($pink,30%);
$pink-u3: desaturate($pink,45%);
$pink-t0: rgba($pink,0.125);
$pink-t1: rgba($pink,0.25);
$pink-t2: rgba($pink,0.50);
$pink-t3: rgba($pink,0.75);
// colors - achievement branding
$color-basic-achievement: $blue-l2;
$color-greater-achievement: $blue;
$color-greatest-achievement: $blue-s1;
// fonts
$f-serif: 'PT Serif', Cambria, Georgia, 'Times New Roman', Times, serif;
$f-sans-serif: 'Open Sans','Helvetica Neue', Helvetica, Arial, sans-serif;
$f-monospace: 'Bitstream Vera Sans Mono', Consolas, Courier, monospace;
// grid
@import "neat/neat-helpers";
$default-layout-direction: LTR !global;
$max-width: 1280px;
$grid-columns: 12; // make grid 12 columns
$column: ($baseline-v*4.25); // columns
$gutter: $baseline-v; // gutter b/t columns
// grid (neat-based) - responsive
$bp-small: new-breakpoint(max-width 499px 4); // mobile devices - make grid 4 columns
$bp-medium: new-breakpoint(min-width 500px max-width 759px 6); // small displays - make grid 6 columns
$bp-large: new-breakpoint(min-width 760px max-width 899px 12); // medium displays - make grid 12 columns
$bp-xlarge: new-breakpoint(min-width 900px 12); // large displays - make grid 12 columns
// timing - used for animation/transition mixin syncing
$tmg-s3: 3.0s;
$tmg-s2: 2.0s;
$tmg-s1: 1.0s;
$tmg-avg: 0.75s;
$tmg-f1: 0.50s;
$tmg-f2: 0.25s;
$tmg-f3: 0.125s;
// application: general actions
$color-primary: $blue-d1;
$color-secondary: $blue-l1;
$color-tertiary: $gray-l1;
$color-quarternary: $gray-l2;
// application: general links
$color-link: $blue-d1;
$color-link-focus: $blue;
$color-link-active: $blue;
$color-link-visited: $blue-d2;
// application: actions & links (button-focused)
$bg-action-primary: $color-primary;
$bg-action-primary-focus: saturate($color-primary, 35%);
$bordercolor-action-primary: saturate($color-primary, 15%);
$bordercolor-action-primary-focus: saturate($color-primary, 35%);
$color-action-primary: tint($color-primary, 90%);
$color-action-primary-focus: tint($color-primary, 95%);
$bg-action-secondary: $color-secondary;
$bg-action-secondary-focus: saturate($color-secondary, 35%);
$bordercolor-action-secondary: saturate($color-secondary, 15%);
$bordercolor-action-secondary-focus: saturate($color-secondary, 35%);
$color-action-secondary: tint($color-secondary, 90%);
$color-action-secondary-focus: tint($color-secondary, 95%);
// application: copy & headings
$color-heading: $gray-d3;
$color-heading-secondary: $gray-d1;
$color-heading-tertiary: $gray;
$color-copy: $gray-l1;
$color-copy-lead: $gray-d2;
$color-copy-supplemental: $gray-l1;
// application: states
$bg-selected: $blue-t1;
$color-selected: $blue-s1;
// application: view elements
$bg-view: $gray-l6;
$bg-header-main: $white;
$color-header-main: $black;
$bg-content: $gray-l6;
$color-content: $gray-d1;
$bg-content-main: $gray-l5;
$color-content-main: $gray-d1;
$bg-footer-main: transparent;
$color-footer-main: $gray;
// ------------------------------
// Open edX Certificates: General Certificate/Achievement View
.view-certificate {
background: $bg-view;
// layout
.wrapper-view {
background: transparent url('../images/bg-paperfibers.png') 0 0 repeat-both;
padding-bottom: ($baseline-v*3);
@include media($bp-medium) {
padding-bottom: $baseline-h;
}
@include media($bp-small) {
padding-bottom: $baseline-h;
}
}
.wrapper-content {
padding: $baseline-v ($baseline-h*2);
@include media($bp-medium) {
padding: $baseline-v $baseline-h;
}
@include media($bp-small) {
padding: $baseline-v $baseline-h;
}
}
.content {
@include outer-container;
a {
@extend %link-copy;
}
}
// status
.status {
@include row();
padding: $baseline-v ($baseline-h*2);
border-top-radius: ($baseline-v/10);
box-shadow: inset 0 -2px 2px 0 $shadow-l2;
background: $gray-l4;
color: $white-t;
text-transform: uppercase;
letter-spacing: 0.1rem;
@include media($bp-medium) {
padding: ($baseline-v) ($baseline-h);
}
@include media($bp-small) {
padding: ($baseline-v) ($baseline-h);
}
.title {
@extend %t-title-6;
@include text-align(left);
@include media($bp-xlarge) {
@include span-columns(9 of 12);
}
@include media($bp-large) {
@include span-columns(9 of 12);
}
@include media($bp-medium) {
@include font-size(14); // can't use %t-title-8 for some reason
@include lh(14);
}
@include media($bp-small) {
@include font-size(14); // can't use %t-title-8 for some reason
@include lh(14);
}
}
}
// TODO - Determine what basic types are supported
// CASE: honor code
&.is-honorcode {
.status {
background: $color-basic-achievement;
}
.certificate-type {
color: $color-basic-achievement;
}
}
// CASE: verified
&.is-idverified {
.status {
background: $color-greater-achievement;
}
.accomplishment {
background: $white-t url("../images/logo-idverified-cropped.png") bottom left no-repeat;
background-size: 75%;
@include media($bp-medium) {
background-size: 75%;
}
@include media($bp-small) {
background-size: 100%;
}
}
.certificate-type {
color: $color-greater-achievement;
.wrapper-img {
width: 200px;
border-radius: ($baseline-h*10);
padding: ($baseline-v/2) ($baseline-h/2);
background: $white-t;
margin: -($baseline-v*4) auto 0 auto;
@include media($bp-large) {
float: right;
margin: 0 0 $baseline-h $baseline-h;
}
@include media($bp-medium) {
width: 150px;
float: right;
margin: 0 0 $baseline-h $baseline-h;
}
@include media($bp-small) {
width: 100px;
float: right;
margin: 0;
}
img {
@include fill-parent();
}
}
}
}
}
// ------------------------------
// Open edX Certificates: Invalid Certificate/Achievement View
.view-invalid-certificate {
// accomplishment
.feedback {
@extend %ui-shadow-subtle-down;
@extend %trans-size;
@include clearfix();
@include row();
@include pad(($baseline-v*2) ($baseline-h*2) ($baseline-v*3) ($baseline-h*2));
margin-bottom: ($baseline-v*2);
border-radius: ($baseline-v/10);
border: 1px solid $gray-l5;
background: $white-t;
@include media($bp-medium) {
padding: ($baseline-v) ($baseline-h);
}
@include media($bp-small) {
padding: ($baseline-v) ($baseline-h);
}
}
.feedback-lead {
margin-bottom: ($baseline-v);
padding-bottom: ($baseline-v);
border-bottom: 1px solid $gray-l5;
.title {
@extend %t-title-3;
@extend %t-weight3;
margin-bottom: ($baseline-v/2);
}
.copy {
@extend %t-copy-lead2;
color: $pink;
}
}
.feedback-support {
@include span-columns(6 of 12);
margin-bottom: $baseline-v;
@include media($bp-medium) {
@include fill-parent;
}
@include media($bp-small) {
@include fill-parent;
}
.title {
@extend %t-title-6;
@extend %t-weight3;
margin-bottom: ($baseline-v/2);
}
.copy {
color: $gray-l2;
}
}
.feedback-warning {
@include span-columns(6 of 12);
@include omega();
@include media($bp-medium) {
@include fill-parent;
}
@include media($bp-small) {
@include fill-parent;
}
.title {
@extend %t-title-6;
@extend %t-weight3;
margin-bottom: ($baseline-v/2);
}
.copy {
color: $gray-l2;
}
}
}
// ------------------------------
// Open edX Certificates: Valid Certificate/Achievement View
.view-valid-certificate {
// accomplishment
.accomplishment {
@extend %ui-shadow-subtle-down;
@extend %trans-size;
@include clearfix();
@include pad(($baseline-v*2) ($baseline-h*2) ($baseline-v*3) ($baseline-h*2));
margin-bottom: ($baseline-v*2);
border-radius: ($baseline-v/10);
border: 1px solid $gray-l5;
background: $white-t;
@include media($bp-medium) {
padding: ($baseline-v) ($baseline-h);
}
@include media($bp-small) {
padding: ($baseline-v) ($baseline-h);
}
}
// statement
.accomplishment-statement {
@extend %trans-size;
@include span-columns(8 of 12);
@include padding-right($baseline-h);
@include border-right(1px solid $gray-l5);
@include media($bp-large) {
@include fill-parent;
@include padding-right(0);
@include border-right(none);
}
@include media($bp-medium) {
@include fill-parent;
@include padding-right(0);
@include border-right(none);
}
@include media($bp-small) {
@include fill-parent;
@include padding-right(0);
@include border-right(none);
}
[class^="copy-"] {
display: block;
margin-bottom: ($baseline-v);
}
.copy-name {
@extend %t-title-2;
@extend %t-weight3;
@include media($bp-medium) {
@include font-size(36); // can't use %t-title-4 for some reason
@include lh(36);
margin: ($baseline-v/2) 0 ($baseline-v/4) 0;
}
@include media($bp-small) {
@include font-size(24);
@include lh(24);
margin: ($baseline-v/2) 0 ($baseline-v/4) 0;
}
}
.copy-course-org {
@extend %t-title-5;
@extend %t-weight2;
margin-bottom: 0;
@include media($bp-medium) {
margin: ($baseline-v/2) 0 0 0;
}
@include media($bp-small) {
margin: ($baseline-v/2) 0 0 0;
}
}
.copy-course {
@include media($bp-medium) {
margin-bottom: ($baseline-v/4);
}
@include media($bp-small) {
margin-bottom: ($baseline-v/4);
}
}
.copy-course-name {
@extend %t-title-2;
@extend %t-weight3;
@include lh(36);
@include media($bp-medium) {
@include font-size(36); // can't use %t-title-4 for some reason
@include lh(36);
margin: 0;
}
@include media($bp-small) {
@include font-size(24); // can't use %t-title-4 for some reason
@include lh(24);
margin: 0;
}
}
.copy-recogniton {
@extend %t-title-2;
}
.copy-context {
@extend %t-copy-lead2;
color: $gray-l2;
@include media($bp-medium) {
@include font-size(16); // can't use %t-copy-base for some reason
@include lh(16);
}
@include media($bp-small) {
@include font-size(16); // can't use %t-copy-base for some reason
@include lh(16);
}
}
}
// metadata around accomplishment
.accomplishment-details {
@extend %trans-size;
@include span-columns(4 of 12);
@include media($bp-large) {
@include fill-parent;
margin-top: ($baseline-v);
padding-top: ($baseline-v*2);
border-top: 1px solid $gray-l5;
}
@include media($bp-medium) {
@include fill-parent;
}
@include media($bp-small) {
@include fill-parent;
}
.list-metadata {
@extend %ui-no-list;
.item {
@extend %wipe-last-child;
margin-bottom: ($baseline-v);
padding-bottom: ($baseline-v);
border-bottom: 1px solid $gray-l5;
}
}
.label {
@extend %t-copy-sub2;
@extend %t-weight3;
display: block;
margin-bottom: ($baseline-v/4);
text-transform: uppercase;
color: $gray-l3;
letter-spacing: 0.1rem;
}
.value {
@extend %t-title-6;
@extend %t-weight2;
display: block;
}
.explanation {
@extend %t-copy-sub1;
display: block;
margin-top: ($baseline-v/2);
color: $gray-l3;
}
// specific metadata
.certificate-type {
text-transform: uppercase;
letter-spacing: 0.1rem;
.explanation {
text-transform: none;
letter-spacing: 0;
}
}
.certificate-id {
.value {
word-wrap: break-word;
}
}
}
}
// ------------------------------
// Open edX Certificates: DIY Validation Instructions View
.view-validate-certificate {
// general
.content {
.title-lvl1 {
@extend %t-title-3;
@extend %t-weight3;
margin-bottom: $baseline-v;
}
.title-lvl2 {
@extend %t-title-5;
@extend %t-weight3;
margin-bottom: ($baseline-v/2);
}
.title-lvl3 {
@extend %t-title-6;
@extend %t-weight3;
margin-bottom: ($baseline-v/2);
}
.title-lvl4 {
}
}
// ====================
// introduction
.introduction {
@include span-columns(8 of 12);
@include shift(2);
margin-bottom: ($baseline-v*2);
@include media($bp-large) {
@include fill-parent();
@include shift(0);
}
@include media($bp-medium) {
@include fill-parent();
@include shift(0);
}
@include media($bp-small) {
@include fill-parent();
@include shift(0);
}
}
// requirements
.requirements {
@include span-columns(8 of 12);
@include shift(2);
margin-bottom: ($baseline-v*2);
@include media($bp-large) {
@include fill-parent();
@include shift(0);
}
@include media($bp-medium) {
@include fill-parent();
@include shift(0);
}
@include media($bp-small) {
@include fill-parent();
@include shift(0);
}
}
.list-requirements {
@extend %ui-no-list;
@include fill-parent();
counter-reset: instructions-counter;
margin: $baseline-v 0;
.item {
@extend %t-copy-base;
@include span-columns(4 of 8);
@include omega(2n);
min-height: ($baseline-v*8);
margin-bottom: $baseline-v;
border-radius: ($baseline-v/10);
border-top: 4px solid $blue-s1;
padding: ($baseline-v) ($baseline-h);
color: $gray-l1;
background: $gray-l5;
@include media($bp-large) {
}
@include media($bp-medium) {
@include fill-parent();
min-height: 0;
}
@include media($bp-small) {
@include fill-parent();
min-height: 0;
}
&:before {
@extend %t-title-6;
@extend %t-weight3;
content: counter(instructions-counter);
counter-increment: instructions-counter;
display: inline-block;
vertical-align: top;
max-width: 10%;
@include margin-right($baseline-h/2);
color: $gray-l3;
}
.requirement-label {
@extend %t-title-6;
@extend %t-weight3;
display: inline-block;
vertical-align: top;
margin-bottom: ($baseline-v/4);
max-width: 85%;
color: $gray-d4;
}
.requirement-details {
display: block;
@include media($bp-small) {
@include font-size(14); // can't use %t-copy-base for some reason
@include lh(14);
}
}
}
.requirement-allitems {
border-top-color: $pink;
}
}
// ====================
// instructions
.instructions {
@extend %ui-shadow-subtle-down;
@include span-columns(8 of 12);
@include shift(2);
@include pad($baseline-v $baseline-h);
margin-bottom: ($baseline-v*2);
border-radius: ($baseline-v/10);
border: 1px solid $gray-l5;
background: $white-t;
@include media($bp-large) {
@include fill-parent();
@include shift(0);
}
@include media($bp-medium) {
@include fill-parent();
@include shift(0);
}
@include media($bp-small) {
@include fill-parent();
@include shift(0);
}
.title {
@extend %t-title-2;
@extend %t-weight3;
margin-bottom: $baseline-v;
padding-bottom: ($baseline-v/2);
border-bottom: 3px solid $gray-l5;
}
}
.list-instructions {
@extend %ui-no-list;
counter-reset: instructions-counter;
.item {
@extend %t-copy-base;
@extend %wipe-last-child;
display: block;
margin-bottom: $baseline-v;
padding-bottom: $baseline-v;
border-bottom: 1px solid $gray-l5;
color: $gray-l1;
@include media($bp-small) {
@include font-size(16); // can't use %t-copy-base for some reason
@include lh(16);
}
&:before {
@extend %t-title-6;
@extend %t-weight4;
content: counter(instructions-counter);
counter-increment: instructions-counter;
display: inline-block;
vertical-align: top;
max-width: 10%;
@include margin-right($baseline-h/2);
color: $gray-l4;
}
.instruction-details {
@extend %wipe-last-child;
display: inline-block;
vertical-align: top;
margin-bottom: $baseline-v;
max-width: 85%;
}
.instruction-image {
@include fill-parent();
border-radius: ($baseline-v/10);
border: 1px solid $gray-l5;
padding: ($baseline-v/2) ($baseline-h/2);
background: $gray-l6;
img {
@include fill-parent();
display: block;
}
}
}
}
// specific instructions
// ====================
// support
.support {
@include span-columns(8 of 12);
@include shift(2);
@include media($bp-large) {
@include fill-parent();
@include shift(0);
}
@include media($bp-medium) {
@include fill-parent();
@include shift(0);
}
@include media($bp-small) {
@include fill-parent();
@include shift(0);
}
.copy {
@include media($bp-small) {
@include font-size(14); // can't use %t-copy-base for some reason
@include lh(14);
}
}
.list-actions {
margin-top: ($baseline-v);
.action {
@extend %t-copy-sub1;
@extend %btn-primary;
@include media($bp-medium) {
display: block;
text-align: center;
}
@include media($bp-small) {
display: block;
text-align: center;
}
}
}
}
}
// ------------------------------------------
// 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
// Bourbon 4.2.1
// http://bourbon.io
// Copyright 2011-2015 thoughtbot, inc.
// MIT License
@import "settings/prefixer";
@import "settings/px-to-em";
@import "settings/asset-pipeline";
@import "functions/assign-inputs";
@import "functions/contains";
@import "functions/contains-falsy";
@import "functions/is-length";
@import "functions/is-light";
@import "functions/is-number";
@import "functions/is-size";
@import "functions/px-to-em";
@import "functions/px-to-rem";
@import "functions/shade";
@import "functions/strip-units";
@import "functions/tint";
@import "functions/transition-property-name";
@import "functions/unpack";
@import "functions/modular-scale";
@import "helpers/convert-units";
@import "helpers/directional-values";
@import "helpers/font-source-declaration";
@import "helpers/gradient-positions-parser";
@import "helpers/linear-angle-parser";
@import "helpers/linear-gradient-parser";
@import "helpers/linear-positions-parser";
@import "helpers/linear-side-corner-parser";
@import "helpers/radial-arg-parser";
@import "helpers/radial-positions-parser";
@import "helpers/radial-gradient-parser";
@import "helpers/render-gradients";
@import "helpers/shape-size-stripper";
@import "helpers/str-to-num";
@import "css3/animation";
@import "css3/appearance";
@import "css3/backface-visibility";
@import "css3/background";
@import "css3/background-image";
@import "css3/border-image";
@import "css3/calc";
@import "css3/columns";
@import "css3/filter";
@import "css3/flex-box";
@import "css3/font-face";
@import "css3/font-feature-settings";
@import "css3/hidpi-media-query";
@import "css3/hyphens";
@import "css3/image-rendering";
@import "css3/keyframes";
@import "css3/linear-gradient";
@import "css3/perspective";
@import "css3/placeholder";
@import "css3/radial-gradient";
@import "css3/selection";
@import "css3/text-decoration";
@import "css3/transform";
@import "css3/transition";
@import "css3/user-select";
@import "addons/border-color";
@import "addons/border-radius";
@import "addons/border-style";
@import "addons/border-width";
@import "addons/buttons";
@import "addons/clearfix";
@import "addons/ellipsis";
@import "addons/font-stacks";
@import "addons/hide-text";
@import "addons/margin";
@import "addons/padding";
@import "addons/position";
@import "addons/prefixer";
@import "addons/retina-image";
@import "addons/size";
@import "addons/text-inputs";
@import "addons/timing-functions";
@import "addons/triangle";
@import "addons/word-wrap";
@import "bourbon-deprecated-upcoming";
@charset "UTF-8";
/// Provides a quick method for targeting `border-color` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include border-color(#a60b55 #76cd9c null #e8ae1a);
/// }
///
/// @example css - CSS Output
/// .element {
/// border-left-color: #e8ae1a;
/// border-right-color: #76cd9c;
/// border-top-color: #a60b55;
/// }
///
/// @require {mixin} directional-property
///
/// @output `border-color`
@mixin border-color($vals...) {
@include directional-property(border, color, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for targeting `border-radius` on both corners on the side of a box.
///
/// @param {Number} $radii
/// List of arguments
///
/// @example scss - Usage
/// .element-one {
/// @include border-top-radius(5px);
/// }
///
/// .element-two {
/// @include border-left-radius(3px);
/// }
///
/// @example css - CSS Output
/// .element-one {
/// border-top-left-radius: 5px;
/// border-top-right-radius: 5px;
/// }
///
/// .element-two {
/// border-bottom-left-radius: 3px;
/// border-top-left-radius: 3px;
/// }
///
/// @output `border-radius`
@mixin border-top-radius($radii) {
border-top-left-radius: $radii;
border-top-right-radius: $radii;
}
@mixin border-right-radius($radii) {
border-bottom-right-radius: $radii;
border-top-right-radius: $radii;
}
@mixin border-bottom-radius($radii) {
border-bottom-left-radius: $radii;
border-bottom-right-radius: $radii;
}
@mixin border-left-radius($radii) {
border-bottom-left-radius: $radii;
border-top-left-radius: $radii;
}
@charset "UTF-8";
/// Provides a quick method for targeting `border-style` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include border-style(dashed null solid);
/// }
///
/// @example css - CSS Output
/// .element {
/// border-bottom-style: solid;
/// border-top-style: dashed;
/// }
///
/// @require {mixin} directional-property
///
/// @output `border-style`
@mixin border-style($vals...) {
@include directional-property(border, style, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for targeting `border-width` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include border-width(1em null 20px);
/// }
///
/// @example css - CSS Output
/// .element {
/// border-bottom-width: 20px;
/// border-top-width: 1em;
/// }
///
/// @require {mixin} directional-property
///
/// @output `border-width`
@mixin border-width($vals...) {
@include directional-property(border, width, $vals...);
}
@charset "UTF-8";
/// Generates variables for all buttons. Please note that you must use interpolation on the variable: `#{$all-buttons}`.
///
/// @example scss - Usage
/// #{$all-buttons} {
/// background-color: #f00;
/// }
///
/// #{$all-buttons-focus},
/// #{$all-buttons-hover} {
/// background-color: #0f0;
/// }
///
/// #{$all-buttons-active} {
/// background-color: #00f;
/// }
///
/// @example css - CSS Output
/// button,
/// input[type="button"],
/// input[type="reset"],
/// input[type="submit"] {
/// background-color: #f00;
/// }
///
/// button:focus,
/// input[type="button"]:focus,
/// input[type="reset"]:focus,
/// input[type="submit"]:focus,
/// button:hover,
/// input[type="button"]:hover,
/// input[type="reset"]:hover,
/// input[type="submit"]:hover {
/// background-color: #0f0;
/// }
///
/// button:active,
/// input[type="button"]:active,
/// input[type="reset"]:active,
/// input[type="submit"]:active {
/// background-color: #00f;
/// }
///
/// @require assign-inputs
///
/// @type List
///
/// @todo Remove double assigned variables (Lines 59–62) in v5.0.0
$buttons-list: 'button',
'input[type="button"]',
'input[type="reset"]',
'input[type="submit"]';
$all-buttons: assign-inputs($buttons-list);
$all-buttons-active: assign-inputs($buttons-list, active);
$all-buttons-focus: assign-inputs($buttons-list, focus);
$all-buttons-hover: assign-inputs($buttons-list, hover);
$all-button-inputs: $all-buttons;
$all-button-inputs-active: $all-buttons-active;
$all-button-inputs-focus: $all-buttons-focus;
$all-button-inputs-hover: $all-buttons-hover;
@charset "UTF-8";
/// Provides an easy way to include a clearfix for containing floats.
///
/// @link http://cssmojo.com/latest_new_clearfix_so_far/
///
/// @example scss - Usage
/// .element {
/// @include clearfix;
/// }
///
/// @example css - CSS Output
/// .element::after {
/// clear: both;
/// content: "";
/// display: table;
/// }
@mixin clearfix {
&::after {
clear: both;
content: "";
display: table;
}
}
@charset "UTF-8";
/// Truncates text and adds an ellipsis to represent overflow.
///
/// @param {Number} $width [100%]
/// Max-width for the string to respect before being truncated
///
/// @example scss - Usage
/// .element {
/// @include ellipsis;
/// }
///
/// @example css - CSS Output
/// .element {
/// display: inline-block;
/// max-width: 100%;
/// overflow: hidden;
/// text-overflow: ellipsis;
/// white-space: nowrap;
/// word-wrap: normal;
/// }
@mixin ellipsis($width: 100%) {
display: inline-block;
max-width: $width;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
}
@charset "UTF-8";
/// Georgia font stack.
///
/// @type List
$georgia: "Georgia", "Cambria", "Times New Roman", "Times", serif;
/// Helvetica font stack.
///
/// @type List
$helvetica: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif;
/// Lucida Grande font stack.
///
/// @type List
$lucida-grande: "Lucida Grande", "Tahoma", "Verdana", "Arial", sans-serif;
/// Monospace font stack.
///
/// @type List
$monospace: "Bitstream Vera Sans Mono", "Consolas", "Courier", monospace;
/// Verdana font stack.
///
/// @type List
$verdana: "Verdana", "Geneva", sans-serif;
/// Hides the text in an element, commonly used to show an image. Some elements will need block-level styles applied.
///
/// @link http://zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement
///
/// @example scss - Usage
/// .element {
/// @include hide-text;
/// }
///
/// @example css - CSS Output
/// .element {
/// overflow: hidden;
/// text-indent: 101%;
/// white-space: nowrap;
/// }
///
/// @todo Remove height argument in v5.0.0
@mixin hide-text($height: null) {
overflow: hidden;
text-indent: 101%;
white-space: nowrap;
@if $height {
@warn "The `hide-text` mixin has changed and no longer requires a height. The height argument will no longer be accepted in v5.0.0";
}
}
@charset "UTF-8";
/// Provides a quick method for targeting `margin` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include margin(null 10px 3em 20vh);
/// }
///
/// @example css - CSS Output
/// .element {
/// margin-bottom: 3em;
/// margin-left: 20vh;
/// margin-right: 10px;
/// }
///
/// @require {mixin} directional-property
///
/// @output `margin`
@mixin margin($vals...) {
@include directional-property(margin, false, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for targeting `padding` on specific sides of a box. Use a `null` value to “skip” a side.
///
/// @param {Arglist} $vals
/// List of arguments
///
/// @example scss - Usage
/// .element {
/// @include padding(12vh null 10px 5%);
/// }
///
/// @example css - CSS Output
/// .element {
/// padding-bottom: 10px;
/// padding-left: 5%;
/// padding-top: 12vh;
/// }
///
/// @require {mixin} directional-property
///
/// @output `padding`
@mixin padding($vals...) {
@include directional-property(padding, false, $vals...);
}
@charset "UTF-8";
/// Provides a quick method for setting an element’s position. Use a `null` value to “skip” a side.
///
/// @param {Position} $position [relative]
/// A CSS position value
///
/// @param {Arglist} $coordinates [null null null null]
/// List of values that correspond to the 4-value syntax for the edges of a box
///
/// @example scss - Usage
/// .element {
/// @include position(absolute, 0 null null 10em);
/// }
///
/// @example css - CSS Output
/// .element {
/// left: 10em;
/// position: absolute;
/// top: 0;
/// }
///
/// @require {function} is-length
/// @require {function} unpack
@mixin position($position: relative, $coordinates: null null null null) {
@if type-of($position) == list {
$coordinates: $position;
$position: relative;
}
$coordinates: unpack($coordinates);
$offsets: (
top: nth($coordinates, 1),
right: nth($coordinates, 2),
bottom: nth($coordinates, 3),
left: nth($coordinates, 4)
);
position: $position;
@each $offset, $value in $offsets {
@if is-length($value) {
#{$offset}: $value;
}
}
}
@charset "UTF-8";
/// A mixin for generating vendor prefixes on non-standardized properties.
///
/// @param {String} $property
/// Property to prefix
///
/// @param {*} $value
/// Value to use
///
/// @param {List} $prefixes
/// Prefixes to define
///
/// @example scss - Usage
/// .element {
/// @include prefixer(border-radius, 10px, webkit ms spec);
/// }
///
/// @example css - CSS Output
/// .element {
/// -webkit-border-radius: 10px;
/// -moz-border-radius: 10px;
/// border-radius: 10px;
/// }
///
/// @require {variable} $prefix-for-webkit
/// @require {variable} $prefix-for-mozilla
/// @require {variable} $prefix-for-microsoft
/// @require {variable} $prefix-for-opera
/// @require {variable} $prefix-for-spec
@mixin prefixer($property, $value, $prefixes) {
@each $prefix in $prefixes {
@if $prefix == webkit {
@if $prefix-for-webkit {
-webkit-#{$property}: $value;
}
} @else if $prefix == moz {
@if $prefix-for-mozilla {
-moz-#{$property}: $value;
}
} @else if $prefix == ms {
@if $prefix-for-microsoft {
-ms-#{$property}: $value;
}
} @else if $prefix == o {
@if $prefix-for-opera {
-o-#{$property}: $value;
}
} @else if $prefix == spec {
@if $prefix-for-spec {
#{$property}: $value;
}
} @else {
@warn "Unrecognized prefix: #{$prefix}";
}
}
}
@mixin disable-prefix-for-all() {
$prefix-for-webkit: false !global;
$prefix-for-mozilla: false !global;
$prefix-for-microsoft: false !global;
$prefix-for-opera: false !global;
$prefix-for-spec: false !global;
}
@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) {
@if $asset-pipeline {
background-image: image-url("#{$filename}.#{$extension}");
} @else {
background-image: url("#{$filename}.#{$extension}");
}
@include hidpi {
@if $asset-pipeline {
@if $retina-filename {
background-image: image-url("#{$retina-filename}.#{$extension}");
} @else {
background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}");
}
} @else {
@if $retina-filename {
background-image: url("#{$retina-filename}.#{$extension}");
} @else {
background-image: url("#{$filename}#{$retina-suffix}.#{$extension}");
}
}
background-size: $background-size;
}
}
@charset "UTF-8";
/// Sets the `width` and `height` of the element.
///
/// @param {List} $size
/// A list of at most 2 size values.
///
/// If there is only a single value in `$size` it is used for both width and height. All units are supported.
///
/// @example scss - Usage
/// .first-element {
/// @include size(2em);
/// }
///
/// .second-element {
/// @include size(auto 10em);
/// }
///
/// @example css - CSS Output
/// .first-element {
/// width: 2em;
/// height: 2em;
/// }
///
/// .second-element {
/// width: auto;
/// height: 10em;
/// }
///
/// @todo Refactor in 5.0.0 to use a comma-separated argument
@mixin size($value) {
$width: nth($value, 1);
$height: $width;
@if length($value) > 1 {
$height: nth($value, 2);
}
@if is-size($height) {
height: $height;
} @else {
@warn "`#{$height}` is not a valid length for the `$height` parameter in the `size` mixin.";
}
@if is-size($width) {
width: $width;
} @else {
@warn "`#{$width}` is not a valid length for the `$width` parameter in the `size` mixin.";
}
}
@charset "UTF-8";
/// Generates variables for all text-based inputs. Please note that you must use interpolation on the variable: `#{$all-text-inputs}`.
///
/// @example scss - Usage
/// #{$all-text-inputs} {
/// border: 1px solid #f00;
/// }
///
/// #{$all-text-inputs-focus},
/// #{$all-text-inputs-hover} {
/// border: 1px solid #0f0;
/// }
///
/// #{$all-text-inputs-active} {
/// border: 1px solid #00f;
/// }
///
/// @example css - CSS Output
/// input[type="color"],
/// input[type="date"],
/// input[type="datetime"],
/// input[type="datetime-local"],
/// input[type="email"],
/// input[type="month"],
/// input[type="number"],
/// input[type="password"],
/// input[type="search"],
/// input[type="tel"],
/// input[type="text"],
/// input[type="time"],
/// input[type="url"],
/// input[type="week"],
/// textarea {
/// border: 1px solid #f00;
/// }
///
/// input[type="color"]:focus,
/// input[type="date"]:focus,
/// input[type="datetime"]:focus,
/// input[type="datetime-local"]:focus,
/// input[type="email"]:focus,
/// input[type="month"]:focus,
/// input[type="number"]:focus,
/// input[type="password"]:focus,
/// input[type="search"]:focus,
/// input[type="tel"]:focus,
/// input[type="text"]:focus,
/// input[type="time"]:focus,
/// input[type="url"]:focus,
/// input[type="week"]:focus,
/// textarea:focus,
/// input[type="color"]:hover,
/// input[type="date"]:hover,
/// input[type="datetime"]:hover,
/// input[type="datetime-local"]:hover,
/// input[type="email"]:hover,
/// input[type="month"]:hover,
/// input[type="number"]:hover,
/// input[type="password"]:hover,
/// input[type="search"]:hover,
/// input[type="tel"]:hover,
/// input[type="text"]:hover,
/// input[type="time"]:hover,
/// input[type="url"]:hover,
/// input[type="week"]:hover,
/// textarea:hover {
/// border: 1px solid #0f0;
/// }
///
/// input[type="color"]:active,
/// input[type="date"]:active,
/// input[type="datetime"]:active,
/// input[type="datetime-local"]:active,
/// input[type="email"]:active,
/// input[type="month"]:active,
/// input[type="number"]:active,
/// input[type="password"]:active,
/// input[type="search"]:active,
/// input[type="tel"]:active,
/// input[type="text"]:active,
/// input[type="time"]:active,
/// input[type="url"]:active,
/// input[type="week"]:active,
/// textarea:active {
/// border: 1px solid #00f;
/// }
///
/// @require assign-inputs
///
/// @type List
$text-inputs-list: 'input[type="color"]',
'input[type="date"]',
'input[type="datetime"]',
'input[type="datetime-local"]',
'input[type="email"]',
'input[type="month"]',
'input[type="number"]',
'input[type="password"]',
'input[type="search"]',
'input[type="tel"]',
'input[type="text"]',
'input[type="time"]',
'input[type="url"]',
'input[type="week"]',
'textarea';
$all-text-inputs: assign-inputs($text-inputs-list);
$all-text-inputs-active: assign-inputs($text-inputs-list, active);
$all-text-inputs-focus: assign-inputs($text-inputs-list, focus);
$all-text-inputs-hover: assign-inputs($text-inputs-list, hover);
@charset "UTF-8";
/// CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie)
///
/// Timing functions are the same as demoed here: http://jqueryui.com/resources/demos/effect/easing.html
///
/// @type cubic-bezier
$ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530);
$ease-in-cubic: cubic-bezier(0.550, 0.055, 0.675, 0.190);
$ease-in-quart: cubic-bezier(0.895, 0.030, 0.685, 0.220);
$ease-in-quint: cubic-bezier(0.755, 0.050, 0.855, 0.060);
$ease-in-sine: cubic-bezier(0.470, 0.000, 0.745, 0.715);
$ease-in-expo: cubic-bezier(0.950, 0.050, 0.795, 0.035);
$ease-in-circ: cubic-bezier(0.600, 0.040, 0.980, 0.335);
$ease-in-back: cubic-bezier(0.600, -0.280, 0.735, 0.045);
$ease-out-quad: cubic-bezier(0.250, 0.460, 0.450, 0.940);
$ease-out-cubic: cubic-bezier(0.215, 0.610, 0.355, 1.000);
$ease-out-quart: cubic-bezier(0.165, 0.840, 0.440, 1.000);
$ease-out-quint: cubic-bezier(0.230, 1.000, 0.320, 1.000);
$ease-out-sine: cubic-bezier(0.390, 0.575, 0.565, 1.000);
$ease-out-expo: cubic-bezier(0.190, 1.000, 0.220, 1.000);
$ease-out-circ: cubic-bezier(0.075, 0.820, 0.165, 1.000);
$ease-out-back: cubic-bezier(0.175, 0.885, 0.320, 1.275);
$ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955);
$ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1.000);
$ease-in-out-quart: cubic-bezier(0.770, 0.000, 0.175, 1.000);
$ease-in-out-quint: cubic-bezier(0.860, 0.000, 0.070, 1.000);
$ease-in-out-sine: cubic-bezier(0.445, 0.050, 0.550, 0.950);
$ease-in-out-expo: cubic-bezier(1.000, 0.000, 0.000, 1.000);
$ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.150, 0.860);
$ease-in-out-back: cubic-bezier(0.680, -0.550, 0.265, 1.550);
@mixin triangle($size, $color, $direction) {
$width: nth($size, 1);
$height: nth($size, length($size));
$foreground-color: nth($color, 1);
$background-color: if(length($color) == 2, nth($color, 2), transparent);
height: 0;
width: 0;
@if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
$width: $width / 2;
$height: if(length($size) > 1, $height, $height/2);
@if $direction == up {
border-bottom: $height solid $foreground-color;
border-left: $width solid $background-color;
border-right: $width solid $background-color;
} @else if $direction == right {
border-bottom: $width solid $background-color;
border-left: $height solid $foreground-color;
border-top: $width solid $background-color;
} @else if $direction == down {
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-top: $height solid $foreground-color;
} @else if $direction == left {
border-bottom: $width solid $background-color;
border-right: $height solid $foreground-color;
border-top: $width solid $background-color;
}
} @else if ($direction == up-right) or ($direction == up-left) {
border-top: $height solid $foreground-color;
@if $direction == up-right {
border-left: $width solid $background-color;
} @else if $direction == up-left {
border-right: $width solid $background-color;
}
} @else if ($direction == down-right) or ($direction == down-left) {
border-bottom: $height solid $foreground-color;
@if $direction == down-right {
border-left: $width solid $background-color;
} @else if $direction == down-left {
border-right: $width solid $background-color;
}
} @else if ($direction == inset-up) {
border-color: $background-color $background-color $foreground-color;
border-style: solid;
border-width: $height $width;
} @else if ($direction == inset-down) {
border-color: $foreground-color $background-color $background-color;
border-style: solid;
border-width: $height $width;
} @else if ($direction == inset-right) {
border-color: $background-color $background-color $background-color $foreground-color;
border-style: solid;
border-width: $width $height;
} @else if ($direction == inset-left) {
border-color: $background-color $foreground-color $background-color $background-color;
border-style: solid;
border-width: $width $height;
}
}
@charset "UTF-8";
/// Provides an easy way to change the `word-wrap` property.
///
/// @param {String} $wrap [break-word]
/// Value for the `word-break` property.
///
/// @example scss - Usage
/// .wrapper {
/// @include word-wrap(break-word);
/// }
///
/// @example css - CSS Output
/// .wrapper {
/// overflow-wrap: break-word;
/// word-break: break-all;
/// word-wrap: break-word;
/// }
@mixin word-wrap($wrap: break-word) {
overflow-wrap: $wrap;
word-wrap: $wrap;
@if $wrap == break-word {
word-break: break-all;
} @else {
word-break: $wrap;
}
}
// http://www.w3.org/TR/css3-animations/#the-animation-name-property-
// Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties.
@mixin animation($animations...) {
@include prefixer(animation, $animations, webkit moz spec);
}
@mixin animation-name($names...) {
@include prefixer(animation-name, $names, webkit moz spec);
}
@mixin animation-duration($times...) {
@include prefixer(animation-duration, $times, webkit moz spec);
}
@mixin animation-timing-function($motions...) {
// ease | linear | ease-in | ease-out | ease-in-out
@include prefixer(animation-timing-function, $motions, webkit moz spec);
}
@mixin animation-iteration-count($values...) {
// infinite | <number>
@include prefixer(animation-iteration-count, $values, webkit moz spec);
}
@mixin animation-direction($directions...) {
// normal | alternate
@include prefixer(animation-direction, $directions, webkit moz spec);
}
@mixin animation-play-state($states...) {
// running | paused
@include prefixer(animation-play-state, $states, webkit moz spec);
}
@mixin animation-delay($times...) {
@include prefixer(animation-delay, $times, webkit moz spec);
}
@mixin animation-fill-mode($modes...) {
// none | forwards | backwards | both
@include prefixer(animation-fill-mode, $modes, webkit moz spec);
}
@mixin appearance($value) {
@include prefixer(appearance, $value, webkit moz ms o spec);
}
@mixin backface-visibility($visibility) {
@include prefixer(backface-visibility, $visibility, webkit spec);
}
//************************************************************************//
// Background-image property for adding multiple background images with
// gradients, or for stringing multiple gradients together.
//************************************************************************//
@mixin background-image($images...) {
$webkit-images: ();
$spec-images: ();
@each $image in $images {
$webkit-image: ();
$spec-image: ();
@if (type-of($image) == string) {
$url-str: str-slice($image, 0, 3);
$gradient-type: str-slice($image, 0, 6);
@if $url-str == "url" {
$webkit-image: $image;
$spec-image: $image;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser($image);
$webkit-image: map-get($gradients, webkit-image);
$spec-image: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser($image);
$webkit-image: map-get($gradients, webkit-image);
$spec-image: map-get($gradients, spec-image);
}
}
$webkit-images: append($webkit-images, $webkit-image, comma);
$spec-images: append($spec-images, $spec-image, comma);
}
background-image: $webkit-images;
background-image: $spec-images;
}
//************************************************************************//
// Background property for adding multiple backgrounds using shorthand
// notation.
//************************************************************************//
@mixin background($backgrounds...) {
$webkit-backgrounds: ();
$spec-backgrounds: ();
@each $background in $backgrounds {
$webkit-background: ();
$spec-background: ();
$background-type: type-of($background);
@if $background-type == string or $background-type == list {
$background-str: if($background-type == list, nth($background, 1), $background);
$url-str: str-slice($background-str, 0, 3);
$gradient-type: str-slice($background-str, 0, 6);
@if $url-str == "url" {
$webkit-background: $background;
$spec-background: $background;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser("#{$background}");
$webkit-background: map-get($gradients, webkit-image);
$spec-background: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser("#{$background}");
$webkit-background: map-get($gradients, webkit-image);
$spec-background: map-get($gradients, spec-image);
}
@else {
$webkit-background: $background;
$spec-background: $background;
}
}
@else {
$webkit-background: $background;
$spec-background: $background;
}
$webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma);
$spec-backgrounds: append($spec-backgrounds, $spec-background, comma);
}
background: $webkit-backgrounds;
background: $spec-backgrounds;
}
@mixin border-image($borders...) {
$webkit-borders: ();
$spec-borders: ();
@each $border in $borders {
$webkit-border: ();
$spec-border: ();
$border-type: type-of($border);
@if $border-type == string or list {
$border-str: if($border-type == list, nth($border, 1), $border);
$url-str: str-slice($border-str, 0, 3);
$gradient-type: str-slice($border-str, 0, 6);
@if $url-str == "url" {
$webkit-border: $border;
$spec-border: $border;
}
@else if $gradient-type == "linear" {
$gradients: _linear-gradient-parser("#{$border}");
$webkit-border: map-get($gradients, webkit-image);
$spec-border: map-get($gradients, spec-image);
}
@else if $gradient-type == "radial" {
$gradients: _radial-gradient-parser("#{$border}");
$webkit-border: map-get($gradients, webkit-image);
$spec-border: map-get($gradients, spec-image);
}
@else {
$webkit-border: $border;
$spec-border: $border;
}
}
@else {
$webkit-border: $border;
$spec-border: $border;
}
$webkit-borders: append($webkit-borders, $webkit-border, comma);
$spec-borders: append($spec-borders, $spec-border, comma);
}
-webkit-border-image: $webkit-borders;
border-image: $spec-borders;
border-style: solid;
}
//Examples:
// @include border-image(url("image.png"));
// @include border-image(url("image.png") 20 stretch);
// @include border-image(linear-gradient(45deg, orange, yellow));
// @include border-image(linear-gradient(45deg, orange, yellow) stretch);
// @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round);
// @include border-image(radial-gradient(top, cover, orange, yellow, orange));
@mixin calc($property, $value) {
#{$property}: -webkit-calc(#{$value});
#{$property}: calc(#{$value});
}
@mixin columns($arg: auto) {
// <column-count> || <column-width>
@include prefixer(columns, $arg, webkit moz spec);
}
@mixin column-count($int: auto) {
// auto || integer
@include prefixer(column-count, $int, webkit moz spec);
}
@mixin column-gap($length: normal) {
// normal || length
@include prefixer(column-gap, $length, webkit moz spec);
}
@mixin column-fill($arg: auto) {
// auto || length
@include prefixer(column-fill, $arg, webkit moz spec);
}
@mixin column-rule($arg) {
// <border-width> || <border-style> || <color>
@include prefixer(column-rule, $arg, webkit moz spec);
}
@mixin column-rule-color($color) {
@include prefixer(column-rule-color, $color, webkit moz spec);
}
@mixin column-rule-style($style: none) {
// none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid
@include prefixer(column-rule-style, $style, webkit moz spec);
}
@mixin column-rule-width ($width: none) {
@include prefixer(column-rule-width, $width, webkit moz spec);
}
@mixin column-span($arg: none) {
// none || all
@include prefixer(column-span, $arg, webkit moz spec);
}
@mixin column-width($length: auto) {
// auto || length
@include prefixer(column-width, $length, webkit moz spec);
}
@mixin filter($function: none) {
// <filter-function> [<filter-function]* | none
@include prefixer(filter, $function, webkit spec);
}
// CSS3 Flexible Box Model and property defaults
// Custom shorthand notation for flexbox
@mixin box($orient: inline-axis, $pack: start, $align: stretch) {
@include display-box;
@include box-orient($orient);
@include box-pack($pack);
@include box-align($align);
}
@mixin display-box {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox; // IE 10
display: box;
}
@mixin box-orient($orient: inline-axis) {
// horizontal|vertical|inline-axis|block-axis|inherit
@include prefixer(box-orient, $orient, webkit moz spec);
}
@mixin box-pack($pack: start) {
// start|end|center|justify
@include prefixer(box-pack, $pack, webkit moz spec);
-ms-flex-pack: $pack; // IE 10
}
@mixin box-align($align: stretch) {
// start|end|center|baseline|stretch
@include prefixer(box-align, $align, webkit moz spec);
-ms-flex-align: $align; // IE 10
}
@mixin box-direction($direction: normal) {
// normal|reverse|inherit
@include prefixer(box-direction, $direction, webkit moz spec);
-ms-flex-direction: $direction; // IE 10
}
@mixin box-lines($lines: single) {
// single|multiple
@include prefixer(box-lines, $lines, webkit moz spec);
}
@mixin box-ordinal-group($int: 1) {
@include prefixer(box-ordinal-group, $int, webkit moz spec);
-ms-flex-order: $int; // IE 10
}
@mixin box-flex($value: 0) {
@include prefixer(box-flex, $value, webkit moz spec);
-ms-flex: $value; // IE 10
}
@mixin box-flex-group($int: 1) {
@include prefixer(box-flex-group, $int, webkit moz spec);
}
// CSS3 Flexible Box Model and property defaults
// Unified attributes for 2009, 2011, and 2012 flavours.
// 2009 - display (box | inline-box)
// 2011 - display (flexbox | inline-flexbox)
// 2012 - display (flex | inline-flex)
@mixin display($value) {
// flex | inline-flex
@if $value == "flex" {
// 2009
display: -webkit-box;
display: -moz-box;
display: box;
// 2012
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox; // 2011 (IE 10)
display: flex;
} @else if $value == "inline-flex" {
display: -webkit-inline-box;
display: -moz-inline-box;
display: inline-box;
display: -webkit-inline-flex;
display: -moz-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
} @else {
display: $value;
}
}
// 2009 - box-flex (integer)
// 2011 - flex (decimal | width decimal)
// 2012 - flex (integer integer width)
@mixin flex($value) {
// Grab flex-grow for older browsers.
$flex-grow: nth($value, 1);
// 2009
@include prefixer(box-flex, $flex-grow, webkit moz spec);
// 2011 (IE 10), 2012
@include prefixer(flex, $value, webkit moz ms spec);
}
// 2009 - box-orient ( horizontal | vertical | inline-axis | block-axis)
// - box-direction (normal | reverse)
// 2011 - flex-direction (row | row-reverse | column | column-reverse)
// 2012 - flex-direction (row | row-reverse | column | column-reverse)
@mixin flex-direction($value: row) {
// Alt values.
$value-2009: $value;
$value-2011: $value;
$direction: "normal";
@if $value == row {
$value-2009: horizontal;
} @else if $value == "row-reverse" {
$value-2009: horizontal;
$direction: reverse;
} @else if $value == column {
$value-2009: vertical;
} @else if $value == "column-reverse" {
$value-2009: vertical;
$direction: reverse;
}
// 2009
@include prefixer(box-orient, $value-2009, webkit moz spec);
@if $direction == "reverse" {
@include prefixer(box-direction, $direction, webkit moz spec);
}
// 2012
@include prefixer(flex-direction, $value, webkit moz spec);
// 2011 (IE 10)
-ms-flex-direction: $value;
}
// 2009 - box-lines (single | multiple)
// 2011 - flex-wrap (nowrap | wrap | wrap-reverse)
// 2012 - flex-wrap (nowrap | wrap | wrap-reverse)
@mixin flex-wrap($value: nowrap) {
// Alt values
$alt-value: $value;
@if $value == nowrap {
$alt-value: single;
} @else if $value == wrap {
$alt-value: multiple;
} @else if $value == "wrap-reverse" {
$alt-value: multiple;
}
@include prefixer(box-lines, $alt-value, webkit moz spec);
@include prefixer(flex-wrap, $value, webkit moz ms spec);
}
// 2009 - TODO: parse values into flex-direction/flex-wrap
// 2011 - TODO: parse values into flex-direction/flex-wrap
// 2012 - flex-flow (flex-direction || flex-wrap)
@mixin flex-flow($value) {
@include prefixer(flex-flow, $value, webkit moz spec);
}
// 2009 - box-ordinal-group (integer)
// 2011 - flex-order (integer)
// 2012 - order (integer)
@mixin order($int: 0) {
// 2009
@include prefixer(box-ordinal-group, $int, webkit moz spec);
// 2012
@include prefixer(order, $int, webkit moz spec);
// 2011 (IE 10)
-ms-flex-order: $int;
}
// 2012 - flex-grow (number)
@mixin flex-grow($number: 0) {
@include prefixer(flex-grow, $number, webkit moz spec);
-ms-flex-positive: $number;
}
// 2012 - flex-shrink (number)
@mixin flex-shrink($number: 1) {
@include prefixer(flex-shrink, $number, webkit moz spec);
-ms-flex-negative: $number;
}
// 2012 - flex-basis (number)
@mixin flex-basis($width: auto) {
@include prefixer(flex-basis, $width, webkit moz spec);
-ms-flex-preferred-size: $width;
}
// 2009 - box-pack (start | end | center | justify)
// 2011 - flex-pack (start | end | center | justify)
// 2012 - justify-content (flex-start | flex-end | center | space-between | space-around)
@mixin justify-content($value: flex-start) {
// Alt values.
$alt-value: $value;
@if $value == "flex-start" {
$alt-value: start;
} @else if $value == "flex-end" {
$alt-value: end;
} @else if $value == "space-between" {
$alt-value: justify;
} @else if $value == "space-around" {
$alt-value: distribute;
}
// 2009
@include prefixer(box-pack, $alt-value, webkit moz spec);
// 2012
@include prefixer(justify-content, $value, webkit moz ms o spec);
// 2011 (IE 10)
-ms-flex-pack: $alt-value;
}
// 2009 - box-align (start | end | center | baseline | stretch)
// 2011 - flex-align (start | end | center | baseline | stretch)
// 2012 - align-items (flex-start | flex-end | center | baseline | stretch)
@mixin align-items($value: stretch) {
$alt-value: $value;
@if $value == "flex-start" {
$alt-value: start;
} @else if $value == "flex-end" {
$alt-value: end;
}
// 2009
@include prefixer(box-align, $alt-value, webkit moz spec);
// 2012
@include prefixer(align-items, $value, webkit moz ms o spec);
// 2011 (IE 10)
-ms-flex-align: $alt-value;
}
// 2011 - flex-item-align (auto | start | end | center | baseline | stretch)
// 2012 - align-self (auto | flex-start | flex-end | center | baseline | stretch)
@mixin align-self($value: auto) {
$value-2011: $value;
@if $value == "flex-start" {
$value-2011: start;
} @else if $value == "flex-end" {
$value-2011: end;
}
// 2012
@include prefixer(align-self, $value, webkit moz spec);
// 2011 (IE 10)
-ms-flex-item-align: $value-2011;
}
// 2011 - flex-line-pack (start | end | center | justify | distribute | stretch)
// 2012 - align-content (flex-start | flex-end | center | space-between | space-around | stretch)
@mixin align-content($value: stretch) {
$value-2011: $value;
@if $value == "flex-start" {
$value-2011: start;
} @else if $value == "flex-end" {
$value-2011: end;
} @else if $value == "space-between" {
$value-2011: justify;
} @else if $value == "space-around" {
$value-2011: distribute;
}
// 2012
@include prefixer(align-content, $value, webkit moz spec);
// 2011 (IE 10)
-ms-flex-line-pack: $value-2011;
}
@mixin font-face(
$font-family,
$file-path,
$weight: normal,
$style: normal,
$asset-pipeline: $asset-pipeline,
$file-formats: eot woff2 woff ttf svg) {
$font-url-prefix: font-url-prefixer($asset-pipeline);
@font-face {
font-family: $font-family;
font-style: $style;
font-weight: $weight;
src: font-source-declaration(
$font-family,
$file-path,
$asset-pipeline,
$file-formats,
$font-url-prefix
);
}
}
@mixin font-feature-settings($settings...) {
@if length($settings) == 0 { $settings: none; }
@include prefixer(font-feature-settings, $settings, webkit moz ms spec);
}
// HiDPI mixin. Default value set to 1.3 to target Google Nexus 7 (http://bjango.com/articles/min-device-pixel-ratio/)
@mixin hidpi($ratio: 1.3) {
@media only screen and (-webkit-min-device-pixel-ratio: $ratio),
only screen and (min--moz-device-pixel-ratio: $ratio),
only screen and (-o-min-device-pixel-ratio: #{$ratio}/1),
only screen and (min-resolution: round($ratio * 96dpi)),
only screen and (min-resolution: $ratio * 1dppx) {
@content;
}
}
@mixin hyphens($hyphenation: none) {
// none | manual | auto
@include prefixer(hyphens, $hyphenation, webkit moz ms spec);
}
@mixin image-rendering ($mode:auto) {
@if ($mode == crisp-edges) {
-ms-interpolation-mode: nearest-neighbor; // IE8+
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
}
@else {
image-rendering: $mode;
}
}
// Adds keyframes blocks for supported prefixes, removing redundant prefixes in the block's content
@mixin keyframes($name) {
$original-prefix-for-webkit: $prefix-for-webkit;
$original-prefix-for-mozilla: $prefix-for-mozilla;
$original-prefix-for-microsoft: $prefix-for-microsoft;
$original-prefix-for-opera: $prefix-for-opera;
$original-prefix-for-spec: $prefix-for-spec;
@if $original-prefix-for-webkit {
@include disable-prefix-for-all();
$prefix-for-webkit: true !global;
@-webkit-keyframes #{$name} {
@content;
}
}
@if $original-prefix-for-mozilla {
@include disable-prefix-for-all();
$prefix-for-mozilla: true !global;
@-moz-keyframes #{$name} {
@content;
}
}
$prefix-for-webkit: $original-prefix-for-webkit !global;
$prefix-for-mozilla: $original-prefix-for-mozilla !global;
$prefix-for-microsoft: $original-prefix-for-microsoft !global;
$prefix-for-opera: $original-prefix-for-opera !global;
$prefix-for-spec: $original-prefix-for-spec !global;
@if $original-prefix-for-spec {
@keyframes #{$name} {
@content;
}
}
}
@mixin linear-gradient($pos, $g1, $g2: null,
$g3: null, $g4: null,
$g5: null, $g6: null,
$g7: null, $g8: null,
$g9: null, $g10: null,
$fallback: null) {
// Detect what type of value exists in $pos
$pos-type: type-of(nth($pos, 1));
$pos-spec: null;
$pos-degree: null;
// If $pos is missing from mixin, reassign vars and add default position
@if ($pos-type == color) or (nth($pos, 1) == "transparent") {
$g10: $g9; $g9: $g8; $g8: $g7; $g7: $g6; $g6: $g5;
$g5: $g4; $g4: $g3; $g3: $g2; $g2: $g1; $g1: $pos;
$pos: null;
}
@if $pos {
$positions: _linear-positions-parser($pos);
$pos-degree: nth($positions, 1);
$pos-spec: nth($positions, 2);
}
$full: $g1, $g2, $g3, $g4, $g5, $g6, $g7, $g8, $g9, $g10;
// Set $g1 as the default fallback color
$fallback-color: nth($g1, 1);
// If $fallback is a color use that color as the fallback color
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
background-color: $fallback-color;
background-image: -webkit-linear-gradient($pos-degree $full); // Safari 5.1+, Chrome
background-image: unquote("linear-gradient(#{$pos-spec}#{$full})");
}
@mixin perspective($depth: none) {
// none | <length>
@include prefixer(perspective, $depth, webkit moz spec);
}
@mixin perspective-origin($value: 50% 50%) {
@include prefixer(perspective-origin, $value, webkit moz spec);
}
@mixin placeholder {
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@each $placeholder in $placeholders {
&:#{$placeholder}-placeholder {
@content;
}
}
}
// Requires Sass 3.1+
@mixin radial-gradient($g1, $g2,
$g3: null, $g4: null,
$g5: null, $g6: null,
$g7: null, $g8: null,
$g9: null, $g10: null,
$pos: null,
$shape-size: null,
$fallback: null) {
$data: _radial-arg-parser($g1, $g2, $pos, $shape-size);
$g1: nth($data, 1);
$g2: nth($data, 2);
$pos: nth($data, 3);
$shape-size: nth($data, 4);
$full: $g1, $g2, $g3, $g4, $g5, $g6, $g7, $g8, $g9, $g10;
// Strip deprecated cover/contain for spec
$shape-size-spec: _shape-size-stripper($shape-size);
// Set $g1 as the default fallback color
$first-color: nth($full, 1);
$fallback-color: nth($first-color, 1);
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
}
// Add Commas and spaces
$shape-size: if($shape-size, "#{$shape-size}, ", null);
$pos: if($pos, "#{$pos}, ", null);
$pos-spec: if($pos, "at #{$pos}", null);
$shape-size-spec: if(($shape-size-spec != " ") and ($pos == null), "#{$shape-size-spec}, ", "#{$shape-size-spec} ");
background-color: $fallback-color;
background-image: -webkit-radial-gradient(unquote(#{$pos}#{$shape-size}#{$full}));
background-image: unquote("radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full})");
}
@charset "UTF-8";
/// Outputs the spec and prefixed versions of the `::selection` pseudo-element.
///
/// @param {Bool} $current-selector [false]
/// If set to `true`, it takes the current element into consideration.
///
/// @example scss - Usage
/// .element {
/// @include selection(true) {
/// background-color: #ffbb52;
/// }
/// }
///
/// @example css - CSS Output
/// .element::-moz-selection {
/// background-color: #ffbb52;
/// }
///
/// .element::selection {
/// background-color: #ffbb52;
/// }
@mixin selection($current-selector: false) {
@if $current-selector {
&::-moz-selection {
@content;
}
&::selection {
@content;
}
} @else {
::-moz-selection {
@content;
}
::selection {
@content;
}
}
}
@mixin text-decoration($value) {
// <text-decoration-line> || <text-decoration-style> || <text-decoration-color>
@include prefixer(text-decoration, $value, moz);
}
@mixin text-decoration-line($line: none) {
// none || underline || overline || line-through
@include prefixer(text-decoration-line, $line, moz);
}
@mixin text-decoration-style($style: solid) {
// solid || double || dotted || dashed || wavy
@include prefixer(text-decoration-style, $style, moz webkit);
}
@mixin text-decoration-color($color: currentColor) {
// currentColor || <color>
@include prefixer(text-decoration-color, $color, moz);
}
@mixin transform($property: none) {
// none | <transform-function>
@include prefixer(transform, $property, webkit moz ms o spec);
}
@mixin transform-origin($axes: 50%) {
// x-axis - left | center | right | length | %
// y-axis - top | center | bottom | length | %
// z-axis - length
@include prefixer(transform-origin, $axes, webkit moz ms o spec);
}
@mixin transform-style($style: flat) {
@include prefixer(transform-style, $style, webkit moz ms o spec);
}
// Shorthand mixin. Supports multiple parentheses-deliminated values for each variable.
// Example: @include transition (all 2s ease-in-out);
// @include transition (opacity 1s ease-in 2s, width 2s ease-out);
// @include transition-property (transform, opacity);
@mixin transition($properties...) {
// Fix for vendor-prefix transform property
$needs-prefixes: false;
$webkit: ();
$moz: ();
$spec: ();
// Create lists for vendor-prefixed transform
@each $list in $properties {
@if nth($list, 1) == "transform" {
$needs-prefixes: true;
$list1: -webkit-transform;
$list2: -moz-transform;
$list3: ();
@each $var in $list {
$list3: join($list3, $var);
@if $var != "transform" {
$list1: join($list1, $var);
$list2: join($list2, $var);
}
}
$webkit: append($webkit, $list1);
$moz: append($moz, $list2);
$spec: append($spec, $list3);
} @else {
$webkit: append($webkit, $list, comma);
$moz: append($moz, $list, comma);
$spec: append($spec, $list, comma);
}
}
@if $needs-prefixes {
-webkit-transition: $webkit;
-moz-transition: $moz;
transition: $spec;
} @else {
@if length($properties) >= 1 {
@include prefixer(transition, $properties, webkit moz spec);
} @else {
$properties: all 0.15s ease-out 0s;
@include prefixer(transition, $properties, webkit moz spec);
}
}
}
@mixin transition-property($properties...) {
-webkit-transition-property: transition-property-names($properties, "webkit");
-moz-transition-property: transition-property-names($properties, "moz");
transition-property: transition-property-names($properties, false);
}
@mixin transition-duration($times...) {
@include prefixer(transition-duration, $times, webkit moz spec);
}
@mixin transition-timing-function($motions...) {
// ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier()
@include prefixer(transition-timing-function, $motions, webkit moz spec);
}
@mixin transition-delay($times...) {
@include prefixer(transition-delay, $times, webkit moz spec);
}
@mixin user-select($value: none) {
@include prefixer(user-select, $value, webkit moz ms spec);
}
@function assign-inputs($inputs, $pseudo: null) {
$list: ();
@each $input in $inputs {
$input: unquote($input);
$input: if($pseudo, $input + ":" + $pseudo, $input);
$list: append($list, $input, comma);
}
@return $list;
}
@charset "UTF-8";
/// Checks if a list does not contains a value.
///
/// @access private
///
/// @param {List} $list
/// The list to check against.
///
/// @return {Bool}
@function contains-falsy($list) {
@each $item in $list {
@if not $item {
@return true;
}
}
@return false;
}
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