Skip to content

Commit ac0cfd8

Browse files
committed
Functions and Mixin documentation last part
1 parent 9a5084a commit ac0cfd8

15 files changed

+152
-84
lines changed

src/scss/02-tools/_f-column.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* ------------------------------------------------------------------------------------
3636
*
37-
* 2/ Column full - Make a column that return a percent value of the full width container (100%) minus mobile external gutter width * 2
37+
* 3/ Column full - Make a column that return a percent value of the full width container (100%) minus mobile external gutter width * 2
3838
*
3939
* @author Nicolas Langle
4040
*

src/scss/02-tools/_m-invisible-scrollbar.scss

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/scss/02-tools/_m-line-clamp.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* }
1414
*
1515
*/
16+
1617
@mixin line-clamp($lines: 2) {
1718
display: -webkit-box;
1819
overflow: hidden;

src/scss/02-tools/_m-placeholder-media.scss

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
@use "sass:math";
22

33
/**
4-
* Placeholder media
4+
* Placeholder media. Make placeholder for images or videos
5+
*
6+
* @author Nicolas Langle
7+
*
8+
* @param $width
9+
* @param $height
10+
* @param $targets
11+
* @param $object-fit
12+
*
13+
* Examples :
14+
*
15+
* .placeholder-media {
16+
* @include placeholder-media($width: 800px, $height: 400px, $object-fit: cover);
17+
* }
18+
*
519
*/
620

721
@mixin placeholder-media($width, $height, $targets: "img", $object-fit: "") {

src/scss/02-tools/_m-reduced-motion.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
/**
2-
* Reduced-motion
2+
* Reduced-motion for animations
33
*
4-
* exemples :
4+
* @author Paolo Tesei
5+
*
6+
* @param $reduce
7+
*
8+
* Examples :
59
*
610
* @include reduced-motion { ... }
711
* return @media screen and (prefers-reduced-motion : reduce) { ... }
@@ -10,17 +14,15 @@
1014
*
1115
* @include reduced-motion (false) { ... }
1216
* return @media screen and (prefers-reduced-motion : no-preference) { ... }
17+
*
1318
*/
1419

15-
@mixin reduced-motion ($reduce: true) {
16-
20+
@mixin reduced-motion($reduce: true) {
1721
@if ($reduce == true) {
18-
1922
@media screen and (prefers-reduced-motion: reduce) {
2023
@content;
2124
}
2225
} @else {
23-
2426
@media screen and (prefers-reduced-motion: no-preference) {
2527
@content;
2628
}

src/scss/02-tools/_m-row-fullwidth.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
/**
2-
* Row fullwidth
2+
* Row fullwidth - Make a row fullwidth in a container element
3+
*
4+
* @author Nicolas Langle
5+
*
6+
* @param $position
7+
*
8+
* Examples :
9+
*
10+
* .test {
11+
* @include row-fullwidth();
12+
* }
13+
*
314
*/
415

516
@mixin row-fullwidth($position: relative) {

src/scss/02-tools/_m-rtl.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
// Support for rtl text, explicit support for Arabic and Hebrew
1+
/**
2+
* Support for rtl text, explicit support for Arabic and Hebrew
3+
*
4+
* @author Cédric Andrietti
5+
*
6+
* Examples :
7+
*
8+
* .my-element {
9+
* @include rtl() {
10+
* ... your css
11+
* }
12+
* }
13+
*
14+
*/
215

316
@mixin rtl {
417
*[dir="rtl"] &,

src/scss/02-tools/_m-scrollbar.scss

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
/**
2-
* Scrollbar invisible
2+
* Scrollbar - Make an invisible scrollbar and custom the scrollbar color
3+
*
4+
* ALERT : Don't use this mixin neither on the html element, nor on the body element to avoid deteriorating the accessibility
5+
*
6+
* @author Milan Ricoul
7+
*
8+
* 1/ Invisible scrollbar
9+
*
10+
* Examples :
11+
*
12+
* .my-scrollbar {
13+
* @include scrollbar-invisible;
14+
* }
15+
*
16+
* ------------------------------------------------------------------------
17+
*
18+
* 1/ Scrollbar color
19+
*
20+
* @param $size
21+
* @param $scrollbar-color
22+
* @param $track-color
23+
*
24+
* Examples :
25+
*
26+
* .my-scrollbar-custom {
27+
* @include scrollbar-color(10px, $color-primary, $color-dark);
28+
* }
329
*
4-
* /!\ ALERT : Don't use this mixin neither on the html element, nor on the body element to avoid deteriorating accessibility
530
*/
631

732
@mixin scrollbar-invisible {
@@ -13,10 +38,6 @@
1338
}
1439
}
1540

16-
/**
17-
* Scrollbar color
18-
*/
19-
2041
@mixin scrollbar-color($size, $scrollbar-color, $track-color) {
2142
&::-webkit-scrollbar {
2243
display: none;

src/scss/02-tools/_m-select-custom.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
/**
44
* Select custom
5+
*
6+
* @author Nicolas Langle
7+
*
8+
* Examples :
9+
*
10+
* select {
11+
* @include select-custom;
12+
* }
13+
*
514
*/
615

716
@mixin select-custom {

src/scss/02-tools/_m-sr-only.scss

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
1-
/*
2-
Improved screen reader only CSS class
3-
@see https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
4-
@author Gaël Poupard
5-
@note Based on Yahoo!'s technique
6-
@author Thierry Koblentz
7-
@see https://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html
8-
* 1.
9-
@note `clip` is deprecated but works everywhere
10-
@see https://developer.mozilla.org/en-US/docs/Web/CSS/clip
11-
* 2.
12-
@note `clip-path` is the future-proof version, but not very well supported yet
13-
@see https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path
14-
@see http://caniuse.com/#search=clip-path
15-
@author Yvain Liechti
16-
@see https://twitter.com/ryuran78/status/778943389819604992
17-
* 3.
18-
@note preventing text to be condensed
19-
author J. Renée Beach
20-
@see https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
21-
@note Drupal 8 goes with word-wrap: normal instead
22-
@see https://www.drupal.org/node/2045151
23-
@see http://cgit.drupalcode.org/drupal/commit/?id=5b847ea
24-
* 4.
25-
@note !important is important
26-
@note Obviously you wanna hide something
27-
@author Harry Roberts
28-
@see https://csswizardry.com/2016/05/the-importance-of-important/
29-
*/
1+
/**
2+
* Improved screen reader only CSS class
3+
* Source : https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
4+
*
5+
* 1.
6+
* @note `clip` is deprecated but works everywhere
7+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/clip
8+
*
9+
* 2.
10+
* @note `clip-path` is the future-proof version, but not very well supported yet
11+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path
12+
* @see http://caniuse.com/#search=clip-path
13+
* @author Yvain Liechti
14+
* @see https://twitter.com/ryuran78/status/778943389819604992
15+
*
16+
* 3.
17+
* @note preventing text to be condensed
18+
* author J. Renée Beach
19+
* @see https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
20+
* @note Drupal 8 goes with word-wrap: normal instead
21+
* @see https://www.drupal.org/node/2045151
22+
* @see http://cgit.drupalcode.org/drupal/commit/?id=5b847ea
23+
*
24+
* 4.
25+
* @note !important is important
26+
* @note Obviously you wanna hide something
27+
* @author Harry Roberts
28+
* @see https://csswizardry.com/2016/05/the-importance-of-important/
29+
*
30+
* @param $focusable
31+
*
32+
* Examples :
33+
*
34+
* my-sr-element {
35+
* @include sr-only();
36+
* }
37+
*
38+
* my-sr-element-focusable {
39+
* @include sr-only(true);
40+
* }
41+
*
42+
*/
3043

3144
@mixin sr-only($focusable: false) {
3245
position: absolute;

0 commit comments

Comments
 (0)