north 0.1.0

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.
data/lib/north.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'compass'
2
+ require 'sassy-maps'
3
+
4
+ base_directory = File.join(File.dirname(__FILE__), '..')
5
+ stylesheets_dir = File.join(base_directory, 'north')
6
+ Compass::Frameworks.register("north", :path => base_directory, :stylesheets_directory => stylesheets_dir)
7
+
8
+ module North
9
+ VERSION = "0.1.0"
10
+ DATE = "2013-12-19"
11
+ end
data/north/_north.scss ADDED
@@ -0,0 +1,5 @@
1
+ @import "north/components";
2
+ @import "north/layouts";
3
+ @import "north/aspects";
4
+ @import "north/elements";
5
+ @import "north/states";
@@ -0,0 +1,16 @@
1
+ //////////////////////////////
2
+ // Functions
3
+ //////////////////////////////
4
+ @function aspect($name) {
5
+ @return to-upper-case($name);
6
+ }
7
+
8
+ //////////////////////////////
9
+ // Mixins
10
+ //////////////////////////////
11
+ @mixin aspect($name) {
12
+ @at-root #{&}--#{aspect($name)} {
13
+ @content;
14
+ }
15
+ }
16
+
@@ -0,0 +1,16 @@
1
+ //////////////////////////////
2
+ // Functions
3
+ //////////////////////////////
4
+ @function component($name) {
5
+ @return to-lower-case($name);
6
+ }
7
+
8
+ //////////////////////////////
9
+ // Mixins
10
+ //////////////////////////////
11
+ @mixin component($name) {
12
+ @at-root #{component($name)} {
13
+ @content;
14
+ }
15
+ }
16
+
@@ -0,0 +1,16 @@
1
+ //////////////////////////////
2
+ // Functions
3
+ //////////////////////////////
4
+ @function element($name) {
5
+ @return to-lower-case($name);
6
+ }
7
+
8
+ //////////////////////////////
9
+ // Mixins
10
+ //////////////////////////////
11
+ @mixin element($name) {
12
+ @at-root #{&}--#{element($name)} {
13
+ @content;
14
+ }
15
+ }
16
+
@@ -0,0 +1,67 @@
1
+ //////////////////////////////
2
+ // Variables
3
+ //////////////////////////////
4
+ $north-layout-type: 'simple' !default;
5
+
6
+ //////////////////////////////
7
+ // Functions
8
+ //////////////////////////////
9
+ @function simple-layout($name) {
10
+ @return '_#{to-lower-case($name)}';
11
+ }
12
+
13
+ @function complex-layout($name) {
14
+ @return '__#{to-lower-case($name)}';
15
+ }
16
+
17
+ @function layout($name, $type: $north-layout-type) {
18
+ $type: to-lower-case($type);
19
+ $prefix: null;
20
+
21
+ @if $type == 'simple' {
22
+ @return simple-layout($name);
23
+ }
24
+ @else if $type == 'complex' {
25
+ @return complex-layout($name);
26
+ }
27
+ @else {
28
+ @warn '#{$type} is not a valid North layout type. Please use either `simple` or `complex`';
29
+ @return $name;
30
+ }
31
+ }
32
+
33
+ //////////////////////////////
34
+ // Layout Mixins
35
+ //////////////////////////////
36
+ @mixin simple-layout($name) {
37
+ @at-root .#{simple-layout($name)} {
38
+ @content;
39
+ }
40
+ }
41
+
42
+ @mixin complex-layout($name) {
43
+ @at-root .#{complex-layout($name)} {
44
+ @content;
45
+ }
46
+ }
47
+
48
+ @mixin layout($name, $type: $north-layout-type) {
49
+ $type: to-lower-case($type);
50
+ $prefix: null;
51
+
52
+ @if $type == 'simple' {
53
+ @include simple-layout($name) {
54
+ @content;
55
+ }
56
+ }
57
+ @else if $type == 'complex' {
58
+ @include complex-layout($name) {
59
+ @content;
60
+ }
61
+ }
62
+ @else {
63
+ @warn '#{$type} is not a valid North layout type. Please use either `simple` or `complex`';
64
+ @content;
65
+ }
66
+ }
67
+
@@ -0,0 +1,24 @@
1
+ //////////////////////////////
2
+ // Variables
3
+ //////////////////////////////
4
+ $north-state-contains: false !default;
5
+
6
+ //////////////////////////////
7
+ // Functions
8
+ //////////////////////////////
9
+ @function state($name, $contains: $north-state-contains) {
10
+ $selector: '=';
11
+ @if $contains {
12
+ $selector: '~=';
13
+ }
14
+ @return '[data-state#{$selector}"#{$name}"]';
15
+ }
16
+
17
+ //////////////////////////////
18
+ // Mixins
19
+ //////////////////////////////
20
+ @mixin state($name, $contains: $north-state-contains) {
21
+ @at-root &#{state($name, $contains)} {
22
+ @content;
23
+ }
24
+ }
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: north
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sam Richard
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-19 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.3.0.rc.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.3.0.rc.2
27
+ description: Really simple media queries in Sass
28
+ email:
29
+ - sam@snug.ug
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - README.md
35
+ - CHANGELOG.md
36
+ - lib/north.rb
37
+ - north/_north.scss
38
+ - north/north/_aspects.scss
39
+ - north/north/_components.scss
40
+ - north/north/_elements.scss
41
+ - north/north/_layouts.scss
42
+ - north/north/_states.scss
43
+ homepage: https://github.com/snugug/north
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: 1.3.6
61
+ requirements: []
62
+ rubyforge_project: north
63
+ rubygems_version: 2.0.3
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: An easy to use system for writing and managing media queries.
67
+ test_files: []