phlex-tabler_icons 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -2
- data/lib/phlex/tabler_icons/icon.rb +6 -12
- data/lib/phlex/tabler_icons/version.rb +1 -1
- 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: ee19e92dadbd63344e0c143f5ca1b88baf2d0a073741b7f01defc435637c079a
|
4
|
+
data.tar.gz: 2e99fafd9e41628a950465c6ec8716f08b4339b2c553d674bd6fdc9ce1970a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27762634b5036b663da38f01f0c12b55243b4f3afa6e20394bf9bb247efe63f35d7f444b3386ba0e1fae33308b85eef7dddbf1e8d1560a636310b5252ce9adfd
|
7
|
+
data.tar.gz: 7484d3722956c5a8b0e9151265a7769d3f0ded71d5958996858f861aa74ef3926236157ab1a272598e7390f45ecf2392c1e55ea7a924e65a84a565ed95b6b4d7
|
data/README.md
CHANGED
@@ -1,17 +1,32 @@
|
|
1
1
|
# Phlex Tabler Icons
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/phlex-tabler_icons.svg)](https://badge.fury.io/rb/phlex-tabler_icons)
|
4
|
+
|
3
5
|
This is a port of [Tabler Icons](https://tabler.io/icons) to [Phlex](https://www.phlex.fun/)
|
4
6
|
|
5
|
-
NOTE
|
7
|
+
> [!NOTE]
|
8
|
+
> Currently the gem only supports outlined icons. Filled icon variants will be introduced soon.
|
6
9
|
|
7
10
|
## Instructions
|
8
11
|
|
9
|
-
|
12
|
+
### Installation
|
13
|
+
|
14
|
+
Add the gem to your application:
|
10
15
|
|
11
16
|
```bash
|
12
17
|
bundle add phlex-tabler_icons
|
13
18
|
```
|
14
19
|
|
20
|
+
That's it!
|
21
|
+
|
22
|
+
### Usage
|
23
|
+
|
24
|
+
Simply render the desired icon in your views. The name of the icon is the same as in the Tabler Icons library, just in pascal case.
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
render Phlex::TablerIcons::Rocket.new(class: "h-8 w-8", stroke_width: 1.5)
|
28
|
+
```
|
29
|
+
|
15
30
|
## Configuration
|
16
31
|
|
17
32
|
Add the following to your initializers
|
@@ -3,18 +3,12 @@ require "phlex"
|
|
3
3
|
module Phlex
|
4
4
|
module TablerIcons
|
5
5
|
class Icon < Phlex::SVG
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
height: Phlex::TablerIcons.configuration.default_height
|
11
|
-
|
12
|
-
stroke_width: Phlex::TablerIcons.configuration.default_stroke_width
|
13
|
-
)
|
14
|
-
@class = classes
|
15
|
-
@height = height
|
16
|
-
@width = width
|
17
|
-
@stroke_width = stroke_width
|
6
|
+
# TODO Remove options[:classes] in future versions
|
7
|
+
def initialize(**options)
|
8
|
+
@class = options[:class] || options[:classes] || Phlex::TablerIcons.configuration.default_class # :classes are for backward compatibility - will be removed in future versions
|
9
|
+
@width = options[:width] || Phlex::TablerIcons.configuration.default_width
|
10
|
+
@height = options[:height] || Phlex::TablerIcons.configuration.default_height
|
11
|
+
@stroke_width = options[:stroke_width] || Phlex::TablerIcons.configuration.default_stroke_width
|
18
12
|
end
|
19
13
|
end
|
20
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex-tabler_icons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elvinas Predkelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|