phlex-tabler_icons 0.2.0 → 0.2.1
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 +7 -11
- 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: af9e945bf47999791327bcd24ace00ebea77c004c2c824ff4f4c31b4936f14f7
|
4
|
+
data.tar.gz: f1f920fdc30078b3bf85b6a7ae6d467cc987333b1b651582ec7e7f2987e41757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df71bb628344a11eef9f69a4bbfedc91f96d9c10da4113974f72e2a65eaa4aff4d9f5b80a546dc298402bd5afc009fd0f8b32f41580dc8f77cfa64c50fdb1ef3
|
7
|
+
data.tar.gz: 88021612916256c0ee25de5fe8e44f229bc114adff3bc14961bf6f6b41fa11ca225221ccde91c7fac43641e5d0249d33a9092aa99b0a7ca47821745337a5511c
|
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,14 @@ require "phlex"
|
|
3
3
|
module Phlex
|
4
4
|
module TablerIcons
|
5
5
|
class Icon < Phlex::SVG
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :class, :height, :width, :stroke_width
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
width: Phlex::TablerIcons.configuration.default_width
|
12
|
-
|
13
|
-
|
14
|
-
@class = classes
|
15
|
-
@height = height
|
16
|
-
@width = width
|
17
|
-
@stroke_width = stroke_width
|
8
|
+
# TODO Remove options[:classes] in future versions
|
9
|
+
def initialize(**options)
|
10
|
+
@class = options[:class] || options[:classes] || Phlex::TablerIcons.configuration.default_class # :classes are for backward compatibility - will be removed in future versions
|
11
|
+
@width = options[:width] || Phlex::TablerIcons.configuration.default_width
|
12
|
+
@height = options[:height] || Phlex::TablerIcons.configuration.default_height
|
13
|
+
@stroke_width = options[:stroke_width] || Phlex::TablerIcons.configuration.default_stroke_width
|
18
14
|
end
|
19
15
|
end
|
20
16
|
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.1
|
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
|