compass-tools 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/lib/compass-tools.rb +6 -0
- data/stylesheets/_compass-tools.scss +6 -0
- data/stylesheets/tools/_retina-sprite.scss +54 -0
- data/stylesheets/tools/_triangle.scss +65 -0
- data/templates/project/demo.html +11 -0
- data/templates/project/manifest.rb +12 -0
- data/templates/project/screen.scss +2 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 371a319e61faa2bf9af16ea3051c7a61359e34a0
|
4
|
+
data.tar.gz: 6057e514d6d1ccd5417050a82fe2935d6a3066a3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ae2bb9d149ad68872bd67f9e1afd1160d9450f8963a01b5e512df5e33932e7e8bfea2cd638e0b7f6652de28cb98db181a5b4ac8be6015e92f09fda56a202d5f6
|
7
|
+
data.tar.gz: 7979c4d222e65a3cd3aa8043d399e507a365d569c243380f54e9f18336df0faf8ed991fd2e3eb2c6d44ff93aa88e1d3519aeb2fafccc738a4934b261da529f0b
|
data/LICENSE
ADDED
File without changes
|
data/README.md
ADDED
File without changes
|
@@ -0,0 +1,54 @@
|
|
1
|
+
@charset "utf-8";
|
2
|
+
|
3
|
+
/*
|
4
|
+
*@Description: 视网膜屏下使用图片精灵
|
5
|
+
*/
|
6
|
+
@mixin retina-sprite($map, $sprite, $horizontal: false, $vertical: false) {
|
7
|
+
|
8
|
+
$width: image-width(sprite-file($map, $sprite));
|
9
|
+
$height: image-height(sprite-file($map, $sprite));
|
10
|
+
|
11
|
+
//$offsetX: ceil(nth(sprite-position($map,$sprite),1)/2);
|
12
|
+
$offsetY: ceil(nth(sprite-position($map,$sprite),2)/2);
|
13
|
+
|
14
|
+
background: sprite-url($map) 0 $offsetY no-repeat;
|
15
|
+
|
16
|
+
//$zoomX: ceil(image-width(sprite-path($map))/2);
|
17
|
+
$zoomX: ceil(sprite-width($map/2));
|
18
|
+
|
19
|
+
$zoomY: auto;
|
20
|
+
|
21
|
+
@include background-size($zoomX $zoomY);
|
22
|
+
|
23
|
+
display: block;
|
24
|
+
width: ceil($width/2)+1;
|
25
|
+
height: ceil($height/2)+1;
|
26
|
+
|
27
|
+
|
28
|
+
// set vertical or horizontal center
|
29
|
+
|
30
|
+
@if $horizontal and $vertical {
|
31
|
+
position: absolute;
|
32
|
+
left: 50%;
|
33
|
+
margin-left: -(round($width/4));
|
34
|
+
|
35
|
+
top: 50%;
|
36
|
+
margin-top: -(round($height/4));
|
37
|
+
}
|
38
|
+
|
39
|
+
@if $horizontal and not $vertical {
|
40
|
+
position: absolute;
|
41
|
+
left: 50%;
|
42
|
+
margin-left: -(round($width/4));
|
43
|
+
|
44
|
+
top: 0;
|
45
|
+
}
|
46
|
+
|
47
|
+
@if not $horizontal and $vertical {
|
48
|
+
position: absolute;
|
49
|
+
left: 0;
|
50
|
+
|
51
|
+
top: 50%;
|
52
|
+
margin-top: -(round($height/4));
|
53
|
+
}
|
54
|
+
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
@charset "utf-8";
|
2
|
+
|
3
|
+
/*
|
4
|
+
*@Description: css绘制三角形
|
5
|
+
*/
|
6
|
+
|
7
|
+
@mixin triangle ($triangle-size: 10px, $triangle-color: #000, $triangle-direction: top, $triangle-thin: false) {
|
8
|
+
|
9
|
+
display: block;
|
10
|
+
width: 0;
|
11
|
+
height: 0;
|
12
|
+
|
13
|
+
@if $triangle-thin {
|
14
|
+
|
15
|
+
@if $triangle-direction == top {
|
16
|
+
border-left: $triangle-size solid transparent;
|
17
|
+
border-right: $triangle-size solid transparent;
|
18
|
+
border-bottom: $triangle-size solid $triangle-color;
|
19
|
+
}
|
20
|
+
|
21
|
+
@if $triangle-direction == bottom {
|
22
|
+
border-left: $triangle-size solid transparent;
|
23
|
+
border-right: $triangle-size solid transparent;
|
24
|
+
border-top: $triangle-size solid $triangle-color;
|
25
|
+
}
|
26
|
+
|
27
|
+
@if $triangle-direction == left {
|
28
|
+
border-top: $triangle-size solid transparent;
|
29
|
+
border-right: $triangle-size solid $triangle-color;
|
30
|
+
border-bottom: $triangle-size solid transparent;
|
31
|
+
}
|
32
|
+
|
33
|
+
@if $triangle-direction == right {
|
34
|
+
border-left: $triangle-size solid $triangle-color;
|
35
|
+
border-top: $triangle-size solid transparent;
|
36
|
+
border-bottom: $triangle-size solid transparent;
|
37
|
+
}
|
38
|
+
|
39
|
+
} @else {
|
40
|
+
|
41
|
+
@if $triangle-direction == top {
|
42
|
+
border-left: $triangle-size/2 solid transparent;
|
43
|
+
border-right: $triangle-size/2 solid transparent;
|
44
|
+
border-bottom: $triangle-size solid $triangle-color;
|
45
|
+
}
|
46
|
+
|
47
|
+
@if $triangle-direction == bottom {
|
48
|
+
border-left: $triangle-size/2 solid transparent;
|
49
|
+
border-right: $triangle-size/2 solid transparent;
|
50
|
+
border-top: $triangle-size solid $triangle-color;
|
51
|
+
}
|
52
|
+
|
53
|
+
@if $triangle-direction == left {
|
54
|
+
border-top: $triangle-size/2 solid transparent;
|
55
|
+
border-right: $triangle-size solid $triangle-color;
|
56
|
+
border-bottom: $triangle-size/2 solid transparent;
|
57
|
+
}
|
58
|
+
|
59
|
+
@if $triangle-direction == right {
|
60
|
+
border-left: $triangle-size solid $triangle-color;
|
61
|
+
border-top: $triangle-size/2 solid transparent;
|
62
|
+
border-bottom: $triangle-size/2 solid transparent;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Make sure you list all the project template files here in the manifest.
|
2
|
+
stylesheet 'screen.sass', :media => 'screen, projection'
|
3
|
+
|
4
|
+
stylesheet 'screen.scss', :media => 'screen, projection'
|
5
|
+
html 'demo.html'
|
6
|
+
image 'screenshot.png'
|
7
|
+
description "compass tools"
|
8
|
+
help "This will install a demo (HTML and Scss) to show you how to use compass-tools"
|
9
|
+
welcome_message %Q{
|
10
|
+
Example usage: div { @include triangle()}
|
11
|
+
See demo.html and demo.scss for example usage.
|
12
|
+
}
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: compass-tools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lore-w
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sass
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.4.8
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.4.8
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: compass
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.3
|
41
|
+
description: compass-tools
|
42
|
+
email:
|
43
|
+
- metro-cpu@hotmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- LICENSE
|
49
|
+
- README.md
|
50
|
+
- lib/compass-tools.rb
|
51
|
+
- stylesheets/_compass-tools.scss
|
52
|
+
- stylesheets/tools/_retina-sprite.scss
|
53
|
+
- stylesheets/tools/_triangle.scss
|
54
|
+
- templates/project/demo.html
|
55
|
+
- templates/project/manifest.rb
|
56
|
+
- templates/project/screen.scss
|
57
|
+
homepage: ''
|
58
|
+
licenses: []
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.2.2
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: compass-tools
|
80
|
+
test_files: []
|