Skip to content

Commit 340ba95

Browse files
committed
Publish react-native-css-gradient
0 parents  commit 340ba95

File tree

15 files changed

+1190
-0
lines changed

15 files changed

+1190
-0
lines changed

.gitignore

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
.DS_Store
2+
# Created by .ignore support plugin (hsz.mobi)
3+
### Android template
4+
# Built application files
5+
*.apk
6+
*.ap_
7+
8+
Pods/
9+
10+
# Files for the ART/Dalvik VM
11+
*.dex
12+
13+
# Java class files
14+
*.class
15+
16+
# Generated files
17+
bin/
18+
gen/
19+
out/
20+
21+
# Gradle files
22+
.gradle/
23+
build/
24+
25+
# Local configuration file (sdk path, etc)
26+
local.properties
27+
28+
# Proguard folder generated by Eclipse
29+
proguard/
30+
31+
# Log Files
32+
*.log
33+
34+
# Android Studio Navigation editor temp files
35+
.navigation/
36+
37+
# Android Studio captures folder
38+
captures/
39+
40+
# IntelliJ
41+
*.iml
42+
.idea/workspace.xml
43+
.idea/tasks.xml
44+
.idea/gradle.xml
45+
.idea/assetWizardSettings.xml
46+
.idea/dictionaries
47+
.idea/libraries
48+
.idea/caches
49+
50+
# Keystore files
51+
# Uncomment the following line if you do not want to check your keystore files in.
52+
#*.jks
53+
54+
# External native build folder generated in Android Studio 2.2 and later
55+
.externalNativeBuild
56+
57+
# Google Services (e.g. APIs or Firebase)
58+
google-services.json
59+
60+
# Freeline
61+
freeline.py
62+
freeline/
63+
freeline_project_description.json
64+
65+
# fastlane
66+
fastlane/report.xml
67+
fastlane/Preview.html
68+
fastlane/screenshots
69+
fastlane/test_output
70+
fastlane/readme.md
71+
### JetBrains template
72+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
73+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
74+
75+
# User-specific stuff
76+
.idea/**/workspace.xml
77+
.idea/**/tasks.xml
78+
.idea/**/dictionaries
79+
.idea/**/shelf
80+
81+
# Sensitive or high-churn files
82+
.idea/**/dataSources/
83+
.idea/**/dataSources.ids
84+
.idea/**/dataSources.local.xml
85+
.idea/**/sqlDataSources.xml
86+
.idea/**/dynamic.xml
87+
.idea/**/uiDesigner.xml
88+
89+
# Gradle
90+
.idea/**/gradle.xml
91+
.idea/**/libraries
92+
93+
# CMake
94+
cmake-build-debug/
95+
cmake-build-release/
96+
97+
# Mongo Explorer plugin
98+
.idea/**/mongoSettings.xml
99+
100+
# File-based project format
101+
*.iws
102+
103+
# IntelliJ
104+
105+
# mpeltonen/sbt-idea plugin
106+
.idea_modules/
107+
108+
# JIRA plugin
109+
atlassian-ide-plugin.xml
110+
111+
# Cursive Clojure plugin
112+
.idea/replstate.xml
113+
114+
# Crashlytics plugin (for Android Studio and IntelliJ)
115+
com_crashlytics_export_strings.xml
116+
crashlytics.properties
117+
crashlytics-build.properties
118+
fabric.properties
119+
120+
# Editor-based Rest Client
121+
.idea/httpRequests
122+
### Objective-C template
123+
# Xcode
124+
#
125+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
126+
127+
## Build generated
128+
DerivedData/
129+
130+
## Various settings
131+
*.pbxuser
132+
!default.pbxuser
133+
*.mode1v3
134+
!default.mode1v3
135+
*.mode2v3
136+
!default.mode2v3
137+
*.perspectivev3
138+
!default.perspectivev3
139+
xcuserdata/
140+
141+
## Other
142+
*.moved-aside
143+
*.xccheckout
144+
*.xcscmblueprint
145+
146+
## Obj-C/Swift specific
147+
*.hmap
148+
*.ipa
149+
*.dSYM.zip
150+
*.dSYM
151+
152+
# CocoaPods
153+
#
154+
# We recommend against adding the Pods directory to your .gitignore. However
155+
# you should judge for yourself, the pros and cons are mentioned at:
156+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
157+
#
158+
mobile/ios/Pods/
159+
160+
# Carthage
161+
#
162+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
163+
# Carthage/Checkouts
164+
165+
Carthage/Build
166+
167+
# fastlane
168+
#
169+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
170+
# screenshots whenever they are needed.
171+
# For more information about the recommended setup visit:
172+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
173+
174+
175+
# Code Injection
176+
#
177+
# After new code Injection tools there's a generated folder /iOSInjectionProject
178+
# https://github.com/johnno1962/injectionforxcode
179+
180+
dist
181+
package-lock.json
182+
*/node_modules
183+
.idea
184+
.vscode
185+
.env*

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# CSS Gradient for LinearGradient
2+
3+
CSS background image for React-Native.
4+
Supported backgrounds:
5+
- [linear-gradient](https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient)
6+
- [repeating-linear-gradient](https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-linear-gradient)
7+
8+
9+
![image](./screenshots/gif.gif)
10+
<br/>
11+
<img src="./screenshots/grad1.png" width="400">
12+
<br/>
13+
<img src="./screenshots/grad2.png" width="400">
14+
<br/>
15+
<img src="./screenshots/grad3.png" width="400">
16+
<br/>
17+
<img src="./screenshots/grad4.png" width="400">
18+
<br/>
19+
<img src="./screenshots/grad5.png" width="400">
20+
<br/>
21+
<img src="./screenshots/grad6.png" width="400">
22+
23+
24+
### Usage
25+
26+
```
27+
import Gradient from 'react-native-css-gradient`;
28+
29+
render() {
30+
const gradient = `linear-gradient(-225deg, #231557 0%, #44107A 29%, #FF1361 67%, #FFF800 100%), repeating-linear-gradient(-115deg, transparent, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 40px), repeating-linear-gradient(115deg, transparent, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 40px)`;
31+
32+
return <Gradient gradient={gradient} style={yourStyle}>
33+
}
34+
```
35+
36+
This library will first try to import `LinearGradient` from [Expo](https://expo.io) or fallback to [react-native-linear-gradient](https://github.com/react-native-community/react-native-linear-gradient).
37+
38+
### Props
39+
40+
|Prop|Details|
41+
|---|---|
42+
|gradient|CSS Gradient (linear and repeating) are working for the moment|
43+
|style|default styles (**Note, if you're going to use repeating gradient you have to specify the width and height**)|
44+
|children|-|
45+
46+
47+
### About
48+
49+
If you have questions please don't hesistate to contact me on [Twitter](http://twitter.com/mironcatalin).

example/assets/icons/app-icon.png

2.91 KB
Loading

example/assets/icons/loading-icon.png

2.91 KB
Loading

0 commit comments

Comments
 (0)