Skip to content

Commit

Permalink
Merge 0d0c755 into ee8022f
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh authored Jul 31, 2021
2 parents ee8022f + 0d0c755 commit 08a7e2f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/drift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Drift Detection

on:
pull_request:
branches: [ main ]

jobs:
tailwind:
name: Tailwind
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@aa759c6c94d3800c55b8601f21ba4b2371704cb7
with:
node-version: 15
cache: 'npm'

- run: npm ci

- name: "Drift Detection: tailwind.config.js"
working-directory: app
run: |
export BEFORE=$(openssl sha1 styles.json | sed 's/^.* //')
npx create-tailwind-rn
export AFTER=$(openssl sha1 styles.json | sed 's/^.* //')
if [ "$BEFORE" != "$AFTER" ] ; then
echo "Drift detected: tailwind.config.js, please run 'npx create-tailwind-rn' in the /app directory."
exit 1
fi
14 changes: 13 additions & 1 deletion app/styles.json
Original file line number Diff line number Diff line change
Expand Up @@ -4579,6 +4579,15 @@
"max-w-screen-2xl": {
"maxWidth": 1536
},
"max-w-1/4": {
"maxWidth": "25%"
},
"max-w-1/2": {
"maxWidth": "50%"
},
"max-w-3/4": {
"maxWidth": "75%"
},
"flex-1": {
"flexGrow": 1,
"flexShrink": 1,
Expand Down Expand Up @@ -4695,6 +4704,9 @@
"self-stretch": {
"alignSelf": "stretch"
},
"self-baseline": {
"alignSelf": "baseline"
},
"overflow-hidden": {
"overflow": "hidden"
},
Expand Down Expand Up @@ -8885,4 +8897,4 @@
"no-underline": {
"textDecorationLine": "none"
}
}
}
5 changes: 5 additions & 0 deletions app/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ module.exports = {
success: '#02b31b',
error: '#ff0000',
warning: '#ff9629'
},
maxWidth: {
'1/4': '25%',
'1/2': '50%',
'3/4': '75%'
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions app/tailwind.js → app/tailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ const fonts = {
}

/**
* @description Allows to use custom tailwind classes
* Allows to use custom tailwind classes.
* @example `tailwind('text-primary')
* */
*
* Please do not edit this file.
*
* If you want to use extend tailwind, please edit 'tailwind.config.js' and run 'npx create-tailwind-rn'
* in this directory after you have edited the file.
*/
const { tailwind, getColor } = create({ ...styles, ...fonts })
export { tailwind, getColor }

0 comments on commit 08a7e2f

Please sign in to comment.