2013-02-06 03:16:51 +08:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Mixins used throughout the theme
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// Media queries
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
@mixin small-width {
|
2014-07-25 00:21:22 +08:00
|
|
|
@media all and (max-width: 850px) {
|
2013-02-06 03:16:51 +08:00
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin medium-width {
|
2014-07-25 00:21:22 +08:00
|
|
|
@media all and (min-width: 1000px) and (max-width: 1139px) {
|
2013-02-06 03:16:51 +08:00
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin large-width {
|
2014-07-25 00:21:22 +08:00
|
|
|
@media all and (min-width: 1140px) {
|
2013-02-06 03:16:51 +08:00
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-08 17:49:31 +08:00
|
|
|
@mixin mobile-portrait {
|
|
|
|
@media all and (max-width: 320px) {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@mixin not-mobile-portrait {
|
|
|
|
@media all and (min-width: 321px) {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@mixin mobile-landscape {
|
|
|
|
@media all and (min-width: 321px) and (max-width: 959px) {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@mixin not-tablet-landscape {
|
|
|
|
@media all and (max-width: 959px) {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@mixin tablet-landscape {
|
|
|
|
@media all and (min-width: 960px) {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
2013-12-19 00:50:51 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
// CSS3 properties
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2015-03-23 22:23:42 +08:00
|
|
|
// Clearfix
|
|
|
|
|
|
|
|
@mixin clearfix() {
|
2018-06-08 17:49:31 +08:00
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
content: "";
|
|
|
|
display: table;
|
|
|
|
}
|
|
|
|
&:after {
|
|
|
|
clear: both;
|
|
|
|
}
|
2015-03-23 22:23:42 +08:00
|
|
|
}
|
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
// Border radius
|
|
|
|
|
|
|
|
@mixin border-radius-all($radius) {
|
2013-11-04 19:51:39 +08:00
|
|
|
border-radius: $radius;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Box shadow
|
|
|
|
|
|
|
|
@mixin box-shadow($shadow) {
|
2013-11-04 19:51:39 +08:00
|
|
|
box-shadow: $shadow;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Linear gradient
|
|
|
|
|
2015-08-19 13:02:01 +08:00
|
|
|
//noinspection CssOptimizeSimilarProperties
|
2013-02-06 03:16:51 +08:00
|
|
|
@mixin linear-gradient($start-color, $end-color) {
|
|
|
|
background-color: $start-color;
|
|
|
|
background-image: linear-gradient(to bottom, $start-color, $end-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Visibility
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
@mixin hover {
|
|
|
|
.discourse-no-touch & {
|
|
|
|
&:hover {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-23 18:52:20 +08:00
|
|
|
@mixin visible {
|
|
|
|
opacity: 1;
|
|
|
|
visibility: visible;
|
|
|
|
transition-delay: 0s;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
2013-04-09 05:43:52 +08:00
|
|
|
//
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2014-12-23 18:52:20 +08:00
|
|
|
// Unselectable (avoids unwanted selections with iPad, touch laptops, etc)
|
2013-04-09 05:43:52 +08:00
|
|
|
|
2017-10-20 03:54:05 +08:00
|
|
|
@mixin user-select($mode) {
|
|
|
|
-webkit-user-select: $mode;
|
2018-06-08 17:49:31 +08:00
|
|
|
-moz-user-select: $mode;
|
|
|
|
-ms-user-select: $mode;
|
2017-10-20 03:54:05 +08:00
|
|
|
}
|
|
|
|
|
2013-04-09 05:43:52 +08:00
|
|
|
@mixin unselectable {
|
2017-10-20 03:54:05 +08:00
|
|
|
@include user-select(none);
|
2013-04-09 05:43:52 +08:00
|
|
|
}
|
2015-08-20 01:27:17 +08:00
|
|
|
|
|
|
|
// Stuff we repeat
|
|
|
|
@mixin post-aside {
|
2017-06-12 10:20:14 +08:00
|
|
|
border-left: 5px solid $primary-low;
|
2015-08-21 07:47:34 +08:00
|
|
|
background-color: blend-primary-secondary(5%);
|
2015-08-20 01:27:17 +08:00
|
|
|
}
|
2015-08-26 07:58:37 +08:00
|
|
|
|
2016-01-03 15:49:52 +08:00
|
|
|
// We still need -webkit for latest iPhone and Safari
|
2015-08-26 07:58:37 +08:00
|
|
|
@mixin transform($transforms) {
|
2018-06-08 17:49:31 +08:00
|
|
|
-webkit-transform: $transforms;
|
|
|
|
transform: $transforms;
|
2015-08-26 07:58:37 +08:00
|
|
|
}
|
2017-11-28 04:23:18 +08:00
|
|
|
|
2018-06-08 17:49:31 +08:00
|
|
|
@mixin appearance-none() {
|
|
|
|
// resets default browser styles
|
2017-11-28 04:23:18 +08:00
|
|
|
-webkit-appearance: none;
|
2018-06-08 17:49:31 +08:00
|
|
|
-moz-appearance: none;
|
|
|
|
appearance: none;
|
|
|
|
}
|