kayessess 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -0
- data/app/assets/javascripts/kayessess.js.coffee +1 -0
- data/app/assets/javascripts/kss.coffee +60 -0
- data/app/assets/stylesheets/_constants.scss +38 -0
- data/app/assets/stylesheets/kayessess.css.scss +34 -0
- data/app/assets/stylesheets/layout/_footer.scss +3 -0
- data/app/assets/stylesheets/layout/_header.scss +6 -0
- data/app/assets/stylesheets/layout/_main.scss +4 -0
- data/app/assets/stylesheets/layout/_masthead.scss +8 -0
- data/app/assets/stylesheets/layout/_navigation.scss +11 -0
- data/app/assets/stylesheets/lib/_base.scss +25 -0
- data/app/assets/stylesheets/lib/_functions.scss +27 -0
- data/app/assets/stylesheets/lib/_mixins.scss +64 -0
- data/app/assets/stylesheets/lib/_reset.scss +207 -0
- data/app/assets/stylesheets/lib/_spacing.scss +17 -0
- data/app/assets/stylesheets/lib/_syntax.scss +73 -0
- data/app/assets/stylesheets/modules/_examples.scss +38 -0
- data/app/assets/stylesheets/modules/_section.scss +108 -0
- data/app/controllers/kayessess/application_controller.rb +21 -0
- data/app/controllers/kayessess/sections_controller.rb +32 -0
- data/app/helpers/kayessess/styleguide_helper.rb +40 -0
- data/app/views/kayessess/common/_section_example.html.erb +17 -0
- data/app/views/kayessess/sections/_node.html.erb +11 -0
- data/app/views/kayessess/sections/_section.html.erb +30 -0
- data/app/views/kayessess/sections/example.html.erb +1 -0
- data/app/views/kayessess/sections/index.html.erb +8 -0
- data/app/views/kayessess/sections/show.html.erb +1 -0
- data/app/views/kayessess/styleguides/show.html.erb +3 -0
- data/app/views/layouts/kayessess/application.html.erb +23 -0
- data/app/views/layouts/kayessess/example.html.erb +14 -0
- data/config/routes.rb +7 -0
- data/lib/kayessess.rb +26 -0
- data/lib/kayessess/engine.rb +5 -0
- data/lib/kayessess/node.rb +52 -0
- data/lib/kayessess/section.rb +47 -0
- data/lib/kayessess/section_example.rb +36 -0
- data/lib/kayessess/styleguide.rb +32 -0
- data/lib/kayessess/tree.rb +88 -0
- data/lib/kayessess/version.rb +4 -0
- data/spec/internal/app/assets/stylesheets/_buttons.scss +42 -0
- data/spec/internal/app/assets/stylesheets/_media.scss +47 -0
- data/spec/internal/app/assets/stylesheets/application.css.scss +4 -0
- data/spec/internal/config/database.yml +3 -0
- data/spec/internal/config/routes.rb +3 -0
- data/spec/internal/db/schema.rb +3 -0
- data/spec/internal/log/test.log +4783 -0
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_button.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_clearfix.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_font-family.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_hide-text.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_html5-input-types.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_position.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_prefixer.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_retina-image.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_size.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_timing-functions.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/12e26da9dc8e29bde6b3bdb4173aa411e3614e29/_triangle.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/2049046df5e7b3a94767f06ad9d0d0796114b6dd/_new-breakpoint.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/2049046df5e7b3a94767f06ad9d0d0796114b6dd/_private.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/2049046df5e7b3a94767f06ad9d0d0796114b6dd/_px-to-em.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_compact.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_flex-grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_grid-width.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_linear-gradient.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_modular-scale.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_px-to-em.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_radial-gradient.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_tint-shade.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/44d6d1a16e832c1fcf2a0d1a6167325825c3eb0d/_transition-property-name.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4dfc8659f6b1555d2eca193102c23305a928b168/_bourbon-deprecated-upcoming.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4dfc8659f6b1555d2eca193102c23305a928b168/_bourbon.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/5a6e588d52ee67e6c609e7701c027b0390d36093/_base.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/5a6e588d52ee67e6c609e7701c027b0390d36093/_functions.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/5a6e588d52ee67e6c609e7701c027b0390d36093/_mixins.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/5a6e588d52ee67e6c609e7701c027b0390d36093/_reset.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/5a6e588d52ee67e6c609e7701c027b0390d36093/_spacing.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_animation.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_appearance.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_backface-visibility.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_background-image.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_background.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_border-image.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_border-radius.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_box-sizing.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_columns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_flex-box.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_font-face.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_hidpi-media-query.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_image-rendering.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_inline-block.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_keyframes.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_linear-gradient.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_perspective.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_placeholder.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_radial-gradient.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_transform.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_transition.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/6c489dba74c0c65c297abb80b17831eede932610/_user-select.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/751df40b886f0883d824c8a32ad7e1b78a63ef31/_neat-helpers.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/751df40b886f0883d824c8a32ad7e1b78a63ef31/_neat.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_fill-parent.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_media.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_omega.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_outer-container.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_pad.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_private.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_reset.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_row.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_shift.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_span-columns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_to-deprecate.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/9833bdec3b1a6019a06dfc84df9a7abf85e8c6a5/_visual-grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/a28048e3433aec44160545a405511793e0520b02/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/a28048e3433aec44160545a405511793e0520b02/_visual-grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/a41979aab5bf44efb1e4880ffea764e10d77f1fa/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/a41979aab5bf44efb1e4880ffea764e10d77f1fa/_media.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/a41979aab5bf44efb1e4880ffea764e10d77f1fa/application.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/abed7ee14e15589abcbd11bec0e030a0de712857/_deprecated-webkit-gradient.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/abed7ee14e15589abcbd11bec0e030a0de712857/_gradient-positions-parser.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/abed7ee14e15589abcbd11bec0e030a0de712857/_linear-positions-parser.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/abed7ee14e15589abcbd11bec0e030a0de712857/_radial-arg-parser.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/abed7ee14e15589abcbd11bec0e030a0de712857/_radial-positions-parser.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/abed7ee14e15589abcbd11bec0e030a0de712857/_render-gradients.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/abed7ee14e15589abcbd11bec0e030a0de712857/_shape-size-stripper.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/edf5faa858343614be55813ea5a7f1135eb25f5a/_constants.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/edf5faa858343614be55813ea5a7f1135eb25f5a/styleguide.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0c29d0fb2c8b827e458f500e8ae74379 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/34033ab56926764fc4b0479691b702cb +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7cd1aef370557f982ef64885342d2534 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8ab512c9b33ac90e699b73469d71f061 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bcca522c6302f184f12fe0e8a7d7e71a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c13fc73ceafa45876a901b3e775b83ae +0 -0
- data/spec/lib/node_spec.rb +101 -0
- data/spec/lib/section_spec.rb +47 -0
- data/spec/lib/styleguide_spec.rb +19 -0
- data/spec/lib/tree_spec.rb +60 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/use_coveralls.rb +2 -0
- data/spec/use_simplecov.rb +15 -0
- metadata +567 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
$_spacing_methods: padding, margin;
|
2
|
+
$_spacing_sizes: tight, medium, wide, superwide;
|
3
|
+
$_spacing_directions: false, top, right, bottom, left;
|
4
|
+
|
5
|
+
@for $k from 1 through length($_spacing_methods) {
|
6
|
+
@for $j from 1 through length($_spacing_sizes) {
|
7
|
+
@for $i from 1 through length($_spacing_directions) {
|
8
|
+
$method: nth($_spacing_methods, $k);
|
9
|
+
$size: nth($_spacing_sizes, $j);
|
10
|
+
$direction: nth($_spacing_directions, $i);
|
11
|
+
|
12
|
+
.#{implode('-', $method, $size, $direction)} {
|
13
|
+
@include spacing($method, $size, $direction);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
.kayessess__example__code > {
|
2
|
+
.highlight, code {
|
3
|
+
color: #4d4d4c;
|
4
|
+
font-family: Meslo, Menlo, monospace;
|
5
|
+
}
|
6
|
+
}
|
7
|
+
|
8
|
+
.kayessess__example__code > .highlight {
|
9
|
+
.hll { background-color: #d6d6d6 }
|
10
|
+
.c { color: #8e908c } /* Comment */
|
11
|
+
.err { color: #c82829 } /* Error */
|
12
|
+
.k { color: #8959a8 } /* Keyword */
|
13
|
+
.l { color: #f5871f } /* Literal */
|
14
|
+
.n { color: #4d4d4c } /* Name */
|
15
|
+
.o { color: #3e999f } /* Operator */
|
16
|
+
.p { color: #4d4d4c } /* Punctuation */
|
17
|
+
.cm { color: #8e908c } /* Comment.Multiline */
|
18
|
+
.cp { color: #8e908c } /* Comment.Preproc */
|
19
|
+
.c1 { color: #8e908c } /* Comment.Single */
|
20
|
+
.cs { color: #8e908c } /* Comment.Special */
|
21
|
+
.gd { color: #c82829 } /* Generic.Deleted */
|
22
|
+
.ge { font-style: italic } /* Generic.Emph */
|
23
|
+
.gh { color: #4d4d4c; font-weight: bold } /* Generic.Heading */
|
24
|
+
.gi { color: #718c00 } /* Generic.Inserted */
|
25
|
+
.gp { color: #8e908c; font-weight: bold } /* Generic.Prompt */
|
26
|
+
.gs { font-weight: bold } /* Generic.Strong */
|
27
|
+
.gu { color: #3e999f; font-weight: bold } /* Generic.Subheading */
|
28
|
+
.kc { color: #8959a8 } /* Keyword.Constant */
|
29
|
+
.kd { color: #8959a8 } /* Keyword.Declaration */
|
30
|
+
.kn { color: #3e999f } /* Keyword.Namespace */
|
31
|
+
.kp { color: #8959a8 } /* Keyword.Pseudo */
|
32
|
+
.kr { color: #8959a8 } /* Keyword.Reserved */
|
33
|
+
.kt { color: #eab700 } /* Keyword.Type */
|
34
|
+
.ld { color: #718c00 } /* Literal.Date */
|
35
|
+
.m { color: #f5871f } /* Literal.Number */
|
36
|
+
.s { color: #718c00 } /* Literal.String */
|
37
|
+
.na { color: #4271ae } /* Name.Attribute */
|
38
|
+
.nb { color: #4d4d4c } /* Name.Builtin */
|
39
|
+
.nc { color: #eab700 } /* Name.Class */
|
40
|
+
.no { color: #c82829 } /* Name.Constant */
|
41
|
+
.nd { color: #3e999f } /* Name.Decorator */
|
42
|
+
.ni { color: #4d4d4c } /* Name.Entity */
|
43
|
+
.ne { color: #c82829 } /* Name.Exception */
|
44
|
+
.nf { color: #4271ae } /* Name.Function */
|
45
|
+
.nl { color: #4d4d4c } /* Name.Label */
|
46
|
+
.nn { color: #eab700 } /* Name.Namespace */
|
47
|
+
.nx { color: #4271ae } /* Name.Other */
|
48
|
+
.py { color: #4d4d4c } /* Name.Property */
|
49
|
+
.nt { color: #3e999f } /* Name.Tag */
|
50
|
+
.nv { color: #c82829 } /* Name.Variable */
|
51
|
+
.ow { color: #3e999f } /* Operator.Word */
|
52
|
+
.w { color: #4d4d4c } /* Text.Whitespace */
|
53
|
+
.mf { color: #f5871f } /* Literal.Number.Float */
|
54
|
+
.mh { color: #f5871f } /* Literal.Number.Hex */
|
55
|
+
.mi { color: #f5871f } /* Literal.Number.Integer */
|
56
|
+
.mo { color: #f5871f } /* Literal.Number.Oct */
|
57
|
+
.sb { color: #718c00 } /* Literal.String.Backtick */
|
58
|
+
.sc { color: #4d4d4c } /* Literal.String.Char */
|
59
|
+
.sd { color: #8e908c } /* Literal.String.Doc */
|
60
|
+
.s2 { color: #718c00 } /* Literal.String.Double */
|
61
|
+
.se { color: #f5871f } /* Literal.String.Escape */
|
62
|
+
.sh { color: #718c00 } /* Literal.String.Heredoc */
|
63
|
+
.si { color: #f5871f } /* Literal.String.Interpol */
|
64
|
+
.sx { color: #718c00 } /* Literal.String.Other */
|
65
|
+
.sr { color: #718c00 } /* Literal.String.Regex */
|
66
|
+
.s1 { color: #718c00 } /* Literal.String.Single */
|
67
|
+
.ss { color: #718c00 } /* Literal.String.Symbol */
|
68
|
+
.bp { color: #4d4d4c } /* Name.Builtin.Pseudo */
|
69
|
+
.vc { color: #c82829 } /* Name.Variable.Class */
|
70
|
+
.vg { color: #c82829 } /* Name.Variable.Global */
|
71
|
+
.vi { color: #c82829 } /* Name.Variable.Instance */
|
72
|
+
.il { color: #f5871f } /* Literal.Number.Integer.Long */
|
73
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
.kayessess__examples {
|
2
|
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAAAAACo4kLRAAAAF0lEQVR4AWP4Dwff4WBoCyKYCOkhLQgAy9OIQG/ubwsAAAAASUVORK5CYII=');
|
3
|
+
}
|
4
|
+
|
5
|
+
.kayessess__examples__example {
|
6
|
+
@include clearfix;
|
7
|
+
|
8
|
+
position: relative;
|
9
|
+
}
|
10
|
+
|
11
|
+
.kayessess__examples__example > .kayessess__code {
|
12
|
+
position: absolute;
|
13
|
+
top: 10px;
|
14
|
+
right: 0;
|
15
|
+
background-color: $blue;
|
16
|
+
color: #fff;
|
17
|
+
font-size: 10px;
|
18
|
+
padding: 6px;
|
19
|
+
letter-spacing: 0.05em;
|
20
|
+
border-radius: 2px;
|
21
|
+
}
|
22
|
+
|
23
|
+
.kayessess__example__code {
|
24
|
+
@extend .padding-medium;
|
25
|
+
@extend .padding-wide-top;
|
26
|
+
|
27
|
+
font-size: 12px;
|
28
|
+
border-top: 2px solid #e5e5e5;
|
29
|
+
}
|
30
|
+
|
31
|
+
.kayessess__example__code__heading {
|
32
|
+
@extend .padding-medium-left;
|
33
|
+
@extend .padding-medium-right;
|
34
|
+
@extend .padding-medium-bottom;
|
35
|
+
|
36
|
+
text-transform: uppercase;
|
37
|
+
font-weight: bold;
|
38
|
+
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
.kayessess__section {
|
2
|
+
@extend .margin-wide-bottom;
|
3
|
+
@extend .padding-wide-bottom;
|
4
|
+
@extend .padding-wide-top;
|
5
|
+
|
6
|
+
clear: both;
|
7
|
+
|
8
|
+
&.is-transparent {
|
9
|
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///5kzZxiAGMgCCCAGFB5AADGCRBgYzp49CyRZIJSxsTGQBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwBiAz+yKSKSCQAAAABJRU5ErkJggg==');
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
.kayessess__section__header {
|
14
|
+
@extend .padding-wide-left;
|
15
|
+
@extend .padding-wide-right;
|
16
|
+
}
|
17
|
+
|
18
|
+
.kayessess__breadcrumb {
|
19
|
+
@for $i from 1 through 5 {
|
20
|
+
$x: 5 - $i;
|
21
|
+
a:nth-last-child(#{$x}) { opacity: (1.0 - $x * 0.2); }
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
.kayessess__breadcrumb__divider {
|
26
|
+
opacity: 0.5;
|
27
|
+
}
|
28
|
+
|
29
|
+
.kayessess__example__link {
|
30
|
+
@extend .margin-medium-right;
|
31
|
+
|
32
|
+
background-color: #ccc;
|
33
|
+
color: #fff;
|
34
|
+
font-size: 9px;
|
35
|
+
padding: 5px 6px;
|
36
|
+
float: left;
|
37
|
+
text-transform: uppercase;
|
38
|
+
letter-spacing: 0.05em;
|
39
|
+
border-radius: 2px;
|
40
|
+
}
|
41
|
+
|
42
|
+
.kayessess__section__heading {
|
43
|
+
@extend .margin-medium-bottom;
|
44
|
+
|
45
|
+
font-size: 18px;
|
46
|
+
font-weight: bold;
|
47
|
+
|
48
|
+
.kayessess__code {
|
49
|
+
float: right;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
.kayessess__section__metadata {
|
54
|
+
font-size: 12px;
|
55
|
+
|
56
|
+
.kayessess__code {
|
57
|
+
font-family: Meslo, Menlo, monospace;
|
58
|
+
background-color: #f2f2f2;
|
59
|
+
padding: 0.2em 0.5em;
|
60
|
+
font-size: 0.8em;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
.kayessess__section__info {
|
65
|
+
@extend .padding-wide;
|
66
|
+
|
67
|
+
border-bottom: 2px solid #e5e5e5;
|
68
|
+
}
|
69
|
+
|
70
|
+
.kayessess__section__description {
|
71
|
+
font-size: 15px;
|
72
|
+
line-height: 1.5;
|
73
|
+
max-width: 800px;
|
74
|
+
|
75
|
+
a {
|
76
|
+
color: $purple;
|
77
|
+
}
|
78
|
+
|
79
|
+
p,
|
80
|
+
ul,
|
81
|
+
ol {
|
82
|
+
@extend .margin-medium-bottom;
|
83
|
+
}
|
84
|
+
|
85
|
+
code {
|
86
|
+
font-family: Meslo, Menlo, monospace;
|
87
|
+
background-color: #f2f2f2;
|
88
|
+
padding: 0.2em 0.5em;
|
89
|
+
font-size: 0.8em;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
.kayessess__section__modifiers {
|
94
|
+
@extend .margin-wide-top;
|
95
|
+
|
96
|
+
font-size: 12px;
|
97
|
+
border: 2px solid #f2f2f2;
|
98
|
+
border-radius: 3px;
|
99
|
+
|
100
|
+
td {
|
101
|
+
padding: 8px;
|
102
|
+
border-bottom: 2px solid #f2f2f2;
|
103
|
+
}
|
104
|
+
|
105
|
+
tr:last-child td {
|
106
|
+
border-bottom: none;
|
107
|
+
}
|
108
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Kayessess
|
2
|
+
|
3
|
+
# The ApplicationController is the class which all Kayessess rails controllers inherit from.
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
skip_before_filter :login_required
|
6
|
+
before_filter :parse_styles
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def parse_styles
|
11
|
+
require 'kss'
|
12
|
+
|
13
|
+
parser = Kss::Parser.new(File.join(Rails.root, '/app/assets/stylesheets'))
|
14
|
+
@styleguide = Kayessess::Styleguide.new(parser)
|
15
|
+
end
|
16
|
+
|
17
|
+
def not_found
|
18
|
+
raise ActionController::RoutingError.new('Not Found')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Kayessess
|
2
|
+
|
3
|
+
require 'pry'
|
4
|
+
|
5
|
+
# The SectionsController is responsible for providing actions for listing and
|
6
|
+
# showing sections of the styleguide
|
7
|
+
class SectionsController < Kayessess::ApplicationController
|
8
|
+
before_filter :find_node, only: [:show, :example]
|
9
|
+
|
10
|
+
def index
|
11
|
+
@sections = @styleguide.sections
|
12
|
+
end
|
13
|
+
|
14
|
+
def show
|
15
|
+
if @node.is_section?
|
16
|
+
render(:partial => "section", :locals => {:section => section})
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def example
|
21
|
+
render layout: 'kayessess/example'
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def find_node
|
27
|
+
@node = @styleguide.section(params[:id])
|
28
|
+
|
29
|
+
raise not_found if @node.nil?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Kayessess
|
2
|
+
|
3
|
+
# Helpers for building styleguides
|
4
|
+
module StyleguideHelper
|
5
|
+
def styleguide_example_for(section, options = {}, &block)
|
6
|
+
html = capture(&block)
|
7
|
+
section_example = Kayessess::SectionExample.new(section, html, options)
|
8
|
+
render(partial: 'kayessess/common/section_example', locals: {
|
9
|
+
section_example: section_example})
|
10
|
+
end
|
11
|
+
|
12
|
+
def section_navigation
|
13
|
+
@styleguide.root_sections.inject([]){|nav, section|
|
14
|
+
nav << link_to(section.id, section_path(section.to_path), class: 'kayessess__navigation__item')
|
15
|
+
}.join('').html_safe
|
16
|
+
end
|
17
|
+
|
18
|
+
def reference_breadcrumb_links(node)
|
19
|
+
content_tag :span, class: 'kayessess__breadcrumb' do
|
20
|
+
node.parents.inject([]) {|crumbs, parent_node|
|
21
|
+
crumbs << breadcrumb_crumb_for_node(parent_node)
|
22
|
+
}.reverse.join('').html_safe
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def breadcrumb_crumb_for_node(node)
|
29
|
+
unless node.parent.nil?
|
30
|
+
link_to("#{node.name}#{breadcrumb_divider}".html_safe, section_path(node.to_path))
|
31
|
+
else
|
32
|
+
''
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def breadcrumb_divider
|
37
|
+
content_tag(:span, " > ", class: 'kayessess__breadcrumb__divider')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="kayessess__examples">
|
2
|
+
<div class="kayessess__examples__example <%= section_example.extra_classes %>">
|
3
|
+
<%= section_example.html %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<% section_example.modifiers.each do |modifier| %>
|
7
|
+
<div class="kayessess__examples__example is-modifier">
|
8
|
+
<code class="kayessess__code"><%= modifier.name %></code>
|
9
|
+
<%= section_example.html_for_modifier(modifier) %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="kayessess__example__code">
|
15
|
+
<h6 class="kayessess__example__code__heading">Code Example</h6>
|
16
|
+
<%= section_example.html_unescaped %>
|
17
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<section class="kayessess__node">
|
2
|
+
<div class="kayessess__node__sections">
|
3
|
+
<% node.sections.each do |section| %>
|
4
|
+
<%= render :partial => "section", :locals => {:section => section} %>
|
5
|
+
<% end %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<% node.children.each do |node| %>
|
9
|
+
<%= render :partial => "node", :locals => {:node => node} %>
|
10
|
+
<% end %>
|
11
|
+
</section>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<article class="kayessess__section">
|
2
|
+
<header class="kayessess__section__header">
|
3
|
+
<h2 class="kayessess__section__heading">
|
4
|
+
<%= link_to "Example", example_section_path(section.to_path), class: 'kayessess__example__link' %>
|
5
|
+
<%= reference_breadcrumb_links(section) %>
|
6
|
+
<%= section.name %>
|
7
|
+
</h2>
|
8
|
+
<div class="kayessess__section__metadata">
|
9
|
+
<code class="kayessess__code"><%= section.reference %></code> defined in <code class="kayessess__code"><%= section.filename %></code>
|
10
|
+
</div>
|
11
|
+
</header>
|
12
|
+
<div class="kayessess__section__info">
|
13
|
+
<div class="kayessess__section__description">
|
14
|
+
<%= section.description %>
|
15
|
+
</div>
|
16
|
+
<% if section.modifiers.any? %>
|
17
|
+
<div class="kayessess__section__modifiers">
|
18
|
+
<table>
|
19
|
+
<% section.modifiers.each do |modifier| %>
|
20
|
+
<tr>
|
21
|
+
<td><code class="kayessess__code"><%= modifier.name %></code></td>
|
22
|
+
<td><%= modifier.description %></td>
|
23
|
+
</tr>
|
24
|
+
<% end %>
|
25
|
+
</table>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
<%= render :partial => section.example_partial_path, locals: {section: section} %>
|
30
|
+
</article>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => @node.example_partial_path, locals: {section: @node} %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => "node", :locals => {:node => @node} %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class="kayessess">
|
3
|
+
<head>
|
4
|
+
<title>Styleguide</title>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
|
7
|
+
<%= stylesheet_link_tag "application", media: "all" %>
|
8
|
+
<%= stylesheet_link_tag "kayessess", media: "all" %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<header role="banner" class="kayessess__header">
|
12
|
+
<%= link_to 'Styleguide', kayessess.root_path, class: 'kayessess__masthead' %>
|
13
|
+
<nav class="kayessess__navigation">
|
14
|
+
<%= section_navigation %>
|
15
|
+
</nav>
|
16
|
+
</header>
|
17
|
+
<section role="main" class="kayessess__main">
|
18
|
+
<%= yield %>
|
19
|
+
</section>
|
20
|
+
|
21
|
+
<%= javascript_include_tag "kayessess" %>
|
22
|
+
</body>
|
23
|
+
</html>
|