glimmer-dsl-css 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7e949aec92ed02ea78029ede9817280b0ab9bb542382f7cb08223f9f9ee7870
4
- data.tar.gz: e21dfaa4ff4538d1e432c2c3804076db7cfb7dd785aa4db4df7991415c319e84
3
+ metadata.gz: ccd0a0350e16491cb21ca784bdaf4f5958b687bb0fbc0cdbb715f378d8ef23df
4
+ data.tar.gz: c6ce25ecbc50626ee4c02f1d3856b35b48c5baffa86281d7c2a835449321f617
5
5
  SHA512:
6
- metadata.gz: 37041f729a6aebec6fc12084ee7bd419a0f8d540b3ccb01ea96b8640d3f24d87b9b7f60133fe6791c4e8add93ad9b832e21cbb911bff61c20c55aabc06a8f20a
7
- data.tar.gz: 13c3c85185fb5e81bc6279e2e4a8cf331c6cde51e8d2db6828ca9e9a7e839707ff6700fb7f6fcce7d0534f40e96783a606e8983c87dc948155e3beb6be6ad3d7
6
+ metadata.gz: 8381ed75193f77147461fae8d237899969c2387558d733a09db22c84c6ec19135db7d80644467cabd5c6f2b13a9a461fd23ddfb178503796b530f66186551862
7
+ data.tar.gz: 698b5439f0adb5e9748527318641b8834c789eefaf4e2ef6f49b459e623819ca35a49b45e97ea27641aa5b33d3cc6b8c05a4dd507f7f386ceaba3113f456fab1
data/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ # 1.5.2
4
+
5
+ - Support `rem`, `Q`, `pt`, `pc`, `ch`, `ex`, `vh`, `vw`, `vmin`, `vmax` methods on `Numeric` to represent their respective CSS units (e.g. `14.vh` => `"14vh"` / `2.rem` => `"2rem"`)
6
+ - Fix `%` `Integer`/`Float` operator in Opal by implementing on `Number` class instead.
7
+
3
8
  # 1.5.1
4
9
 
5
- - Support px in pt cm mm em methods on `Numeric` to allow producing px in pt cm mm em CSS values (e.g. `3.px` => "3px")
6
- - Support % method on `Integer`/`Float` to allow producing % CSS values (e.g. `90.%` => "90%")
10
+ - Support `px`, `in`, `pt`, `cm`, `mm`, `em` methods on `Numeric` to allow producing `px`, `in`, `pt`, `cm`, `mm`, `em` CSS values (e.g. `14.px` => `"14px"` / `2.em` => `"2em"`)
11
+ - Support % method on `Integer`/`Float` to allow producing % CSS values (e.g. `90.%` => `"90%"`)
7
12
 
8
13
  ## 1.5.0
9
14
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for CSS 1.5.1
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for CSS 1.5.2
2
2
  ## Ruby Programmable Cascading Style Sheets
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-css.svg)](http://badge.fury.io/rb/glimmer-dsl-css)
4
4
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-css.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-css)
@@ -66,7 +66,7 @@ Please follow these instructions to make the `glimmer` command available on your
66
66
 
67
67
  Run this command to install directly:
68
68
  ```
69
- gem install glimmer-dsl-css -v 1.5.1
69
+ gem install glimmer-dsl-css -v 1.5.2
70
70
  ```
71
71
 
72
72
  Note: In case you are using JRuby, `jgem` is JRuby's version of the `gem` command. RVM allows running `gem` as an alias in JRuby. Otherwise, you may also run `jruby -S gem install ...`
@@ -81,7 +81,7 @@ That's it! Requiring the gem activates the Glimmer CSS DSL automatically.
81
81
 
82
82
  Add the following to `Gemfile` (after `glimmer-dsl-swt` and/or `glimmer-dsl-opal` if included too):
83
83
  ```
84
- gem 'glimmer-dsl-css', '~> 1.5.1'
84
+ gem 'glimmer-dsl-css', '~> 1.5.2'
85
85
  ```
86
86
 
87
87
  And, then run:
@@ -178,11 +178,18 @@ The `body > h1` rule could have been written in any other alternative way:
178
178
 
179
179
  All CSS unit types are supported by invoking methods matching them on Numeric objects (e.g. `3.em` produces `'3em'`):
180
180
  - `px` (default if not specified)
181
- - `in`
182
181
  - `pt`
182
+ - `pc`
183
+ - `Q`
184
+ - `in`
183
185
  - `cm`
184
186
  - `mm`
185
187
  - `em`
188
+ - `rem`
189
+ - `vh`
190
+ - `vw`
191
+ - `vmin`
192
+ - `vmax`
186
193
  - `%`
187
194
 
188
195
  For example:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.1
1
+ 1.5.2
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-dsl-css 1.5.1 ruby lib
5
+ # stub: glimmer-dsl-css 1.5.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-dsl-css".freeze
9
- s.version = "1.5.1"
9
+ s.version = "1.5.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["AndyMaleh".freeze]
14
- s.date = "2024-07-28"
14
+ s.date = "2024-08-30"
15
15
  s.description = "Glimmer DSL for CSS (Ruby Programmable Cascading Style Sheets)".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["css_to_glimmer".freeze, "minify_css".freeze]
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
33
33
  "lib/glimmer-dsl-css/ext/css_percentable.rb",
34
34
  "lib/glimmer-dsl-css/ext/float.rb",
35
35
  "lib/glimmer-dsl-css/ext/integer.rb",
36
+ "lib/glimmer-dsl-css/ext/number.rb",
36
37
  "lib/glimmer-dsl-css/ext/numeric.rb",
37
38
  "lib/glimmer/css/css_fragment.rb",
38
39
  "lib/glimmer/css/css_fragment_composite.rb",
@@ -0,0 +1,5 @@
1
+ require 'glimmer-dsl-css/ext/css_percentable'
2
+
3
+ class Number
4
+ prepend CssPercentable
5
+ end
@@ -1,5 +1,5 @@
1
1
  class Numeric
2
- %w[px in pt cm mm em].each do |unit_type|
2
+ %w[px in pt pc Q cm mm ch ex em rem vh vw vmin vmax].each do |unit_type|
3
3
  if 1.respond_to?(unit_type)
4
4
  puts "Unable to define Numeric##{unit_type} method because it is already defined. Please avoid using the Glimmer Numeric##{unit_type} method or remove the other implementation of it!"
5
5
  else
@@ -27,8 +27,13 @@ require 'glimmer'
27
27
 
28
28
  require 'glimmer/dsl/css/dsl'
29
29
  require 'glimmer-dsl-css/ext/numeric'
30
- require 'glimmer-dsl-css/ext/integer'
31
- require 'glimmer-dsl-css/ext/float'
30
+
31
+ if RUBY_ENGINE != 'opal'
32
+ require 'glimmer-dsl-css/ext/integer'
33
+ require 'glimmer-dsl-css/ext/float'
34
+ else
35
+ require 'glimmer-dsl-css/ext/number'
36
+ end
32
37
 
33
38
  module Glimmer
34
39
  def _(selector, &rule_block)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-css
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-28 00:00:00.000000000 Z
11
+ date: 2024-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer
@@ -231,6 +231,7 @@ files:
231
231
  - lib/glimmer-dsl-css/ext/css_percentable.rb
232
232
  - lib/glimmer-dsl-css/ext/float.rb
233
233
  - lib/glimmer-dsl-css/ext/integer.rb
234
+ - lib/glimmer-dsl-css/ext/number.rb
234
235
  - lib/glimmer-dsl-css/ext/numeric.rb
235
236
  - lib/glimmer/css/css_fragment.rb
236
237
  - lib/glimmer/css/css_fragment_composite.rb