Skip to content

Commit

Permalink
1.0 (#1)
Browse files Browse the repository at this point in the history
* Start of v.1

* lots of updates to docs
  • Loading branch information
bemky authored Oct 11, 2017
1 parent ddc638a commit e532065
Show file tree
Hide file tree
Showing 104 changed files with 9,389 additions and 4,504 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Change Log

## 1.0
This is the first really stable and usable release of Uniform. Many of the components were rewritten, removed, and added. In general, this release brings a shift in methodology. Building with Uniform now supplies and relies on more helpers to build things out.

*This will break everything in previous versions.* Many component names went from `title-case` to `camelCase`, and many modifier classes inside of components were removed in favor of using helper classes in html.

### Added
- `uniformAlert`
- `uniformDropdown`
- `uniformSelect`
- `uniformFloatingLabel`
- `uniformModal`
- `uniformTable`
- `uniformTooltip`
- tons of helper classes like `margin`, `pad`, `border-top`...

### Removed
- `bourbon` and `neat` dependencies
- custom sass functions
- `uniform-list`, `uniform-checks`, `uniform-step`, `uniform-icons`

### Changed
- `title-case` to `camelCase` for all compontents
- `inline-input` to `uniformInputGroup`
- `.container` to `.grid` was completely overhauld to use flexbox
- `table-container` to `table`
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
source "http://rubygems.org"

# Specify your gem's dependencies in uniform.gemspec
source 'https://rubygems.org'

# Stylesheets
gem 'sass'
gem 'sprockets-sass'
gem 'bourbon'
gem 'neat'
gem 'rake'
gem 'activesupport'
12 changes: 1 addition & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
activesupport (5.0.0.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
bourbon (4.2.7)
sass (~> 3.4)
thor (~> 0.19)
concurrent-ruby (1.0.2)
hike (1.2.3)
i18n (0.7.0)
minitest (5.9.0)
multi_json (1.12.1)
neat (1.8.0)
sass (>= 3.3)
thor (~> 0.19)
rack (1.6.4)
rake (11.3.0)
sass (3.4.22)
Expand All @@ -29,7 +22,6 @@ GEM
sprockets-sass (1.3.1)
sprockets (~> 2.0)
tilt (~> 1.1)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (1.2.2)
Expand All @@ -40,11 +32,9 @@ PLATFORMS

DEPENDENCIES
activesupport
bourbon
neat
rake
sass
sprockets-sass

BUNDLED WITH
1.12.5
1.15.4
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Uniform
=======
![alt text](https://raw.githubusercontent.com/bemky/uniform/master/site/logo.png)

A rails gem of sass compenents and defaults for building a UI that's on fleak.

Expand Down
50 changes: 34 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,45 @@ task :compile do

# Render the test html file
File.open('./index.html', 'w') do |file|
file.write(ERB.new(File.read('preview/index.html.erb')).result(binding))
file.write(
render_with_layout("preview/index.html.erb")
)
end

end

desc "Compile preview"
task :preview do

File.open('./site/site/uniform.css', "w") do |file|
file << environment['uniform.scss']
end

File.open('./site/site/preview.css', "w") do |file|
file << environment['preview.scss']
Dir.foreach(File.join('preview')).select{|file| file =~ /\.erb$/}.each do |file_name|
File.open("./site/#{file_name.gsub('.erb', '')}", 'w') do |file|
file.write(
render_with_layout("preview/#{file_name}")
)
end
end

# Render the test html file
File.open('./site/index.html', 'w') do |file|
file.write(ERB.new(File.read('preview/index.html.erb')).result(binding))
end

def capture
old_output = @output
@output = ""
yield
ensure
@output = old_output
end

def html_block(**options, &block)
@output << "<pre class='#{options[:class]}'>"
@output << CGI::escapeHTML(capture(&block).strip)
@output << "</pre>"
end

def render_with_layout(template_path, context = self)
template = File.read(template_path)
layout = File.read('preview/layout.html.erb')
[template, layout].inject(nil) do |prev, temp|
render(temp){prev}
end

end

def render(template)
ERB.new(template, nil, nil, "@output").result( binding )
end

class UrlGenerator < Sprockets::DirectiveProcessor
Expand Down
Loading

0 comments on commit e532065

Please sign in to comment.