2016-03-01 20:39:13 +02:00
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
2023-03-01 16:00:34 +01:00
// Copyright (c) KALEIDOS INC
2016-03-01 20:39:13 +02:00
2015-06-18 19:35:50 +02:00
/// This mixin allows you to add styles to a specific Media query inside the style selector specifying which Breaking Point you want to choose.
/// @group Mixins
2016-06-26 11:52:56 +02:00
/// @parameter $point - This parameter decide which one of Breaking Point you want to use: "bp-desktop" (Desktop), "bp-tablet" (Tablet) and "bp-mobile" (Mobile).
2022-07-13 09:26:22 +02:00
$bp-min-720 : " (min-width: 720px) " ;
$bp-min-1020 : " (min-width: 1020px) " ;
$bp-min-1366 : " (min-width: 1366px) " ;
$bp-max-1366 : " (max-width: 1366px) " ;
$bp-min-2556 : " (min-width: 2556px) " ;
2015-06-18 19:35:50 +02:00
2022-07-13 09:26:22 +02:00
@mixin bp ( $point ) {
2016-06-26 11:52:56 +02:00
@if $point == mobile {
2022-07-13 09:26:22 +02:00
@media #{ $bp-min-720 } {
2022-01-12 11:27:43 +01:00
@content ;
}
} @else if $point == tablet {
2022-07-13 09:26:22 +02:00
@media #{ $bp-min-1020 } {
2022-01-12 11:27:43 +01:00
@content ;
}
} @else if $point == desktop {
2022-07-13 09:26:22 +02:00
@media #{ $bp-min-1366 } {
2022-01-12 11:27:43 +01:00
@content ;
}
2015-06-18 19:35:50 +02:00
}
}
// Advanced positioning
// ----------------
2022-01-12 11:27:43 +01:00
@mixin position (
$ type ,
$top : $position-default ,
$right : $position-default ,
$bottom : $position-default ,
$left : $position-default
) {
2015-06-18 19:35:50 +02:00
position : $type ;
$allowed_types : absolute relative fixed ;
@if not index ( $allowed_types , $type ) {
@warn " Unknown position: #{ $type } . " ;
}
@each $data in top $top , right $right , bottom $bottom , left $left {
#{ nth ( $data , 1 ) } : nth ( $ data , 2 ) ;
}
}
2022-01-12 11:27:43 +01:00
@mixin absolute (
$top : $position-default ,
$right : $position-default ,
$bottom : $position-default ,
$left : $position-default
) {
2015-06-18 19:35:50 +02:00
@include position ( absolute , $top , $right , $bottom , $left ) ;
}
2022-01-12 11:27:43 +01:00
@mixin relative (
$top : $position-default ,
$right : $position-default ,
$bottom : $position-default ,
$left : $position-default
) {
2015-06-18 19:35:50 +02:00
@include position ( relative , $top , $right , $bottom , $left ) ;
}
2022-01-12 11:27:43 +01:00
@mixin fixed (
$top : $position-default ,
$right : $position-default ,
$bottom : $position-default ,
$left : $position-default
) {
2015-06-18 19:35:50 +02:00
@include position ( fixed , $top , $right , $bottom , $left ) ;
}
/// Center an element vertically and horizontally with an absolute position.
/// @group Mixins
@mixin centerer {
2022-01-12 11:27:43 +01:00
@include absolute ( 50 % , null , null , 50 % ) ;
transform : translate ( - 50 % , - 50 % ) ;
2015-06-18 19:35:50 +02:00
}
2021-11-15 09:51:34 -05:00
/// This mixing allow you to add placeholder colors in all available browsers
2015-06-18 19:35:50 +02:00
/// @group Mixins
@mixin placeholder {
& : : -webkit-input-placeholder {
2022-01-12 11:27:43 +01:00
@content ;
2015-06-18 19:35:50 +02:00
}
2022-01-12 11:27:43 +01:00
& : -moz-placeholder {
/* Firefox 18- */
@content ;
2015-06-18 19:35:50 +02:00
}
2022-01-12 11:27:43 +01:00
& : : -moz-placeholder {
/* Firefox 19+ */
@content ;
2015-06-18 19:35:50 +02:00
}
& : -ms-input-placeholder {
2022-01-12 11:27:43 +01:00
@content ;
2015-06-18 19:35:50 +02:00
}
}
/// Allows you to visually
/// @group Mixins
@mixin hide-text {
2022-01-12 11:27:43 +01:00
font : 0 / 0 a ;
color : transparent ;
text-shadow : none ;
2015-06-18 19:35:50 +02:00
}
2022-07-14 09:28:44 +02:00
@mixin font-face ( $style-name , $file , $weight : unquote ( " normal " ) , $style : unquote ( " normal " )) {
2022-01-12 11:27:43 +01:00
$filepath : " /fonts/ " + $file ;
@font-face {
font-family : " #{ $style-name } " ;
2023-08-31 09:25:40 +02:00
src :
url ( $ filepath + " .woff2 " ) format ( " woff2 " ) ,
url ( $ filepath + " .ttf " ) format ( " truetype " ) ;
2022-01-12 11:27:43 +01:00
font-weight : unquote ( $weight ) ;
font-style : unquote ( $style ) ;
}
2016-03-01 19:22:22 +01:00
}
2015-06-18 19:35:50 +02:00
@mixin tooltipShow {
& : hover {
. icon-tooltip {
display : block ;
left : 2 rem ;
2022-01-12 11:27:43 +01:00
animation : tooltipAppear 0 .2 s linear ;
2015-06-18 19:35:50 +02:00
}
}
& . active {
. icon-tooltip {
display : block ;
left : 2 rem ;
2022-01-12 11:27:43 +01:00
animation : tooltipAppear 0 .2 s linear ;
2015-06-18 19:35:50 +02:00
}
}
}
@mixin text-ellipsis {
text-overflow : ellipsis ;
white-space : nowrap ;
overflow : hidden ;
}
@mixin paragraph-ellipsis {
text-overflow : ellipsis ;
overflow : hidden ;
position : relative ;
& : : after {
2020-03-03 13:14:37 +01:00
background-color : $color-gray-50 ;
2015-06-18 19:35:50 +02:00
bottom : - 3 px ;
content : " ... " ;
padding-left : 10 px ;
position : absolute ;
right : 2 px ;
}
}