-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtext-hide.js
44 lines (43 loc) · 1.05 KB
/
text-hide.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Text Hide
*/
module.exports = function (decl, args, opts) {
var textHideMethod = opts.textHideMethod || 'indent';
if (textHideMethod === 'font') {
decl.replaceWith({
prop: 'font',
value: '0/0 a',
source: decl.source
}, {
prop: 'color',
value: 'transparent',
source: decl.source
}, {
prop: 'text-shadow',
value: 'none',
source: decl.source
}, {
prop: 'background-color',
value: 'transparent',
source: decl.source
}, {
prop: 'border',
value: 0,
source: decl.source
});
} else {
decl.replaceWith({
prop: 'overflow',
value: 'hidden',
source: decl.source
}, {
prop: 'text-indent',
value: '101%',
source: decl.source
}, {
prop: 'white-space',
value: 'nowrap',
source: decl.source
});
}
};