glimmer-dsl-css 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +28 -7
- data/VERSION +1 -1
- data/glimmer-dsl-css.gemspec +3 -3
- data/lib/glimmer/dsl/css/dsl.rb +1 -2
- data/lib/glimmer/dsl/css/element_rule_expression.rb +3 -3
- data/lib/glimmer/dsl/css/property_expression.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96e2646830dfe42a2cfe0ea91ea369b558d0873917071e963349856b129c1278
|
4
|
+
data.tar.gz: 1948d00677cdf1aa4df5cbb90a4632edbd06c03c6162dce55ca2ebb94baa0dff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dac6e584522cc6d193aac0ff4cf6fac528e4fa940bf1d95de6c35e657333852627248fc783e20d9844313a43a82b05915dbd1b457304bfc15124575cf8323ed
|
7
|
+
data.tar.gz: 595521b5d0d22be9ff481db6bc0a7a18ad0bc4d5958d9e69a77886b03961b6ea9d1a79d74f4e783ce418cdceb2cf53fb0190656d84eabe95e5f8039908cadb59
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 1.4.1
|
4
|
+
|
5
|
+
- Optimize performance (mostly in Opal) by re-ordering dsl.rb to give preference to dynamic property expressions, removing media from its chain of responsibility (it does not need to be there because it is a static expression), and re-ordering conditional checks in dynamic property expression and element rule expression.
|
6
|
+
|
3
7
|
## 1.4.0
|
4
8
|
|
5
9
|
- `css_to_glimmer` converter command for automatically converting CSS to Glimmer DSL Ruby code
|
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.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.4.1
|
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)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
[![Maintainability](https://api.codeclimate.com/v1/badges/c7365cdb8556be433115/maintainability)](https://codeclimate.com/github/AndyObtiva/glimmer-dsl-css/maintainability)
|
7
7
|
[![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
8
8
|
|
9
|
-
[Glimmer](https://github.com/AndyObtiva/glimmer) DSL for CSS provides Ruby syntax for building CSS (Cascading Style Sheets). It used to be part of the [Glimmer](https://github.com/AndyObtiva/glimmer) library (created in 2007), but eventually got extracted into its own project. The Ruby gem also includes a [CSS to Glimmer converter](#css-to-glimmer-converter) (`css_to_glimmer`) to automatically convert legacy CSS code into Glimmer DSL syntax.
|
9
|
+
[Glimmer](https://github.com/AndyObtiva/glimmer) DSL for CSS provides Ruby syntax for building CSS (Cascading Style Sheets), included in [Glimmer DSL for Web](https://github.com/AndyObtiva/glimmer-dsl-web) (Ruby in the Browser Web Frontend Framework) to use in Rails Frontend Development. It used to be part of the [Glimmer](https://github.com/AndyObtiva/glimmer) library (created in 2007), but eventually got extracted into its own project. The Ruby gem also includes a [CSS to Glimmer converter](#css-to-glimmer-converter) (`css_to_glimmer`) to automatically convert legacy CSS code into Glimmer DSL syntax.
|
10
10
|
|
11
11
|
Example (you can try in IRB):
|
12
12
|
|
@@ -64,7 +64,7 @@ Please follow these instructions to make the `glimmer` command available on your
|
|
64
64
|
|
65
65
|
Run this command to install directly:
|
66
66
|
```
|
67
|
-
gem install glimmer-dsl-css -v 1.4.
|
67
|
+
gem install glimmer-dsl-css -v 1.4.1
|
68
68
|
```
|
69
69
|
|
70
70
|
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 ...`
|
@@ -79,7 +79,7 @@ That's it! Requiring the gem activates the Glimmer CSS DSL automatically.
|
|
79
79
|
|
80
80
|
Add the following to `Gemfile` (after `glimmer-dsl-swt` and/or `glimmer-dsl-opal` if included too):
|
81
81
|
```
|
82
|
-
gem 'glimmer-dsl-css', '~> 1.4.
|
82
|
+
gem 'glimmer-dsl-css', '~> 1.4.1'
|
83
83
|
```
|
84
84
|
|
85
85
|
And, then run:
|
@@ -217,11 +217,32 @@ css_to_glimmer [-r=rule_keyword] path_to_css_file
|
|
217
217
|
|
218
218
|
Example:
|
219
219
|
|
220
|
+
Suppose we have a CSS file called `input.css`:
|
221
|
+
|
222
|
+
```css
|
223
|
+
html, body {
|
224
|
+
margin:0;
|
225
|
+
padding:0;
|
226
|
+
}
|
227
|
+
|
228
|
+
@media (max-width: 430px) {
|
229
|
+
.footer {
|
230
|
+
height:50px;
|
231
|
+
}
|
232
|
+
|
233
|
+
.filters {
|
234
|
+
bottom:10px;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
```
|
238
|
+
|
239
|
+
We can run this command:
|
240
|
+
|
220
241
|
```
|
221
242
|
css_to_glimmer input.css
|
222
243
|
```
|
223
244
|
|
224
|
-
|
245
|
+
Printout:
|
225
246
|
|
226
247
|
```
|
227
248
|
Converting from CSS syntax to Glimmer DSL Ruby syntax for input file: input.css
|
@@ -230,7 +251,7 @@ Converted output file: input.css.glimmer.rb
|
|
230
251
|
|
231
252
|
Output file (`input.css.glimmer.rb`) is a runnable Ruby file containing Glimmer DSL for CSS syntax:
|
232
253
|
|
233
|
-
```
|
254
|
+
```ruby
|
234
255
|
require 'glimmer-dsl-css'
|
235
256
|
|
236
257
|
include Glimmer
|
@@ -263,7 +284,7 @@ css_to_glimmer -r=ru input.css
|
|
263
284
|
|
264
285
|
Output file (`input.css.glimmer.rb`) is a runnable Ruby file containing Glimmer DSL for CSS syntax:
|
265
286
|
|
266
|
-
```
|
287
|
+
```ruby
|
267
288
|
require 'glimmer-dsl-css'
|
268
289
|
|
269
290
|
include Glimmer
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.1
|
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.4.
|
5
|
+
# stub: glimmer-dsl-css 1.4.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer-dsl-css".freeze
|
9
|
-
s.version = "1.4.
|
9
|
+
s.version = "1.4.1"
|
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-05
|
14
|
+
s.date = "2024-07-05"
|
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]
|
data/lib/glimmer/dsl/css/dsl.rb
CHANGED
@@ -31,9 +31,9 @@ module Glimmer
|
|
31
31
|
include ParentExpression
|
32
32
|
|
33
33
|
def can_interpret?(parent, keyword, *args, &block)
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
block_given? and
|
35
|
+
args.empty? and
|
36
|
+
parent.is_a?(Glimmer::CSS::StyleSheet)
|
37
37
|
end
|
38
38
|
|
39
39
|
def interpret(parent, keyword, *args, &block)
|
@@ -29,9 +29,9 @@ module Glimmer
|
|
29
29
|
include ParentExpression
|
30
30
|
|
31
31
|
def can_interpret?(parent, keyword, *args, &block)
|
32
|
-
|
33
|
-
!
|
34
|
-
|
32
|
+
!block_given? and
|
33
|
+
!args.empty? and
|
34
|
+
parent.is_a?(Glimmer::CSS::Rule)
|
35
35
|
end
|
36
36
|
|
37
37
|
def interpret(parent, keyword, *args, &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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05
|
11
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|