toadstool 0.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/Gemfile +11 -0
  2. data/Rakefile +4 -0
  3. data/config.rb +42 -0
  4. data/config.ru +6 -0
  5. data/doc-src/SASS-Guidelines.md +222 -0
  6. data/doc-src/What-Is-Toadstool.md +44 -0
  7. data/doc-src/changelog.md +29 -0
  8. data/doc-src/config.md +18 -0
  9. data/doc-src/mit_license.md +7 -0
  10. data/doc-src/mixin_directory.md +17 -0
  11. data/doc-src/sass.md +4 -0
  12. data/lib/RackServer.rb +93 -0
  13. data/lib/bin/toadstool +99 -0
  14. data/public/fonts/fontawesome-webfont.eot +0 -0
  15. data/public/fonts/fontawesome-webfont.svg +255 -0
  16. data/public/fonts/fontawesome-webfont.ttf +0 -0
  17. data/public/fonts/fontawesome-webfont.woff +0 -0
  18. data/public/fonts/zocial-regular-webfont.eot +0 -0
  19. data/public/fonts/zocial-regular-webfont.svg +138 -0
  20. data/public/fonts/zocial-regular-webfont.ttf +0 -0
  21. data/public/fonts/zocial-regular-webfont.woff +0 -0
  22. data/public/images/toadstool-logo.png +0 -0
  23. data/public/javascripts/application.js +74 -0
  24. data/public/javascripts/css_browser_selector.js +8 -0
  25. data/public/javascripts/lang-apollo.js +2 -0
  26. data/public/javascripts/lang-clj.js +18 -0
  27. data/public/javascripts/lang-css.js +2 -0
  28. data/public/javascripts/lang-go.js +1 -0
  29. data/public/javascripts/lang-hs.js +2 -0
  30. data/public/javascripts/lang-lisp.js +3 -0
  31. data/public/javascripts/lang-lua.js +2 -0
  32. data/public/javascripts/lang-ml.js +2 -0
  33. data/public/javascripts/lang-n.js +4 -0
  34. data/public/javascripts/lang-proto.js +1 -0
  35. data/public/javascripts/lang-scala.js +2 -0
  36. data/public/javascripts/lang-sql.js +2 -0
  37. data/public/javascripts/lang-tex.js +1 -0
  38. data/public/javascripts/lang-vb.js +2 -0
  39. data/public/javascripts/lang-vhdl.js +3 -0
  40. data/public/javascripts/lang-wiki.js +2 -0
  41. data/public/javascripts/lang-xq.js +3 -0
  42. data/public/javascripts/lang-yaml.js +2 -0
  43. data/public/javascripts/modernizr.mods.js +22 -0
  44. data/public/javascripts/prettify.js +28 -0
  45. data/public/javascripts/selectivizr-min.js +5 -0
  46. data/public/stylesheets/style.css +615 -0
  47. data/public/stylesheets/toadstool.css +1643 -0
  48. data/readme.md +37 -0
  49. data/sass/_buttons.scss +20 -0
  50. data/sass/_config.scss +216 -0
  51. data/sass/_design.scss +6 -0
  52. data/sass/_forms.scss +18 -0
  53. data/sass/_modules.scss +12 -0
  54. data/sass/_reset.scss +5 -0
  55. data/sass/_typography.scss +93 -0
  56. data/sass/_ui_patterns.scss +0 -0
  57. data/sass/_web_fonts.scss +32 -0
  58. data/sass/buttons/_cupid_config.scss +20 -0
  59. data/sass/buttons/_minimal_config.scss +15 -0
  60. data/sass/color/_color_math.scss +63 -0
  61. data/sass/color/_extends.scss +291 -0
  62. data/sass/color/_grayscale_math.scss +10 -0
  63. data/sass/modules/example_module/_extends.scss +0 -0
  64. data/sass/modules/example_module/_mixins.scss +0 -0
  65. data/sass/modules/example_module/readme.md +96 -0
  66. data/sass/style.scss +45 -0
  67. data/sass/toadstool.scss +14 -0
  68. data/sass/ui_patterns/_color_grid.scss +286 -0
  69. data/sass/ui_patterns/_example.scss +0 -0
  70. data/toadstool.rb +84 -0
  71. data/views/abstract_colors.erb +1 -0
  72. data/views/alerts.erb +1 -0
  73. data/views/buttons.erb +1 -0
  74. data/views/color_palettes.erb +221 -0
  75. data/views/forms.erb +24 -0
  76. data/views/forms/disabled_button.erb +18 -0
  77. data/views/forms/password_input.erb +22 -0
  78. data/views/forms/primary_button.erb +18 -0
  79. data/views/forms/username_input.erb +23 -0
  80. data/views/grid.erb +127 -0
  81. data/views/grid24.erb +59 -0
  82. data/views/grids/grid_arguments.erb +22 -0
  83. data/views/grids/use_definition.erb +12 -0
  84. data/views/layout.erb +58 -0
  85. data/views/modules/example_module/module.erb +0 -0
  86. data/views/modules/example_module/module.js +0 -0
  87. data/views/modules/example_module/readme.md +29 -0
  88. data/views/modules/example_module/view.erb +0 -0
  89. data/views/modules/readme.md +10 -0
  90. data/views/semantic_colors.erb +1 -0
  91. data/views/shared/_html_example.erb +31 -0
  92. data/views/shared/_main_footer.erb +12 -0
  93. data/views/shared/_main_header.erb +4 -0
  94. data/views/shared/_main_nav.erb +16 -0
  95. data/views/shared/_sass_example.erb +10 -0
  96. data/views/shared/_toadstool_subheader.erb +6 -0
  97. data/views/typography.erb +17 -0
  98. data/views/typography/body_copy.erb +19 -0
  99. data/views/typography/body_links.erb +18 -0
  100. data/views/typography/general_typography.erb +19 -0
  101. data/views/typography/headings.erb +65 -0
  102. data/views/typography/vertical_rhythm.erb +13 -0
  103. data/views/typography/web_fonts.erb +11 -0
  104. data/views/ui_patterns/example.erb +1 -0
  105. data/views/ui_patterns/forms/text_input.erb +10 -0
  106. data/views/ui_patterns/readme.md +14 -0
  107. metadata +216 -0
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'sinatra'
4
+ gem 'sass'
5
+ gem 'compass'
6
+ gem 'sinatra-partial'
7
+ gem 'rake'
8
+ gem 'stipe'
9
+
10
+ # Only use when in gem development
11
+ # gem 'stipe', :path => '../stipe'
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ desc "Run the development server"
2
+ task :server do
3
+ exec "bundle exec ruby toadstool.rb -p 3000"
4
+ end
data/config.rb ADDED
@@ -0,0 +1,42 @@
1
+ # Require any additional compass plugins here.
2
+ # require '../stipe/lib/stipe.rb' # locally as a Compass extension
3
+ require 'stipe'
4
+
5
+ # Set this to the root of your project when deployed:
6
+ http_path = "/"
7
+
8
+ #if ENV['PWD'].end_with?('sass')
9
+ # css_dir = "../public/stylesheets"
10
+ # sass_dir = "."
11
+ #else
12
+ # css_dir = "public/stylesheets"
13
+ # sass_dir = "sass"
14
+ #end
15
+
16
+ css_dir = "public/stylesheets"
17
+ sass_dir = "sass"
18
+ images_dir = "images"
19
+ javascripts_dir = "javascripts"
20
+
21
+ # You can select your preferred output style here (can be overridden via the command line):
22
+ # output_style = :expanded or :nested or :compact or :compressed
23
+ output_style = :expanded
24
+
25
+ # To enable relative paths to assets via compass helper functions. Uncomment:
26
+ # relative_assets = true
27
+
28
+ # To disable debugging comments that display the original location of your selectors. Uncomment:
29
+ line_comments = true
30
+
31
+ # http://www.mobify.com/dev/sass-sleuth-debugging-sass-in-webkit-browsers/
32
+ # compass watch --debug-info
33
+
34
+ sass_options = {
35
+ :debug_info => true
36
+ }
37
+
38
+ # If you prefer the indented syntax, you might want to regenerate this
39
+ # project again passing --syntax sass, or you can uncomment this:
40
+ # preferred_syntax = :sass
41
+ # and then run:
42
+ # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
data/config.ru ADDED
@@ -0,0 +1,6 @@
1
+ require './toadstool'
2
+
3
+ ## There is no need to set directories here anymore;
4
+ ## Just run the application
5
+
6
+ run Sinatra::Application
@@ -0,0 +1,222 @@
1
+ # General Sass notes, advice and guidelines
2
+
3
+ **Follow contributers on Twitter [@anotheruiguy](http://twitter.com/anotheruiguy) and [@ScottKellum](http://twitter.com/ScottKellum)**
4
+
5
+ ## Syntax and formatting
6
+
7
+ Sass is written using the multi-line format very similar to CSS. While Sass is the language, SCSS is a version of the syntax. There is no right or wrong, better or worse. Some prefer the Sass syntax, I prefer to work with SCSS. For the purpose of this document I will refer Sass as the language, but code examples will be written as SCSS and file names as `.scss`.
8
+
9
+ ### Sass and SCSS
10
+
11
+ Sass has two equally valid syntaxes, Sass and SCSS. Some key differences to be illustrated are, Sass uses less characters and a 'double space' tab for child selector delineation, exactly like HAML. While SCSS uses a syntax that is more representational of CSS and you can use a full 'tab' for child selector delineation. See examples.
12
+
13
+ **Sass**
14
+
15
+ ```Sass
16
+ .your_new_class
17
+ margin: 0
18
+ padding: 0
19
+ ```
20
+
21
+ **SCSS**
22
+
23
+ ```scss
24
+ .your_new_class {
25
+ margin: 0;
26
+ padding: 0;
27
+ }
28
+ ```
29
+
30
+ ## Comments
31
+
32
+ SCSS supports both invisible and visible comments. Using `//` before any SCSS, this will place a comment in your SCSS code, but will not be output in the processed CSS.
33
+
34
+ Using the standard `/* */` CSS comments in your SCSS, when processed this will be output in your CSS.
35
+
36
+ Comments in code is awesome. Especially when working with a team. Be kind, leave instructions.
37
+
38
+ ### Nesting
39
+
40
+ Nesting in Sass is not like indenting in CSS. In Sass nesting has meaning. Sass uses the nested white space to declare parent child relationships. Nesting allows the developer to inherit the parent selector, but be mindful, it is easy to fall into the trap of insane selector inheritance. Rule of thumb, if you are tabbing in a third time, is this declaration really that specific to this namespace or can you abstract to be used more universally?
41
+
42
+ Just because you are using Sass doesn't mean that you should toss all CSS and OOCSS best practices out the window.
43
+
44
+ **The Good**
45
+
46
+ ```scss
47
+ .your_new_class {
48
+ margin: 0;
49
+ padding: 0;
50
+ p {
51
+ color: red;
52
+ }
53
+ a {
54
+ color: blue;
55
+ text-decoration: none;
56
+ }
57
+ li {
58
+ float: left;
59
+ width: 100%;
60
+ }
61
+ }
62
+ ```
63
+
64
+ **The Bad**
65
+
66
+ ```scss
67
+ .your_new_class {
68
+ margin: 0;
69
+ padding: 0;
70
+ div {
71
+ p {
72
+ color: red:
73
+ a {
74
+ color: blue
75
+ text-decoration: none;
76
+ }
77
+ }
78
+ ul {
79
+ li {
80
+ float: left;
81
+ width: 100%;
82
+ a {
83
+ color: blue;
84
+ text-decoration: none;
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ ### Declaration best practice
93
+
94
+ It is best practice to list your parent specific declarations directly under the class selector and then list the indented child selectors to keep readability at a maximum.
95
+
96
+ Example of a parent class selector with nested selectors:
97
+
98
+ ```scss
99
+ .fieldset {
100
+ margin-bottom: 2em;
101
+ p {
102
+ margin-bottom: 0;
103
+ line-height: 1.5em;
104
+ }
105
+ legend {
106
+ float: left;
107
+ width: 100%;
108
+ }
109
+ }
110
+ ```
111
+
112
+ ### Selector naming conventions
113
+
114
+ I personally use underscore delimited lowercase selectors. Why? I can double click on a selector and get the whole thing. `.CamelCase{}`, `.hyphen-delimited{}`, or `.underscore_delimited{}`, as long as you are consistent, rock on!
115
+
116
+
117
+ ## Working with partials
118
+
119
+ A partial in Sass is a document with an underscore preceding the name. Example, `_widget.scss`. Using this convention, when processed, Sass will not output a standalone CSS file. A partial is simply a resource file that other docs can consume and use. This is essential for managing large libraries of Sass logic, element and widget styles.
120
+
121
+ I have found that the simplest way to manage your Sass files is via a core.scss file consisting of imported partials and a logical grouping of sub files. With Sass, @import works and it works really well, unlike standard CSS. It is encouraged to break your files into smaller manageable chunks of code.
122
+
123
+ If you can't decide whether to use Sass or SCSS, the good news is that you don't. Sass and SCSS files can live together in perfect harmony. So if you have a reason for using one syntax over another for specific use cases, this is acceptable. For example, some like to use SCSS for logic building and then use Sass for design building. You do not need to state either SCSS or Sass with the @import function, just the path to the partial.
124
+
125
+
126
+ ## Dynamic and reusable code
127
+
128
+ Sass's greatest strength is in it's ability to create dynamic, intelligent and efficiently reusable code.
129
+
130
+ ### @mixins
131
+
132
+ Mixins are a great way to keep your code DRY as well as create logical chunks of code to be reused again and again. Using the `@mixin` directive you can engineer smart reusable code to be used throughout your application. It is considered best practice to only use a mixin if you are also using arguments like the following.
133
+
134
+ ```scss
135
+ @mixin the_box ($padding, $background, $border, $style, $color) {
136
+ padding: $padding;
137
+ background: $background;
138
+ border: $border $style $color;
139
+ }
140
+ ```
141
+
142
+ To use the mixin use the `@include` directive like so
143
+
144
+ ```scss
145
+ .your_new_class {
146
+ @include the_box (10px, red, 1px, solid, black);
147
+ }
148
+ ```
149
+
150
+ ### @extend
151
+
152
+ If you are not using arguments in your mixin, you should consider using a CSS class object and apply using the `@extend` directive. Here is a best practice example for creating a stylistic class for use as an extend using a Compass mixin.
153
+
154
+ ```scss
155
+ // Style class object
156
+ .default_gray_border {
157
+ @include border-radius(25px);
158
+ border: 1px solid gray;
159
+ }
160
+
161
+ // Semantically names class
162
+ .promoters_box {
163
+ @extend .default_gray_border;
164
+ }
165
+ ```
166
+
167
+ This will produce the following best practice CSS
168
+
169
+ ```scss
170
+ .default_gray_border, promoters_box {
171
+ -webkit-border-radius: 25px;
172
+ -moz-border-radius: 25px;
173
+ -ms-border-radius: 25px;
174
+ -o-border-radius: 25px;
175
+ border-radius: 25px;
176
+ border: 1px solid gray;
177
+ }
178
+ ```
179
+
180
+ ### @extends gone bad
181
+
182
+ @extend is an awesome tool, but used unwisely will cause real issues. Something I consider to be best practice is to NEVER USE extends inside a mixin. Depending on how the parent mixin is used in generating more CSS even with the possibility of that mixin being used to create a class that is in turn extended, this can create an amazing array of selectors in your final CSS.
183
+
184
+ **The Bad**
185
+
186
+ need to engineer bad @mixin with @extend example
187
+
188
+ **The Bad CSS**
189
+
190
+ illustrate css selector blote
191
+
192
+
193
+
194
+ ### @-Rules and Directives
195
+
196
+ One of the advantages Sass has over other languages are control directives. This allows for the ability to programmatically generate css and values.
197
+
198
+ ### Functions
199
+
200
+ Sass has built in functions like `percentage($value)` along with [plenty of others](http://Sass-lang.com/docs/yardoc/Sass/Script/Functions.html). However you can build your own functions to help with calculations and generating values for a verity of use cases. Below is an exponent function that can be used on any value.
201
+
202
+ ```scss
203
+ @function exponent($base, $exponent) {
204
+ // reset value
205
+ $value: $base;
206
+ // positive intergers get multiplied
207
+ @if $exponent > 1 {
208
+ @for $i from 2 through $exponent {
209
+ $value: $value * $base; } }
210
+ // negitive intergers get divided. A number divided by itself is 1
211
+ @if $exponent < 1 {
212
+ @for $i from 0 through -$exponent {
213
+ $value: $value / $base; } }
214
+ // return the last value written
215
+ @return $value;
216
+ }
217
+ ```
218
+
219
+
220
+ ### Combining features
221
+
222
+ The above tools can be combined to provide even more powerful tools for writing CSS. Loops can be placed in mixins to create grids. Mixins can be nested in mixins to cleanly write code that effects lots of areas. While you need to be careful with the CSS this generates nesting features can provide you with a lot of power when generating styles.
@@ -0,0 +1,44 @@
1
+ #What is Toadstool?
2
+
3
+ While CSS frameworks are in increasing abound, one thing that is consistently missing is a good styleguide solution. While it appears that styleguides are an interesting topic and almost everyone agrees that styleguides are the way to go, all the energy for development is going onto yet another version of a UI framework.
4
+
5
+ Toadstool aims to bring a little sanity to an insane world. Built in Sanatra, using Sass and Compass, Toadstool in it's core is a styleguide templating solution.
6
+
7
+ ##Toadstool is a process
8
+ In the countless projects I have been involved in, one constant is the lack of abstraction between the design element, HTML and CSS for the widget and the view.
9
+
10
+ Toadstool aims to give structure to the styleguide development process.
11
+
12
+ ##Don't go chasing waterfalls
13
+ In the old waterfall days, it was common to think a project's problems all the way through. Specification documents and comps that encompassed almost the entire project before line one of code was ever written was the expectation. Oh, those were the days.
14
+
15
+ For developers, It was easier for them to see the future and write patterned code, but the expense was to great. All the upfront planning was very time consuming and when developers began to layout patterns in their code based on those assumptions, changes down the road were much harder to manage. Not to mention expensive and opportunities for broken code were to high. Anyone remember writing tests in those days?
16
+
17
+ In agile the idea is to not solve the problem until it is an official problem. Sure we can speculate, but the idea is to not execute until it is appropriate. So, what does that mean for designers and developers? For developers that is pretty easy to answer, don't develop that feature until it is time. But for designers, this has been a harder problem to solve. After all, the designer's role has traditionally been to be the ones who think ahead. Developers have looked to them to be ready when the time comes.
18
+
19
+ ##Designers, get agile or The Failure of the Comp
20
+ Up till now the designer's deliverable has been and in most cases continues to be the comp. While most of the development world has moved on from waterfall, I see time and time again designers holding onto the same processes. Given a project I have seen design teams go overboard in trying to solve problems that don't yet exist. This leads them down a path of no return having thought so deep into solving a problem that the attachment to a solution becomes too great. When the times comes that there needs to be adjustments to the solution to fit the changing needs of the business, 'turning the boat' comes with great costs and is usually meet with frustrations, if not full out resistance.
21
+
22
+ Getting agile fills the gap where the comp fails. All to often when composing the comp, the designer feels the need to design the whole experience of a single view. This means a lot of time in Photoshop and duplicating screens again and again just to adjust subtle nuances. This means making changes comes at to great a cost.
23
+
24
+ Version control is another issue of great frustration. Many times the 'comp' from the designer will go through other experimental iterations that may accidentally get incorporated into a delivered design to a developer. This is a classic case of 'signal vs noise' issue. A developer will typically pick up on these inconsistent nuances and make the changes to the layout of the view. It is this simple issue that commonly leads to unnecessary work and frustrations.
25
+
26
+ Another common versioning issue is that there may be changes in the view that are not appropriately managed in the next series of comps that are coming down the line. In the waterfall comp design process, many of the screens are created way ahead of time and as the project progresses things change. It is typically very time consuming and expensive to go back and update all the comps with the changes that have happened in the UI since that view was designed. So again we find ourselves measuring final deliverables against an imperfect measuring stick that leads to confusion and frustration.
27
+
28
+ What if we were to bite this off into smaller chunks? What if at fist we we're to only decide things like color pallet, typography, forms and buttons? This is pretty cool and most will agree that this is a process that most designers go through. The breakdown is how to document these choices. Historically designers did this with the comp. Today I say do it with a styleguide.
29
+
30
+ ##The comp is D.O.A.
31
+ To me, the delivery of a comp is a 'dead on arrival' document. The first thing I am going to do is convert this to code and it's lifecycle will exist in code. The customers of our site will never see the comp. So why do we treat it as the defacto standard from which all our site's views will be measured?
32
+
33
+ The fact of the matter is, in today's landscape of devices that are consuming content, this process is flawed in more ways one. As designers and developers we need to be living in the medium is which our product will ship. This means documenting our user's experience in a format that is abstracted from the actual product, but is representational of the environment from which the user will interact. My answer, styleguide.
34
+
35
+ ##Abstraction is the key
36
+ Since the very early days of CSS it has been prophesied that you could develop a site and redesign it with only CSS. And then there are those who would say that this is a myth, a holy grail that is impossible to achieve. I say, bollocks.
37
+
38
+ A trap that developers fall into time and time again is that they write the code to fit the UI. There is zero abstraction between content, markup and then design. It is this error in development that causes developers and designers to state that a redesign will always demand that we re-engineer the markup.
39
+
40
+ While I will agree that we have not always had the tools at our ready to achieve the holy grail of goals, but that doesn't mean that we throw our hand up in the air either and surrender. We must persevere and persist. We must create the tools we are lacking.
41
+
42
+ A goal of Toadstool's styleguide is to provide a framework so that UI elements are created in an environment that is completely abstract from the actual application. As stated above, developers many times fall into trap of developing a UI element to specific to a view and customized to the content they are given. When I hear a developer say, �If you change the copy the UI will break�, that really tells me that they are doing it wrong.
43
+
44
+ Good UI developers will tell you that when they begin writing code they are looking at the structure of the UI element. From there it is a series of decisions on what markup to use that best represents the layout and the content within. Then we need to provide hooks for your CSS to apply the look and our JavaScript to apply experience.
@@ -0,0 +1,29 @@
1
+ # Toadstool Changelog
2
+ ## Oct. 3 2012
3
+ * Updated js for em view calc to round up value and show px value too.
4
+ * Removed form select menu
5
+ * Updating views with better solution for showing code
6
+
7
+ ## Oct. 30 2012
8
+ * Added 24col grid view
9
+ * Updated gemspec for Stipe 0.0.4.6
10
+
11
+ ## Sept. 6 2012
12
+ * Added .rvmrc - I know, should have done this a long time ago.
13
+
14
+ ## Aug. 31 2012
15
+ * Added support for non-core modernizr features
16
+ ** boxsizing - necessary for grid solution
17
+ ** lastchild
18
+
19
+ ## Aug. 30 2012
20
+ * Moved color defaults to control under Toadstool style guide
21
+ * Updates tempalte markup so that css is not leveraging generic tags. Corrected issues where styles were stomping on prototype views
22
+
23
+ ## Aug, 13 2012
24
+ * Updates required to meet specification of 0.0.2.8 Stipe gem update
25
+
26
+ ## Aug 9, 2012
27
+ * Updated `public/javascripts/application.js` with support for creating hex values on the fly in the browser for the colors view
28
+ * Updated navigation, consolidated abstract and semantic colors view (still need to complete semantic swatches)
29
+ * BUG: Colors in the view are being pulled from Stipe, not the Toadstool styleguide.
data/doc-src/config.md ADDED
@@ -0,0 +1,18 @@
1
+ #Toadstool config
2
+
3
+ Please read the following information as how to use Toadstool's configurations
4
+
5
+ ## CSS Reset
6
+ Toadstool is designed to support any CSS rest you prefer. Resets installed are Toadstool reset, HTML5 reset, Eric Meyer's reset and Nicolas Gallagher's Normalize. And of course, Compass' reset is supported as well.
7
+
8
+ All resets are written in Sass and configuration is as simple as uncommenting the preferred reset in the ``config_files/_reset.scss`` directory. In any of the reset files, any hardcoded pixel values are being converted to ems and all hex colors have of course been replaced with Toadstool's variables. Activation of any reset will inherit color values as dictated by the ``_config.scss`` file.
9
+
10
+ ###Toadstool reset
11
+ Toadstool's reset is a slight modification on the HTML5 reset. All of the font styling features of this reset have been moved to the ``_text.scss`` file.
12
+
13
+ ###HTML5 reset and Normalize
14
+ To the same effect that all styling in Toadstool's reset have been moved to more appropriate locations in the framework, same has been done with the installation of HTML5 reset and Normalize.
15
+
16
+ ###'My Reset'
17
+ You have your own preferences for reset, that's cool. In the ``sass`` directory there is a placeholder ``_myreset.scss`` that is all yours to use. Simply uncomment the import listing in ``config_files/_reset.scss`` and profit.
18
+
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2012 Dale Sande and Jed Foster
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,17 @@
1
+ #Toadstool's mixins directory
2
+
3
+ Toadstool is a Styleguide UI Framework designed to give you all the power and flexibility of more traditional CSS frameworks without all the crufty CSS that bloats your stylesheets. But how do we do this? The secret is Sass. Or should I say a combination of Sass and the Compass library. Toadstool is a collection of fabricated mixins that are designed to solve common problems.
4
+
5
+ ##Toadstool mixins
6
+ ###@include main_content
7
+ Designed to be used for the large main content area of a site. Typically a section block set to a specified width that is centered in the view.
8
+ **Supported arguments** ``$main_col_count, $main_grid_align: center, $main_grid_uom: em`` If needed
9
+ **Example use case**
10
+ ``
11
+ .main_content {
12
+ @include main_content(6);
13
+ }
14
+ ``
15
+
16
+
17
+ ### Work in progress ... don't mind the mess.
data/doc-src/sass.md ADDED
@@ -0,0 +1,4 @@
1
+ #File and folder structure
2
+
3
+ ### To Do
4
+ Write up how to use the file and folder structure at this level
data/lib/RackServer.rb ADDED
@@ -0,0 +1,93 @@
1
+ require 'rack'
2
+ require 'fileutils'
3
+ require 'optparse'
4
+
5
+ class RackServer < ::Rack::Server
6
+ class Options
7
+ def parse!(args)
8
+ args, options = args.dup, {}
9
+
10
+ opt_parser = OptionParser.new do |opts|
11
+ opts.banner = "Usage: rails server [mongrel, thin, etc] [options]"
12
+ opts.on("-p", "--port=port", Integer,
13
+ "Runs Rails on the specified port.", "Default: 3000") { |v| options[:Port] = v }
14
+ opts.on("-b", "--binding=ip", String,
15
+ "Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| options[:Host] = v }
16
+ opts.on("-c", "--config=file", String,
17
+ "Use custom rackup configuration file") { |v| options[:config] = v }
18
+ opts.on("-d", "--daemon", "Make server run as a Daemon.") { options[:daemonize] = true }
19
+ opts.on("-u", "--debugger", "Enable the debugger") { options[:debugger] = true }
20
+ opts.on("-e", "--environment=name", String,
21
+ "Specifies the environment to run this server under (test/development/production).",
22
+ "Default: development") { |v| options[:environment] = v }
23
+ opts.on("-P","--pid=pid",String,
24
+ "Specifies the PID file.",
25
+ "Default: tmp/pids/server.pid") { |v| options[:pid] = v }
26
+
27
+ opts.separator ""
28
+
29
+ opts.on("-h", "--help", "Show this help message.") { puts opts; exit }
30
+ end
31
+
32
+ opt_parser.parse! args
33
+
34
+ options[:server] = args.shift
35
+ options
36
+ end
37
+ end
38
+
39
+ def initialize(*)
40
+ super
41
+ set_environment
42
+ end
43
+
44
+ def app
45
+ @app ||= super.respond_to?(:to_app) ? super.to_app : super
46
+ end
47
+
48
+ def opt_parser
49
+ Options.new
50
+ end
51
+
52
+ def set_environment
53
+ ENV["RAILS_ENV"] ||= options[:environment]
54
+ end
55
+
56
+ def start
57
+ url = "#{options[:SSLEnable] ? 'https' : 'http'}://#{options[:Host]}:#{options[:Port]}"
58
+ puts "=> Call with -d to detach" unless options[:daemonize]
59
+ trap(:INT) { exit }
60
+ puts "=> Ctrl-C to shutdown server" unless options[:daemonize]
61
+
62
+ #Create required tmp directories if not found
63
+ %w(cache pids).each do |dir_to_make|
64
+ FileUtils.mkdir_p(File.join(Dir.pwd, 'tmp', dir_to_make))
65
+ end
66
+ # puts wrapped_app
67
+ unless options[:daemonize]
68
+ wrapped_app # touch the app so the logger is set up
69
+ end
70
+
71
+ super
72
+ ensure
73
+ # The '-h' option calls exit before @options is set.
74
+ # If we call 'options' with it unset, we get double help banners.
75
+ puts 'Exiting' unless @options && options[:daemonize]
76
+ end
77
+
78
+ def log_path
79
+ "log/#{options[:environment]}.log"
80
+ end
81
+
82
+ def default_options
83
+ super.merge({
84
+ Port: 3000,
85
+ DoNotReverseLookup: true,
86
+ environment: (ENV['RAILS_ENV'] || "development").dup,
87
+ daemonize: false,
88
+ debugger: false,
89
+ pid: File.expand_path("tmp/pids/server.pid"),
90
+ config: File.expand_path("config.ru")
91
+ })
92
+ end
93
+ end