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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63ac41960245ceacb5eaec363a41bf8f80e56bdea6e150f68a16266b88b96937
4
- data.tar.gz: 40ead61962a906cd7ecf1703afcb5b0998b369416e026e17a0b2cebe3aa770f8
3
+ metadata.gz: 96e2646830dfe42a2cfe0ea91ea369b558d0873917071e963349856b129c1278
4
+ data.tar.gz: 1948d00677cdf1aa4df5cbb90a4632edbd06c03c6162dce55ca2ebb94baa0dff
5
5
  SHA512:
6
- metadata.gz: 07ef93287f2769c303d1159d451468d33d5c6cff4aa81679fa5ff559bc733fbc834d26daf909a7db5f03928b9ced56efef39f34b83d2ffd65a7b5fbb219918ce
7
- data.tar.gz: e9fee33a86f2ba56bc8e9f43071a437e440a0b68f1e9f3bd0755f4497138188118e7d7812860c2f7590f59b23008e2b473dec3ac49746fcb27b10d8becaac51b
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.0
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.0
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.0'
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
- Prints:
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.0
1
+ 1.4.1
@@ -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.0 ruby lib
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.0"
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-18"
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]
@@ -38,9 +38,8 @@ module Glimmer
38
38
  Engine.add_dynamic_expressions(
39
39
  CSS,
40
40
  %w[
41
- media
42
- element_rule
43
41
  dynamic_property
42
+ element_rule
44
43
  ]
45
44
  )
46
45
  end
@@ -31,9 +31,9 @@ module Glimmer
31
31
  include ParentExpression
32
32
 
33
33
  def can_interpret?(parent, keyword, *args, &block)
34
- parent.is_a?(Glimmer::CSS::StyleSheet) and
35
- block_given? and
36
- args.empty?
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
- parent.is_a?(Glimmer::CSS::Rule) and
33
- !block_given? and
34
- !args.empty?
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.0
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-18 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer