Skip to content

Commit 87e74ea

Browse files
committed
feat: long shadow
1 parent b2acfa3 commit 87e74ea

File tree

13 files changed

+5973
-84
lines changed

13 files changed

+5973
-84
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ esbuild.config.js
2424
*.svg
2525
README.md
2626
CHANGELOG.md
27+
img

README.md

Lines changed: 42 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<a href="#installation" width="100%">
2-
<img src="banner.svg" alt="Title banner"/>
2+
<img src="img/banner.svg" alt="Title banner"/>
33
</a>
44

55
## Tailwind CSS Text Shadow Plugin
66

7+
[![NPM](https://nodei.co/npm/@designbycode/tailwindcss-text-shadow.png?mini=true)](https://nodei.co/npm/@designbycode/tailwindcss-text-shadow/)
8+
79
[![npm version](https://badge.fury.io/js/@designbycode%2Ftailwindcss-text-shadow.svg)](https://badge.fury.io/js/@designbycode%2Ftailwindcss-text-shadow)
810
![npm](https://img.shields.io/npm/dt/%40designbycode/tailwindcss-text-shadow)
911
![NPM](https://img.shields.io/npm/l/%40designbycode%2Ftailwindcss-text-shadow)
@@ -13,35 +15,33 @@
1315
[![GitHub stars](https://img.shields.io/github/stars/DesignByCode/tailwindcss-text-shadow?style=social)](https://github.com/DesignByCode/tailwindcss-text-shadow/stargazers)
1416
[![HitCount](https://hits.dwyl.com/designbycode/tailwindcss-text-shadow.svg?style=flat)](http://hits.dwyl.com/designbycode/tailwindcss-text-shadow)
1517

16-
[![NPM](https://nodei.co/npm/@designbycode/tailwindcss-text-shadow.png)](https://nodei.co/npm/@designbycode/tailwindcss-text-shadow/)
17-
1818
The Tailwind CSS **Text Shadow Plugin** extends the default set of utility classes in **Tailwind CSS** to provide easy text shadow customization for your web projects. With this plugin, you can apply custom text shadows using utility
1919
classes or define your own text shadow variations based on predefined steps and color palettes.
2020

21-
![TextShadow Plugin](screenshot.png)
21+
![TextShadow Plugin](img/screenshot.png)
2222

2323
## 📇 Table of Contents
2424

25-
* [Installation](#installation)
26-
* [Using pnpm](#using-pnpm)
27-
* [Using npm](#using-npm)
28-
* [Using yarn](#using-yarn)
29-
* [Setup](#setup)
30-
* [Default configuration styles](#default-configuration-styles)
31-
* [Use](#use)
32-
* [Video Tutorial](#video-tutorial)
33-
* [Apply Text Shadows](#apply-text-shadows)
34-
* [Text shadow blur modifier](#text-shadow-blur-modifier)
35-
* [Text shadow x and y modifiers](#text-shadow-x-and-y-modifiers)
36-
* [Text shadow color modifier](#text-shadow-color-modifier)
37-
* [Text shadow color opacity](#text-shadow-color-opacity)
38-
* [Long shadow](#long-text-shadow)
39-
* [Customization](#customization)
40-
* [Example](#example)
41-
* [Contributing](#contributing)
42-
* [License](#license)
43-
* [Author](#author)
44-
* [Acknowledgments](#acknowledgments)
25+
- [Installation](#installation)
26+
- [Using pnpm](#using-pnpm)
27+
- [Using npm](#using-npm)
28+
- [Using yarn](#using-yarn)
29+
- [Setup](#setup)
30+
- [Default configuration styles](#default-configuration-styles)
31+
- [Use](#use)
32+
- [Video Tutorial](#video-tutorial)
33+
- [Apply Text Shadows](#apply-text-shadows)
34+
- [Text shadow blur modifier](#text-shadow-blur-modifier)
35+
- [Text shadow x and y modifiers](#text-shadow-x-and-y-modifiers)
36+
- [Text shadow color modifier](#text-shadow-color-modifier)
37+
- [Text shadow color opacity](#text-shadow-color-opacity)
38+
- [Long shadow](#long-text-shadow)
39+
- [Customization](#customization)
40+
- [Example](#example)
41+
- [Contributing](#contributing)
42+
- [License](#license)
43+
- [Author](#author)
44+
- [Acknowledgments](#acknowledgments)
4545

4646
## Installation
4747

@@ -77,7 +77,7 @@ module.exports = {
7777
// ...other plugins
7878
require("@designbycode/tailwindcss-text-shadow"),
7979
],
80-
};
80+
}
8181
```
8282

8383
### Default configuration styles
@@ -103,47 +103,39 @@ module.exports = {
103103
104104
See plugin in action in video below. 👇
105105
106-
[![Tailwindcss text-shadow tutorial](thumb-play.png)](https://youtu.be/Xb0wAMAGAHE)
106+
[![Tailwindcss text-shadow tutorial](img/thumb-play.png)](https://youtu.be/Xb0wAMAGAHE)
107107
108108
### Apply Text Shadows
109109
110110
Once the plugin is added to your Tailwind CSS configuration, you can use the provided utility classes to apply text shadows to your HTML elements.
111111
112112
```html
113-
<h1 class="text-4xl text-shadow ">
114-
Hello, Tailwind CSS!
115-
</h1>
113+
<h1 class="text-4xl text-shadow ">Hello, Tailwind CSS!</h1>
116114
```
117115
118116
### Text shadow blur modifier
119117
120-
To make the spread or blur bigger add the ```.text-shadow-blur-{value}```
118+
To make the spread or blur bigger add the `.text-shadow-blur-{value}`
121119
122120
```html
123-
<h1 class="text-4xl text-shadow text-shadow-blur-2 ">
124-
Hello, Tailwind CSS!
125-
</h1>
121+
<h1 class="text-4xl text-shadow text-shadow-blur-2 ">Hello, Tailwind CSS!</h1>
126122
```
127123
128124
### Text shadow x and y modifiers
129125
130-
The shadow can be moved on the xy axis using ```.text-shadow-x-{value}``` and ```.text-shadow-y-{value}```
126+
The shadow can be moved on the xy axis using `.text-shadow-x-{value}` and `.text-shadow-y-{value}`
131127
132128
```html
133-
<h1 class="text-4xl text-shadow text-shadow-x-md text-shadow-y-lg text-shadow-blur-2 text-shadow-red">
134-
Hello, Tailwind CSS!
135-
</h1>
129+
<h1 class="text-4xl text-shadow text-shadow-x-md text-shadow-y-lg text-shadow-blur-2 text-shadow-red">Hello, Tailwind CSS!</h1>
136130
```
137131
138132
### Text shadow color modifier
139133
140134
```html
141-
<h1 class="text-4xl text-shadow text-shadow-x-md text-shadow-y-lg text-shadow-blur-2 text-shadow-red-500">
142-
Hello, Tailwind CSS!
143-
</h1>
135+
<h1 class="text-4xl text-shadow text-shadow-x-md text-shadow-y-lg text-shadow-blur-2 text-shadow-red-500">Hello, Tailwind CSS!</h1>
144136
```
145137
146-
In the example above, the ```<h1>``` element will have a red text shadow with an x offset of 3px, a y offset of 4px, and a blur radius of 2px. The text-shadow class enables the text shadow styles, while the text-shadow-x-md,
138+
In the example above, the `<h1>` element will have a red text shadow with an x offset of 3px, a y offset of 4px, and a blur radius of 2px. The text-shadow class enables the text shadow styles, while the text-shadow-x-md,
147139
text-shadow-y-lg, and
148140
text-shadow-blur-2 classes customize the horizontal offset, vertical offset, and blur radius, respectively.
149141
@@ -152,21 +144,15 @@ text-shadow-blur-2 classes customize the horizontal offset, vertical offset, and
152144
To change the opacity of the text-shadow-color use the following method
153145
154146
```html
155-
<h1 class="text-shadow text-shadow-red-500/10">
156-
Hello, Tailwind CSS!
157-
</h1>
147+
<h1 class="text-shadow text-shadow-red-500/10">Hello, Tailwind CSS!</h1>
158148

159149
<!-- with arbitrary values -->
160150

161-
<h1 class="text-shadow text-shadow-red-[rgb(0,0,0,0.5)]">
162-
Hello, Tailwind CSS!
163-
</h1>
151+
<h1 class="text-shadow text-shadow-red-[rgb(0,0,0,0.5)]">Hello, Tailwind CSS!</h1>
164152

165153
<!-- or arbitrary with / -->
166154

167-
<h1 class="text-shadow text-shadow-red-[gray]/20">
168-
Hello, Tailwind CSS!
169-
</h1>
155+
<h1 class="text-shadow text-shadow-red-[gray]/20">Hello, Tailwind CSS!</h1>
170156
```
171157
172158
> **Warning**
@@ -184,19 +170,15 @@ module.exports = {
184170
185171
### Long text shadow
186172
187-
The long shadow is a new experimental feature that I add. It creates shadow that stacks to any amount. The classes is ```.text-shadow-long``` or ```.text-shadow-long-{size}``` or ```.text-shadow-long-[steps]```
173+
The long shadow is a new experimental feature that I add. It creates shadow that stacks to any amount. The classes is `.text-shadow-sm` or `.text-shadow-[steps]`
188174
189175
```html
190-
<h1 class="text-shadow-long text-shadow-blur-2 text-shadow-red">
191-
Hello, Tailwind CSS!
192-
</h1>
176+
<h1 class="text-shadow-sm text-shadow-blur-2 text-shadow-red">Hello, Tailwind CSS!</h1>
193177
<!-- or -->
194-
<h1 class="text-shadow-long-[1000]">
195-
Hello, Tailwind CSS!
196-
</h1>
178+
<h1 class="text-shadow-[1000]">Hello, Tailwind CSS!</h1>
197179
```
198180
199-
[![Tailwindcss text-shadow tutorial](play-thumbnail-text-shadow.png)](https://youtu.be/quyJpz5dtcs)
181+
[![Tailwindcss text-shadow tutorial](img/play-thumbnail-text-shadow.png)](https://youtu.be/quyJpz5dtcs)
200182
201183
## Customization
202184
@@ -209,7 +191,6 @@ shadow.
209191
// tailwind.config.js
210192
module.exports = {
211193
theme: {
212-
experimental: false,
213194
textShadowSteps: {
214195
sm: "1px",
215196
md: "2px",
@@ -222,7 +203,7 @@ module.exports = {
222203
4: "4px",
223204
},
224205
},
225-
};
206+
}
226207
```
227208
228209
In this example, we have customized the textShadowSteps object with only four steps for sm, md, lg, and xl, and removed the rest. The plugin will generate utility classes accordingly.
@@ -232,12 +213,11 @@ In this example, we have customized the textShadowSteps object with only four st
232213
Contributions to this plugin are welcome! If you encounter any issues, have feature requests, or want to improve the plugin, feel free to create a pull request or submit an issue on the GitHub repository.
233214
234215
### Contributors
216+
235217
<a href="https://github.com/DesignByCode/tailwindcss-text-shadow/graphs/contributors">
236218
<img src="https://contrib.rocks/image?repo=DesignByCode/tailwindcss-text-shadow" />
237219
</a>
238220
239-
240-
241221
## License
242222
243223
This project is licensed under the [MIT](LICENCE) License - see the [LICENSE](LICENCE) file for details.
@@ -254,4 +234,3 @@ com/~designbycode_"> @designbycode_</a></li></ul>
254234
255235
- This plugin is inspired by the needs of web developers using Tailwind CSS.
256236
- Special thanks to the Tailwind CSS team for creating such an amazing framework.
257-

coverage/coverage-summary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{"total": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
2-
,"C:\\www\\npm-packages\\tailwindcss-text-shadow\\src\\generateShadows.ts": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
2+
,"C:\\www\\npm-packages\\packages\\tailwindcss-text-shadow\\src\\generateShadows.ts": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
33
}

dist/index.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/index.umd.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)