Repository: ritterim/skellyCSS
Branch: main
Commit: fffd04428ed8
Files: 21
Total size: 43.7 KB
Directory structure:
gitextract_9np7qz46/
├── .github/
│ ├── CODEOWNERS
│ └── workflows/
│ ├── pr-build.yml
│ ├── pr-merged.yml
│ └── version-tag-build-master.yml
├── .gitignore
├── .sassrc
├── LICENSE
├── README.md
├── build.cmd
├── examples/
│ ├── blog-post.html
│ └── index.html
├── index.html
├── main.js
├── package/
│ ├── LICENSE
│ ├── README.md
│ └── package.json
├── package.json
├── postcss.config.js
├── src/
│ ├── index.js
│ └── style.scss
└── vite.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/CODEOWNERS
================================================
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
/.github/** @ritterim/GitGuardians
================================================
FILE: .github/workflows/pr-build.yml
================================================
name: PR Build
permissions:
contents: read
packages: read
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
# By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened.
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches:
- main
jobs:
pr-build:
uses: ritterim/public-github-actions/.github/workflows/npm-packages-pr-build.yml@v1.16.5
#uses: ./.github/workflows/npm-packages-pr-build.yml
with:
always_increment_patch_version: true
npm_package_name: skellycss
run_tests: false
================================================
FILE: .github/workflows/pr-merged.yml
================================================
name: PR Merged
permissions:
contents: read
id-token: write
packages: read
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
# By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened.
# We want to run on 'closed' to trigger, but we also have to check if it was merged.
# That check is: if: github.event.pull_request.merged == true
pull_request_target:
types: [ closed ]
branches:
- main
jobs:
npm-packages-pr-create-tag:
uses: ritterim/public-github-actions/.github/workflows/npm-packages-pr-create-tag-jfrog.yml@v1.16.5
#uses: ./.github/workflows/npm-packages-pr-create-tag-jfrog.yml
if: github.event.pull_request.merged == true
secrets:
gh_actions_secret_passing_passphrase: ${{ secrets.ACTIONS_SECRET_PASSING_PASSPHRASE }}
gh_app_private_key: ${{ secrets.RIMDEV_NPM_RELEASES_APP_PRIVATE_KEY }}
with:
always_increment_patch_version: true
gh_app_id: ${{ vars.RIMDEV_NPM_RELEASES_APP_APPID }}
jfrog_api_base_url: ${{ vars.JFROG_API_BASE_URL }}
jfrog_artifactory_repository: "${{ vars.JFROG_NPM_PACKAGE_REPO_BASENAME }}-draft"
jfrog_audit_xray_watch_list: ${{ vars.JFROG_AUDIT_XRAY_WATCH_LIST }}
jfrog_build_basename: ${{ vars.JFROG_BUILD_BASENAME }}
jfrog_npm_feed_repo: ${{ vars.JFROG_ARTIFACTORY_VIRTUAL_REPO_NPM }}
jfrog_npm_package_repo_basename: ${{ vars.JFROG_NPM_PACKAGE_REPO_BASENAME }}
jfrog_oidc_provider_name: ${{ vars.JFROG_GHA_OIDC_PROVIDER_NAME }}
npm_package_name: skellycss
run_tests: false
================================================
FILE: .github/workflows/version-tag-build-master.yml
================================================
name: Version Tag Build
permissions:
contents: write
id-token: write
packages: write
on:
push:
# To limit whether this executes on a specific branch, you must adjust the allowed_branches input.
# Specifying 'branches' here is a logical 'OR', not a logical 'AND'.
tags:
- v0.*
jobs:
version-tag-build:
uses: ritterim/public-github-actions/.github/workflows/npm-packages-release-on-tag-jfrog.yml@v1.16.5
#uses: ./.github/workflows/npm-packages-release-on-tag-jfrog.yml
secrets:
npmjs_org_api_key: ${{ secrets.RITTERIM_NPMJS_PUBLISH_TOKEN }}
with:
allowed_branches: |
main
jfrog_api_base_url: ${{ vars.JFROG_API_BASE_URL }}
jfrog_artifactory_repository: "${{ vars.JFROG_NPM_PACKAGE_REPO_BASENAME }}-prod"
jfrog_audit_xray_watch_list: ${{ vars.JFROG_AUDIT_XRAY_WATCH_LIST }}
jfrog_build_basename: ${{ vars.JFROG_BUILD_BASENAME }}
jfrog_npm_feed_repo: ${{ vars.JFROG_ARTIFACTORY_VIRTUAL_REPO_NPM }}
jfrog_npm_package_repo_basename: ${{ vars.JFROG_NPM_PACKAGE_REPO_BASENAME }}
jfrog_oidc_provider_name: ${{ vars.JFROG_GHA_OIDC_PROVIDER_NAME }}
npm_package_name: skellycss
run_tests: false
npmjs_org_access_public: true
publish_to_npmjs_org: true
================================================
FILE: .gitignore
================================================
#Distribution
dist/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
#Other Files
.DS_store
================================================
FILE: .sassrc
================================================
{
"includePaths": ["node_modules"]
}
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2020 Ritter Insurance Marketing
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# skellyCSS
A light-weight CSS framework to quickly implement skeletons into your projects.
Table of Contents
- [skellyCSS](#skellycss)
- [Installation](#installation)
- [npm](#npm)
- [CSS](#css)
- [JavaScript](#javascript)
- [Quick Usage](#quick-usage)
- [Usage](#usage)
- [Headers](#headers)
- [Paragraphs](#paragraphs)
- [Line Width](#line-width)
- [Alignment](#alignment)
- [Images](#images)
- [Sizes](#sizes)
- [Shapes](#shapes)
- [Animation](#animation)
- [JavaScript Utility](#javascript-utility)
- [JavaScript Data Attributes](#javascript-data-attributes)
- [All Data Attributes](#all-data-attributes)
## Installation
### npm
To install via node package manager:
```shell
npm install @ritterim/skellycss
```
### CSS
Include the Skelly css file wherever you add your CSS:
``` html
```
### JavaScript
Include the skelly.js file wherever you add your JavaScript:
``` html
```
## Quick Usage
You can quickly get started using skellyCSS using the JavaScript utility, like so:
``` html
```
**See full [JavaScript Utility](#javascript-utility) docs below**
## Usage
Skeletons can be quickly added to any project with a few simple lines of code.
### Headers
Apply the `skeleton` class to any type of header and it will automatically adjust to the font-size of the header stylings:

``` html
```
### Paragraphs
You can create paragraph skeletons by applying the `skeleton` class to the paragraph tag, then including however many span tags you'd like with the `skeleton__line` class within the paragraph. In order to make the paragraph skeleton look more like a paragraph, the last line is set to 50% width.

```html
```
### Line Width
You can adjust the line width by applying a size modifier class:
| Width | Modifier Class |
| ------------ | ------------|
| Small, 25% | `.skeleton--sm` |
| Medium, 50% | `.skeleton--md` |
| Large, 75% | `.skeleton--lg` |
| Full, 100% | `.skeleton--full` |

``` html
```
### Alignment
You can text align the skeleton using alignment modifier classes:
| Alignment | Modifier Class |
| ------------ | ------------|
| Left | `.skeleton--left` |
| Center | `.skeleton--center` |
| Right | `.skeleton--right` |

``` html
```
### Images
You can create an image skeleton by using the `.skeleton-image` class. By default this will apply the image skeleton at 100% height and width of the parent container.
#### Sizes
Here are some default sizes we have included for skeleton images:
| Size | Modifier Class |
| ------------ | ------------|
| Small, 50x50 | `.skeleton-image--sm` |
| Medium, 100x100 | `.skeleton-image--md` |
| Large, 200x200 | `.skeleton-image--lg` |
| X-Large, 400x400 | `.skeleton-image--xl` |
| Full, 100% x 100% | `.skeleton-image--full` |

``` html
```
#### Shapes
You can also make different image shapes using shape modifier classes:
| Shape | Description | Modifier Class |
| ------------ |------------ | ------------|
| Square | Sets the image aspect ratio to 1/1 (default) | `.skeleton-image--square` |
| Circle | Sets the border radius to 50% | `.skeleton-image--circle` |
| Landscape Rectangle | Sets the image aspect ratio to 4/3 | `.skeleton-image--landscape` |
| Portrait Rectangle | Sets the image aspect ratio to 3/4| `.skeleton-image--portrait` |
| Wide Rectangle | Sets the image aspect ratio to 16/9 | `.skeleton-image--wide` |
| Tall Rectangle | Sets the image aspect ratio to 9/16 | `.skeleton-image--tall` |
``` html
```
### Animation
To add animation, add a `span.skeleton--animation` within the `.skeleton__line` elements in headers or paragaphs.

``` html
```
## JavaScript Utility
The easiest and our preferred way to add Skeletons is by using the included JavaScript utilities.
On either a header tag or a paragraph tag, add the `skeleton` class and a `data-lines` attribute with the number of lines you'd like the skeleton to have:
``` html
```
You can also give the skeleton animation by adding the `data-animation` attribute and setting it to `true`:
``` html
```
### JavaScript Data Attributes
You can alter the way skeleton looks by utilizing other data-attributes as well, including opacity and color:
``` html
```
#### All Data Attributes
| Attribute | Description | Type |
| ------------ |------------ | ------------|
| `data-lines` | Determines how many lines to output | Integer |
| `data-animation` | Adds animation to the skeleton lines | Boolean |
| `data-opacity` | Sets the opacity of the skeleton lines (sets opacity between 0 and 1) | Float |
| `data-color` | Sets the color of the skeleton lines | Color |
================================================
FILE: build.cmd
================================================
@echo Off
pushd %~dp0
setlocal
:Build
call npm install
if %ERRORLEVEL% neq 0 goto BuildFail
if "%APPVEYOR%" equ "True" (
echo *** Building Production [%APPVEYOR_REPO_BRANCH%] ***
call npm run build
) else (
echo *** Building Default ***
call npm run serve
)
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess
:BuildFail
echo.
echo *** BUILD FAILED ***
goto End
:BuildSuccess
echo.
echo *** BUILD SUCCEEDED ***
goto End
:End
echo.
popd
exit /B %ERRORLEVEL%
================================================
FILE: examples/blog-post.html
================================================
Blog Post
================================================
FILE: main.js
================================================
import './src/style.scss';
import './src/index.js';
================================================
FILE: package/LICENSE
================================================
MIT License
Copyright (c) 2020 Ritter Insurance Marketing
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: package/README.md
================================================
# skellyCSS
A light-weight CSS framework to quickly implement skeletons into your projects.
Table of Contents
- [skellyCSS](#skellycss)
- [Installation](#installation)
- [CSS](#css)
- [JavaScript](#javascript)
- [Quick Usage](#quick-usage)
- [Usage](#usage)
- [Headers](#headers)
- [Paragraphs](#paragraphs)
- [Line Width](#line-width)
- [Alignment](#alignment)
- [Images](#images)
- [Sizes](#sizes)
- [Shapes](#shapes)
- [Animation](#animation)
- [JavaScript Utility](#javascript-utility)
## Installation
### CSS
Include the skelly.css file wherever you add your CSS:
``` html
```
### JavaScript
Include the skelly.js file wherever you add your JavaScript:
``` html
```
## Quick Usage
You can quickly get started using skellyCSS using the JavaScript utility, like so:
``` html
```
**See full [JavaScript Utility](#javascript-utility) docs below**
## Usage
Skeletons can be quickly added to any project with a few simple lines of code.
### Headers
Apply the `skeleton` class to any type of header and it will automatically adjust to the font-size of the header stylings:

``` html
```
### Paragraphs
You can create paragraph skeletons by applying the `skeleton` class to the paragraph tag, then including however many span tags you'd like with the `skeleton__line` class within the paragraph. In order to make the paragraph skeleton look more like a paragraph, the last line is set to 50% width.

```html
```
### Line Width
You can adjust the line width by applying a size modifier class:
| Width | Modifier Class |
| ------------ | ------------|
| Small, 25% | `.skeleton--sm` |
| Medium, 50% | `.skeleton--md` |
| Large, 75% | `.skeleton--lg` |
| Full, 100% | `.skeleton--full` |

``` html
```
### Alignment
You can text align the skeleton using alignment modifier classes:
| Alignment | Modifier Class |
| ------------ | ------------|
| Left | `.skeleton--left` |
| Center | `.skeleton--center` |
| Right | `.skeleton--right` |

``` html
```
### Images
You can create an image skeleton by adding the `.skeleton-image` class to an img tag -- do not include the `src` attribute. By default this will apply the image skeleton at 100% height and width of the parent container.
#### Sizes
Here are some default sizes we have included for skeleton images:
| Size | Modifier Class |
| ------------ | ------------|
| Small, 50x50 | `.skeleton-image--sm` |
| Medium, 100x100 | `.skeleton-image--md` |
| Large, 200x200 | `.skeleton-image--lg` |
| X-Large, 400x400 | `.skeleton-image--xl` |
| Full, 100% x 100% | `.skeleton-image--full` |

``` html
```
#### Shapes
You can also make different image shapes using shape modifier classes:
| Shape | Description | Modifier Class |
| ------------ |------------ | ------------|
| Landscape Rectangle | Sets the width of the image to 100% | `.skeleton-image--landscape` |
| Portrait Rectangle | Sets the height of the image to 100% | `.skeleton-image--portrait` |
| Circle | Sets the border radius to 50% | `.skeleton-image--circle` |

``` html
```
### Animation
To add animation, add a `span.skeleton--animation` within the `.skeleton__line` elements in headers or paragaphs.

``` html