Dotclear

source: admin/style/scss/init/_mixins-functions.scss @ 3365:11eb6b993152

Revision 3365:11eb6b993152, 1.3 KB checked in by franck <carnet.franck.paul@…>, 9 years ago (diff)

Switch admin CSS to Sass/Compass?, to be continued…

Line 
1// mixin svg fallback
2@mixin svg(
3     $file-name,
4     $css-img-path: $css-img-path)
5{
6     background-image: inline-image($file-name+'.png');
7     background-image: inline-image($file-name+'.svg'), none;
8}
9
10@mixin bg-with-svg(
11     $file-name,
12     $css-img-path: $css-img-path,
13     $repeat: no-repeat,
14     $position: 50% 50%,
15     $bg-color: transparent)
16{
17     background: inline-image($file-name+'.png') $repeat, $position, $bg-color;
18     background-image: inline-image($file-name+'.svg'), none;
19}
20
21// Mix from Nico3333 (https://github.com/nico3333fr/ROCSSTI/blob/master/src/css/rocssti-fr.css#L637)
22// and ffood (http://www.ffoodd.fr/cache-cache-css/)
23@mixin visually-hidden {
24     border: 0;
25     clip: rect(0 0 0 0);
26     clip-path: inset(50%);
27     height: 1px;
28     margin: -1px;
29     overflow: hidden;
30     padding: 0;
31     position: absolute;
32     width: 1px;
33     white-space: nowrap;
34}
35@mixin visually-hidden-focus {
36     clip: auto;
37     clip-path: none;
38     height: auto;
39     overflow: visible;
40     position: static;
41     width: auto;
42     white-space: normal;
43}
44
45// Remove any unit from a value
46@function strip-unit(
47     $value)
48{
49     @return $value / ($value * 0 + 1);
50}
51
52// Compute absolute value (in em or rem) depending on font-size of the html element (given in %)
53@function relative-to-screen(
54     $value,             // em or rem value
55     $html-font-size)    // in %
56{
57     @return $value / (strip-unit($html-font-size) / 100);
58}
Note: See TracBrowser for help on using the repository browser.

Sites map