glimmer-dsl-css 1.5.1 → 1.5.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/README.md +11 -4
- data/VERSION +1 -1
- data/glimmer-dsl-css.gemspec +4 -3
- data/lib/glimmer-dsl-css/ext/number.rb +5 -0
- data/lib/glimmer-dsl-css/ext/numeric.rb +1 -1
- data/lib/glimmer-dsl-css.rb +7 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccd0a0350e16491cb21ca784bdaf4f5958b687bb0fbc0cdbb715f378d8ef23df
|
4
|
+
data.tar.gz: c6ce25ecbc50626ee4c02f1d3856b35b48c5baffa86281d7c2a835449321f617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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. `
|
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
|
+
# [<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
|
[](http://badge.fury.io/rb/glimmer-dsl-css)
|
4
4
|
[](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.
|
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.
|
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.5.2
|
data/glimmer-dsl-css.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
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",
|
@@ -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
|
data/lib/glimmer-dsl-css.rb
CHANGED
@@ -27,8 +27,13 @@ require 'glimmer'
|
|
27
27
|
|
28
28
|
require 'glimmer/dsl/css/dsl'
|
29
29
|
require 'glimmer-dsl-css/ext/numeric'
|
30
|
-
|
31
|
-
|
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.
|
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-
|
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
|