common_styles 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ gem_name = File.basename(Dir.pwd)
2
+ require "./lib/#{gem_name}/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.files = `git ls-files`.split
6
+ s.name = gem_name
7
+ s.summary = "Sass stylesheets."
8
+ s.version = CommonStyles::VERSION
9
+
10
+ s.add_development_dependency 'rspec', '~> 2'
11
+ s.add_development_dependency 'simplecov', '~> 0'
12
+ s.add_runtime_dependency 'sass', '~> 3'
13
+ s.author = 'kshramt'
14
+ s.description = "Sass stylesheets."
15
+ s.required_ruby_version = '>= 1.9.0'
16
+ s.test_files.concat `git ls-files spec`.split.select{|path| path =~ /_spec\.rb/}
17
+ end
@@ -0,0 +1,2 @@
1
+ @import shape/plain
2
+ @import color/sepia
@@ -0,0 +1,4 @@
1
+ //@import light_and_clean
2
+ //@import sf
3
+ //@import antique
4
+ @import pdf
@@ -0,0 +1,2 @@
1
+ @import shape/plain
2
+ @import color/light_blue
@@ -0,0 +1 @@
1
+ @import shape/pdf
@@ -0,0 +1,2 @@
1
+ @import shape/3d
2
+ @import color/blue
@@ -0,0 +1,32 @@
1
+ body
2
+ background-color: #444445
3
+
4
+ header, article, footer
5
+ background-color: #f0f0f1
6
+
7
+ h1
8
+ background-color: #000077
9
+ color: #ffffff
10
+
11
+ h2
12
+ background-color: #8888aa
13
+ color: #ffffff
14
+
15
+ h3
16
+ color: #000088
17
+
18
+ h4
19
+ color: #6666aa
20
+
21
+ nav
22
+ li
23
+ $colorList: #8888aa, #444466
24
+ background: linear-gradient($colorList)
25
+ background: -moz-linear-gradient($colorList)
26
+ background: -webkit-gradient(linear, left top, left bottom, from(nth($colorList, 1)), to(nth($colorList, 2)))
27
+ ul li a
28
+ color: #ffffff
29
+
30
+ code, .code
31
+ background-color: #e5e5ff
32
+ color: #000075
@@ -0,0 +1,3 @@
1
+ $basicHue: 202.5
2
+
3
+ @import light_color
@@ -0,0 +1,21 @@
1
+ $light: hsl($basicHue, 100%, 95%)
2
+ $dark: hsl($basicHue, 100%, 50%)
3
+
4
+ pre
5
+ background-color: $light
6
+ border:
7
+ color: hsl(0, 0%, 80%)
8
+
9
+ code
10
+ background-color: $light
11
+
12
+ h1, h2, h3, h4, h5, h6
13
+ color: $dark
14
+
15
+ a
16
+ &:link
17
+ color: $dark
18
+ &:visited
19
+ color: darken($dark, 10%)
20
+ &:hover
21
+ color: adjust_color($dark, $alpha: -0.5)
@@ -0,0 +1,32 @@
1
+ body
2
+ background-color: #464544
3
+
4
+ header, article, footer
5
+ background-color: #f2f1f0
6
+
7
+ h1
8
+ background-color: #c76010
9
+ color: #ffffff
10
+
11
+ h2
12
+ background-color: #ff8038
13
+ color: #ffffff
14
+
15
+ h3
16
+ color: #ff5000
17
+
18
+ h4
19
+ color: #aa7766
20
+
21
+ nav
22
+ li
23
+ $colorList: #ff8038, #c76010
24
+ background: linear-gradient($colorList)
25
+ background: -moz-linear-gradient($colorList)
26
+ background: -webkit-gradient(linear, left top, left bottom, from(nth($colorList, 1)), to(nth($colorList, 2)))
27
+ ul li a
28
+ color: #ffffff
29
+
30
+ code, .code
31
+ background-color: #ffeae5
32
+ color: #752300
@@ -0,0 +1,36 @@
1
+ $maxSaturation: 100%
2
+
3
+ @function basicColor($l)
4
+ @return hsl(22.5, 0.25*$maxSaturation, $l)
5
+
6
+ $onePointColor: adjust_color(basicColor(50%), $saturation: 0.3*$maxSaturation)
7
+
8
+ body
9
+ color: basicColor(1%)
10
+ background-color: basicColor(99%)
11
+
12
+ $codeColor: adjust_color(basicColor(99%), $saturation: $maxSaturation)
13
+ $codeBackgroundColor: $onePointColor
14
+
15
+ pre
16
+ color: $codeColor
17
+ background-color: $codeBackgroundColor
18
+
19
+ code
20
+ color: $codeColor
21
+ background-color: $codeBackgroundColor
22
+
23
+ $c: 1
24
+ @each $v in h1, h2, h3, h4, h5, h6
25
+ $c: -0.9*$c
26
+ #{$v}
27
+ color: basicColor(50% + $c*50%)
28
+ background-color: basicColor(50% - $c*50%)
29
+
30
+ a
31
+ &:link
32
+ color: $onePointColor
33
+ &:visited
34
+ color: adjust_color($onePointColor, $saturation: -0.75*saturation($onePointColor))
35
+ &:hover
36
+ color: adjust_color($onePointColor, $alpha: -0.5)
@@ -0,0 +1,105 @@
1
+ @import init
2
+ @import common
3
+
4
+ body
5
+ width: 780px
6
+ margin: auto
7
+
8
+ header, article, footer
9
+ margin: 20px
10
+ padding: 10px 30px 10px 30px
11
+ border-radius: $commonRadius
12
+ $shadowParam: 3px 5px 8px 7px rgba(30, 10, 0, 0.4)
13
+ box-shadow: $shadowParam
14
+
15
+ p
16
+ line-height: 170%
17
+ margin: 2ex 3ex 2ex 3ex
18
+
19
+ ul
20
+ margine: 1ex 3ex 1ex 3ex
21
+ padding: 10px 30px 10px 30px
22
+ &.attr_prop
23
+ list-style-type: none
24
+
25
+ h1, h2, h3, h4, h5, h6
26
+ font-family: sans-serif
27
+
28
+ h2, h3, h4, h5, h6
29
+ margin-top: 1ex
30
+ margin-bottom: 1ex
31
+
32
+ h1
33
+ text-align: right
34
+ font-size: 1.1em
35
+ padding-right: 7%
36
+ margin-bottom: 2ex
37
+ line-height: 160%
38
+ $borderPara: 0px 0px $commonRadius $commonRadius
39
+ border-radius: $borderPara
40
+
41
+ h2
42
+ text-align: justify
43
+ padding-left: 7%
44
+ line-height: 130%
45
+ border-radius: $commonRadius
46
+ $shadowPara: 2px 2px 5px 2px rgba(30, 10, 0, 0.8)
47
+ box-shadow: $shadowPara
48
+
49
+ nav
50
+ margin: 3ex 0ex 3ex 0ex
51
+ ul
52
+ list-style-type: none
53
+ font-family: sans-serif
54
+ li
55
+ margin: 0.5ex
56
+ float: left
57
+ padding: 0.5ex
58
+ border-radius: $commonRadius
59
+ $shadowPara: 2px 2px 5px 2px rgba(30, 10, 0, 0.8)
60
+ box-shadow: $shadowPara
61
+
62
+ ul li a
63
+ padding: 1ex 0ex 1ex 0ex
64
+ text-decoration: none
65
+ white-space: pre
66
+
67
+ img
68
+ vertical-align: bottom
69
+ &.wide
70
+ width: 100%
71
+
72
+ #news p
73
+ margin-left: 11ex
74
+ text-indent: -8ex
75
+
76
+ table
77
+ &.bus_schedule
78
+ border:
79
+ style: solid
80
+ width: 1px
81
+ tr th, td
82
+ @extend table.bus_schedule
83
+ padding: 1ex
84
+ &.img
85
+ width: 100%
86
+ caption
87
+ caption-side: bottom
88
+
89
+ #search_ac_edu
90
+ border-radius: $commonRadius
91
+
92
+ #headboard
93
+ $radiusPara: $commonRadius $commonRadius 0px 0px
94
+ border-radius: $radiusPara
95
+
96
+ #counter
97
+ text-align: right
98
+
99
+ .code
100
+ margin: 1ex
101
+ padding:
102
+ left: 2ex
103
+ right: 2ex
104
+ top: 0.5ex
105
+ bottom: 0.5ex
@@ -0,0 +1,60 @@
1
+ $commonRadius: 10px
2
+
3
+ =div_multi_clumun($float, $width, $unit: percent)
4
+ $one: 1 // スコープの関係上,ここで宣言しておく必要がある.
5
+ $suffix: ''
6
+ @if $unit == percent
7
+ $one: 1%
8
+ $suffix: ''
9
+ @else if $unit == cm
10
+ $one: 1cm
11
+ $suffix: _#{$unit}
12
+ @else if $unit == mm
13
+ $one: 1mm
14
+ $suffix: _#{$unit}
15
+ @else if $unit == in
16
+ $one: 1in
17
+ $suffix: _#{$unit}
18
+ @else if $unit == px
19
+ $one: 1px
20
+ $suffix: _#{$unit}
21
+ @else if $unit == pt
22
+ $one: 1pt
23
+ $suffix: _#{$unit}
24
+ @else if $unit == ex
25
+ $one: 1ex
26
+ $suffix: _#{$unit}
27
+ @else if $unit == em
28
+ $one: 1em
29
+ $suffix: _#{$unit}
30
+ div.#{$float}_#{$width}#{$suffix}
31
+ float: #{$float}
32
+ width: $width*$one
33
+
34
+ +div_multi_clumun(left, 50)
35
+ +div_multi_clumun(right, 50)
36
+
37
+ .clear
38
+ clear: both
39
+
40
+ body
41
+ text-align: justify
42
+ font-family: serif
43
+ line-height: 150%
44
+
45
+ code, kbd, samp
46
+ white-space: pre
47
+ font-family: monospace
48
+
49
+ .code
50
+ overflow: scroll
51
+
52
+
53
+ img.mail_address
54
+ vertical-align: middle
55
+
56
+ .last_modified
57
+ text-align: center
58
+
59
+ .copyright
60
+ text-align: center
@@ -0,0 +1,7 @@
1
+ @import common_para
2
+
3
+ @charset "utf-8"
4
+
5
+ html, body, div, h1, h2, h3, h4, h5, h6, p, blockquote, pre, address, ul, ol, li, dl, dt, dd, form, fieldset
6
+ margin: 0
7
+ padding: 0
@@ -0,0 +1,76 @@
1
+ @import common
2
+
3
+ body
4
+ background-color: #808080
5
+ width: 900px
6
+ margin: auto
7
+
8
+ $mainTextWidth: 100%
9
+
10
+ p
11
+ width: $mainTextWidth
12
+ margin:
13
+ left: auto
14
+ right: auto
15
+ top: 2ex
16
+
17
+ pre
18
+ width: 0.9 * $mainTextWidth
19
+ margin:
20
+ left: auto
21
+ right: auto
22
+ top: 1ex
23
+ padding:
24
+ top: 1ex
25
+ bottom: 1ex
26
+ left: 2ex
27
+ right: 2ex
28
+ border:
29
+ width: 1px
30
+ style: solid
31
+ radius: 1ex
32
+
33
+ nav
34
+ ul
35
+ list-style-type: none
36
+ li
37
+ margin:
38
+ left: 1ex
39
+ right: 1ex
40
+ float: left
41
+
42
+ img
43
+ width: 100%
44
+
45
+ table
46
+ &.simple
47
+ border:
48
+ style: solid
49
+ width: 1px
50
+ collapse: collapse
51
+ tr
52
+ @extend table.simple
53
+ th, td
54
+ @extend table.simple
55
+ padding: 1ex
56
+ &.gray_soft
57
+ border:
58
+ style: solid
59
+ width: 8px
60
+ color: #eeeeee
61
+ collapse: collapse
62
+ tr
63
+ @extend table.gray_soft
64
+ th, td
65
+ @extend table.gray_soft
66
+ padding: 1ex
67
+
68
+ header
69
+ background-color: white
70
+ padding: 10%
71
+ $shadowParam: 0px 4px 5px 1px rgba(0, 0, 0, 0.8)
72
+ box-shadow: $shadowParam
73
+
74
+ article, footer
75
+ @extend header
76
+ margin-top: 25px
@@ -0,0 +1,54 @@
1
+ @import common
2
+
3
+ body
4
+ width: 80%
5
+ margin: auto
6
+
7
+ $mainTextWidth: 95%
8
+
9
+ p
10
+ width: $mainTextWidth
11
+ margin:
12
+ left: auto
13
+ right: auto
14
+ top: 2ex
15
+
16
+ pre
17
+ width: 0.9 * $mainTextWidth
18
+ margin:
19
+ left: auto
20
+ right: auto
21
+ top: 1ex
22
+ padding:
23
+ top: 1ex
24
+ bottom: 1ex
25
+ left: 2ex
26
+ right: 2ex
27
+ border:
28
+ width: 1px
29
+ style: solid
30
+ radius: 1ex
31
+
32
+ nav
33
+ ul
34
+ list-style-type: none
35
+ li
36
+ padding:
37
+ left: 1ex
38
+ right: 1ex
39
+ margin:
40
+ left: 1px
41
+ right: 1px
42
+ float: left
43
+
44
+ .wide
45
+ width: 100%
46
+
47
+ table
48
+ &.bus_schedule
49
+ border:
50
+ style: solid
51
+ width: 1px
52
+ tr th, td
53
+ @extend table.bus_schedule
54
+ padding: 1ex
@@ -0,0 +1,16 @@
1
+ module CommonStyles
2
+ module Patch
3
+ require 'sass'
4
+
5
+ module ::Sass
6
+ module Script
7
+ module Functions
8
+ def rand_between_0_and(x)
9
+ numeric_transformation(x){|value| rand*value}
10
+ end
11
+ declare :rand_between_0_and, args: [:x]
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module CommonStyles
2
+ module Patch
3
+ require 'common_styles/patch/sass'
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module CommonStyles
2
+ VERSION = '0.0.0'
3
+ end
@@ -0,0 +1,6 @@
1
+ module CommonStyles
2
+ require 'sass/plugin'
3
+ require 'common_styles/patch'
4
+
5
+ ::Sass::Plugin.add_template_location(Gem.datadir('common_styles'))
6
+ end
data/rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ task default: :spec
4
+
5
+ desc "Run specs"
6
+ RSpec::Core::RakeTask.new(:spec){|s|
7
+ s.rspec_opts = '-c'
8
+ }
@@ -0,0 +1,45 @@
1
+ require 'common_styles/patch/sass'
2
+
3
+ describe ::Sass::Script::Functions do
4
+ describe '#rand_between_0_and' do
5
+ before :all do
6
+ class SassScriptFunctionsContainer < Sass::Script::Functions::EvaluationContext
7
+ include ::Sass::Script::Functions
8
+ end
9
+ end
10
+
11
+ context 'outer range > 0' do
12
+ before :each do
13
+ @sass_script_functions_container = SassScriptFunctionsContainer.new({})
14
+ @outer_range = Sass::Script::Number.new(100*rand)
15
+ end
16
+
17
+ 5.times{
18
+ it do
19
+ @sass_script_functions_container.rand_between_0_and(@outer_range).value.should >= 0
20
+ end
21
+
22
+ it do
23
+ @sass_script_functions_container.rand_between_0_and(@outer_range).value.should < @outer_range.value
24
+ end
25
+ }
26
+ end
27
+
28
+ context 'outer range < 0' do
29
+ before :each do
30
+ @sass_script_functions_container = SassScriptFunctionsContainer.new({})
31
+ @outer_range = Sass::Script::Number.new(-100*rand)
32
+ end
33
+
34
+ 5.times{
35
+ it do
36
+ @sass_script_functions_container.rand_between_0_and(@outer_range).value.should <= 0
37
+ end
38
+
39
+ it do
40
+ @sass_script_functions_container.rand_between_0_and(@outer_range).value.should > @outer_range.value
41
+ end
42
+ }
43
+ end
44
+ end
45
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: common_styles
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - kshramt
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &79899090 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '2'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *79899090
25
+ - !ruby/object:Gem::Dependency
26
+ name: simplecov
27
+ requirement: &79898610 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *79898610
36
+ - !ruby/object:Gem::Dependency
37
+ name: sass
38
+ requirement: &79898190 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '3'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *79898190
47
+ description: Sass stylesheets.
48
+ email:
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - common_styles.gemspec
54
+ - data/common_styles/common_styles/include/_antique.sass
55
+ - data/common_styles/common_styles/include/_default.sass
56
+ - data/common_styles/common_styles/include/_light_and_clean.sass
57
+ - data/common_styles/common_styles/include/_pdf.sass
58
+ - data/common_styles/common_styles/include/_sf.sass
59
+ - data/common_styles/common_styles/include/color/_blue.sass
60
+ - data/common_styles/common_styles/include/color/_light_blue.sass
61
+ - data/common_styles/common_styles/include/color/_light_color.sass
62
+ - data/common_styles/common_styles/include/color/_orange.sass
63
+ - data/common_styles/common_styles/include/color/_sepia.sass
64
+ - data/common_styles/common_styles/include/shape/_3d.sass
65
+ - data/common_styles/common_styles/include/shape/_common.sass
66
+ - data/common_styles/common_styles/include/shape/_init.sass
67
+ - data/common_styles/common_styles/include/shape/_pdf.sass
68
+ - data/common_styles/common_styles/include/shape/_plain.sass
69
+ - lib/common_styles.rb
70
+ - lib/common_styles/patch.rb
71
+ - lib/common_styles/patch/sass.rb
72
+ - lib/common_styles/version.rb
73
+ - rakefile
74
+ - spec/common_styles/patch/sass_spec.rb
75
+ homepage:
76
+ licenses: []
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: 1.9.0
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 1.8.11
96
+ signing_key:
97
+ specification_version: 3
98
+ summary: Sass stylesheets.
99
+ test_files:
100
+ - spec/common_styles/patch/sass_spec.rb
101
+ has_rdoc: