-
Notifications
You must be signed in to change notification settings - Fork 3
/
aprs-symbols.scss
57 lines (49 loc) · 1.42 KB
/
aprs-symbols.scss
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
$sizes: 24, 48, 64, 128;
$tables: 0, 1;
$table_template: "aprs-symbols-SIZE-TABLE.png";
$rows: 5;
$columns: 15;
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
%aprs-table {
display: inline-block;
margin: 0 0 -8px;
padding: 0;
}
@each $table in $tables {
@each $size in $sizes {
i.aprs-table#{$table}-#{$size} {
@extend %aprs-table;
background: url(str-replace(str-replace($table_template, 'TABLE', $table), 'SIZE', $size)) no-repeat;
width: #{$size}px;
height: #{$size}px;
}
}
i.aprs-table#{$table} {
@extend %aprs-table;
background: url(str-replace(str-replace($table_template, 'TABLE', $table), 'SIZE', '24')) no-repeat;
width: 24px;
height: 24px;
}
}
@for $row from 0 through $rows {
@for $column from 0 through $columns {
@each $size in $sizes {
i.aprs-address-#{$size}-#{$row}-#{$column} {
$row-offset: $row * $size;
$column-offset: $column * $size;
background-position: -#{$column-offset}px -#{$row-offset}px;
}
}
i.aprs-address-#{$row}-#{$column} {
$row-offset: $row * 24;
$column-offset: $column * 24;
background-position: -#{$column-offset}px -#{$row-offset}px;
}
}
}