-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.styl
More file actions
116 lines (100 loc) · 1.99 KB
/
Copy pathlib.styl
File metadata and controls
116 lines (100 loc) · 1.99 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
// Create triangle shape
//
// Parameters:
// - width (px)
// - height (px)
// - colour
// - direction (top/bottom/left/right)
//
triangle(w, h, c, d='top')
width 0px
height 0px
border-style solid
if d == 'top'
border-width 0 (w/2) h (w/2)
border-color transparent transparent c transparent
if d == 'bottom'
border-width h (w/2) 0 (w/2)
border-color c transparent transparent transparent
if d == 'left'
border-width (h/2) w (h/2) 0
border-color transparent c transparent transparent
if d == 'right'
border-width (h/2) 0 (h/2) w
border-color transparent transparent transparent c
//
// Create paper shadow like effect
//
// Parameters:
// - bottom (px)
// - height (px)
// - colour
//
paper-shadow(bottom = 20px, height = 15px, color=#333333)
display block
position relative
&:after, &:before
z-index -1
content ''
width 50%
position absolute
top 80%
bottom bottom
box-shadow 0 height 8px color
background white
&:after
transform rotate(3deg)
right 10px
left auto
&:before
transform rotate(-3deg)
left 10px
right auto
//
// Image replacement
//
ir()
&:before
content ''
display block
width 0
height 150%
background-color transparent
border 0
overflow hidden
*text-indent -9999px
//
// Media Queries with fallback for IE
//
// Parameteres:
// - media (media query string)
// - content (mixin)
//
respond-to(media, content, args...)
if $oldie
content(args)
else
@media media
content(args)
//
// Borders
//
// Parameteres:
// - sides (top/left/bottom/right)
// - args (border styles) ex: 1px solid red
//
border-sides(sides, args...)
for side in sides
border-{side} args
//
// MATH Utils
//
// Converts degrees to radians
toRad(degrees)
degrees * PI / 180
// Finds X,Y points based on radius and angle
circleEquationX(start, radius, angle)
start + radius * cos(toRad(angle))
circleEquationY(start, radius, angle)
start + radius * sin(toRad(angle))