You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://packagist.org/packages/visuellverstehen/statamic-classify)
4
4
5
5
# Classify
@@ -9,23 +9,9 @@ Classify is a useful helper to add CSS classes to all HTML tags generated by the
9
9
10
10
## Requirements
11
11
12
-
- Statamic v3 || v4
13
-
- Laravel 9 || 10
14
-
- PHP 8
15
-
16
-
### Version compatibility
17
-
18
-
| Classify | Statamic | Laravel
19
-
|:----------|:----------------|:---------
20
-
| ^1.0 | 3.0 | ^7.0
21
-
| ^2.0 | 3.0 | ^8.0
22
-
| ^2.1 | 3.1 | ^8.0
23
-
| ^2.2 | 3.1 | ^8.0
24
-
| ^2.3 | 3.2 | ^8.0
25
-
| ^2.4 | ^3.0 | ^9.0
26
-
| ^2.5 | ^3.0 \|\| ^4.0 | ^9.0
27
-
| ^2.6 | ^3.0 \|\| ^4.0 | ^9.0 \|\| ^10.0
28
-
12
+
- Statamic v4 || v5
13
+
- Laravel 10 || 11
14
+
- PHP 8.2+
29
15
30
16
## Installation
31
17
@@ -74,7 +60,7 @@ If you want to use the default style set, use the `classify` modifier.
74
60
{{ bard_text | classify }}
75
61
```
76
62
77
-
If you want to add multiple style sets, define those in the config file. For example:
63
+
If you want to add multiple style sets, you can define those in the config file:
78
64
```php
79
65
'default' => [
80
66
//
@@ -101,23 +87,21 @@ If you want to get the defined classes for a certain element, you can get them s
101
87
// output: link hover:underline
102
88
```
103
89
104
-
## Nested selectors (min version 2.2)
105
-
You can nest your selectors to flexible style elements in different contexts.
90
+
## Nested selectors
91
+
You can nest your selectors to style elements differently in varying contexts.
92
+
93
+
Let's assume you want to style links inside lists differently to a general link, you can make use of nesting:
106
94
107
-
Let's assume you want to style links inside lists differently than a general link, you can make use of nesting:
108
95
```php
109
96
`ul li p a` => 'my-secial-css-class-for-nested-links-in-lists`,
110
97
`a` => `a-general-link-class`,
111
98
```
112
99
113
-
The order doesn't matter. Classify will take care of that for you.
100
+
Classify will take care of the order, so you don't need to define the nested selector before the general selector.
114
101
115
102
## Working with CSS frameworks (like TailwindCSS)
116
103
117
-
Some CSS frameworks utilize JIT compiling, or have some other means of purging CSS classes from production builds to reduce file sizes.
118
-
119
-
Make sure to include your CSS classes as content, so TailwindCSS can include those in the compiled file. This is important, as your
120
-
classify CSS classes may not be in your template files, as they will be added dynamically.
104
+
Some CSS frameworks utilize JIT compiling, or have some other means of purging CSS classes from production builds to reduce file size. Your classify CSS classes may not appear anywhere else in your template files, as they will be added dynamically. To make sure that your classes will be considered for compiling, you have to include the classify config file as content:
0 commit comments