Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit b396959

Browse files
committed
Use one line comments instead of multiline to prevent appearing comments in compiled code
1 parent 2a007f0 commit b396959

File tree

1 file changed

+33
-53
lines changed

1 file changed

+33
-53
lines changed

line-clamping.styl

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,32 @@
1-
/**
2-
* @author Zino Roman <zino.roman95@gmail.com>
3-
* @copyright Zino Roman 2017
4-
*/
1+
// @author Zino Roman <zino.roman95@gmail.com>
2+
// @copyright Zino Roman 2017
3+
4+
5+
// interface I-line-clamping {
6+
// lines: number,
7+
// line-height: css-unit,
8+
// font-size: css-unit,
9+
// is-inline: boolean;
10+
// }
511

6-
/**
7-
interface I-line-clamping {
8-
lines: number,
9-
line-height: css-unit,
10-
font-size: css-unit,
11-
is-inline: boolean;
12-
}
13-
*/
1412

15-
/**
16-
* Mixin for clamping multiline text
17-
* @param {I-line-clamping|number} $user-options
18-
*/
13+
// Mixin for clamping multiline text
14+
// @param {I-line-clamping|number} $user-options
1915
line-clamping($user-options)
20-
/**
21-
* @return {string} - Type of the `line-height` property
22-
*/
16+
// @return {string} - Type of the `line-height` property
2317
get-line-height-type()
2418
typeof($options['line-height'])
2519

26-
/**
27-
* @return {string} - Unit of the `line-height` property
28-
*/
20+
// @return {string} - Unit of the `line-height` property
2921
get-line-height-unit()
3022
unit($options['line-height'])
3123

32-
/**
33-
* @return {string} - Unit of the `font-size` property
34-
*/
24+
// @return {string} - Unit of the `font-size` property
3525
get-font-size-type()
3626
typeof($options['font-size'])
37-
38-
/**
39-
* @param {string} $line-height-unit - Unit of the `line-height` property
40-
* @return {boolean} - Is `$line-height-unit` relative
41-
*/
27+
28+
// @param {string} $line-height-unit - Unit of the `line-height` property
29+
// @return {boolean} - Is `$line-height-unit` relative
4230
is-line-height-unit-relative($line-height-unit)
4331
if $line-height-unit == '' or $line-height-unit == '%' or $line-height-unit == 'em'
4432
true
@@ -55,19 +43,18 @@ line-clamping($user-options)
5543
$line-height-unit = get-line-height-unit()
5644
$is-line-height-unit-relative = is-line-height-unit-relative($line-height-unit)
5745

58-
/* Unitless, percents or ems units require
59-
a different strategy of calculation than all other units */
46+
// Unitless, percents or ems units require
47+
// a different strategy of calculation than all other units
6048
if $is-line-height-unit-relative && $is-line-height-type-unit
6149
$line-height-computed = $options['line-height']
6250

6351
if $line-height-unit == '%'
6452
//Divide `$line-height` in percents by 100 for correct further calculation
6553
$line-height-computed = $options['line-height'] / 100
6654

67-
/*
68-
Remove units from `$line-height` to avoid potential error
69-
when `$line-height` and `$font-size` have differents CSS units
70-
*/
55+
56+
// Remove units from `$line-height` to avoid potential error
57+
// when `$line-height` and `$font-size` have differents CSS units
7158
$line-height-computed = unit($line-height-computed, '')
7259

7360
//Calculate our max-height for the element
@@ -81,24 +68,19 @@ line-clamping($user-options)
8168
'calc((%s) * %s)' % (get-calc-inner-value($options['line-height']) $options['lines'])
8269

8370

84-
/**
85-
* @param {string} $display - CSS value of display property
86-
*/
71+
// @param {string} $display - CSS value of display property
8772
strategy-one-line($display)
88-
/* If we need only one line of the text,
89-
then better way is to use `text-overflow: ellipsis`
90-
than `strategy-few-line()` way
91-
cause it has wider support
92-
*/
73+
// If we need only one line of the text,
74+
// then better way is to use `text-overflow: ellipsis`
75+
// than `strategy-few-line()` way
76+
// cause it has wider support
9377
display $display
9478
overflow hidden
9579
text-overflow ellipsis
9680
white-space nowrap
9781

98-
/**
99-
* @param {string} $display - CSS value of display property
100-
* @param {string} $display-webkit - CSS value of display property
101-
*/
82+
// @param {string} $display - CSS value of display property
83+
// @param {string} $display-webkit - CSS value of display property
10284
strategy-few-line($display, $display-webkit)
10385
//Rules for IE, Edge, Firefox
10486
display $display
@@ -114,8 +96,8 @@ line-clamping($user-options)
11496
-webkit-line-clamp: $options['lines']
11597

11698
get-display()
117-
/* Remember the fact, that you should set `width` of the element
118-
when you are using `$options['is-inline']` display mode */
99+
// Remember the fact, that you should set `width` of the element
100+
// when you are using `$options['is-inline']` display mode
119101
if $options['is-inline']
120102
inline-block
121103
else
@@ -136,9 +118,7 @@ line-clamping($user-options)
136118
else
137119
strategy-few-line($display, $display-webkit)
138120

139-
/**
140-
* @param {string} $message - Error message that will be shown
141-
*/
121+
// @param {string} $message - Error message that will be shown
142122
show-error($message)
143123
error('Error in line-clamping.styl: ' + $message)
144124

0 commit comments

Comments
 (0)