discourse/app/assets/stylesheets/common/foundation/mixins.scss

89 lines
1.7 KiB
SCSS
Raw Normal View History

2013-02-06 03:16:51 +08:00
// --------------------------------------------------
// Mixins used throughout the theme
// --------------------------------------------------
// Media queries
// --------------------------------------------------
2018-07-13 04:38:51 +08:00
$breakpoints: (
mobile-small: 320px,
mobile: 550px,
tablet: 768px,
medium: 850px,
large: 1000px,
extra-large: 1140px
);
@mixin breakpoint($bp, $rule: max-width, $type: screen) {
@media #{$type} and (#{$rule}: map-get($breakpoints, $bp)) {
2018-07-13 04:41:44 +08:00
@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() {
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear: both;
}
2015-03-23 22:23:42 +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;
}
}
}
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
@mixin user-select($mode) {
-webkit-user-select: $mode;
-moz-user-select: $mode;
-ms-user-select: $mode;
}
2013-04-09 05:43:52 +08:00
@mixin unselectable {
@include user-select(none);
2013-04-09 05:43:52 +08:00
}
// Stuff we repeat
@mixin post-aside {
2017-06-12 10:20:14 +08:00
border-left: 5px solid $primary-low;
background-color: blend-primary-secondary(5%);
}
2016-01-03 15:49:52 +08:00
// We still need -webkit for latest iPhone and Safari
@mixin transform($transforms) {
-webkit-transform: $transforms;
transform: $transforms;
}
@mixin appearance-none() {
// resets default browser styles
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}