From c5a55f00c44dd00487962b376e7c50b5bac54a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=AB=20=E3=82=A6=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=83=96?= Date: Tue, 27 Nov 2018 16:41:30 -0600 Subject: [PATCH] Initial commit --- .editorconfig | 9 +++++++++ .gitignore | 8 ++++++++ .npmrc | 1 + LICENSE | 27 ++++++-------------------- README.md | 26 ++++++++++++++++++++++++- package.json | 33 +++++++++++++++++++++++++++++++ sass/init/_mixins.scss | 7 +++++++ sass/init/_variables.scss | 41 +++++++++++++++++++++++++++++++++++++++ sass/style.scss | 5 +++++ 9 files changed, 135 insertions(+), 22 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 package.json create mode 100644 sass/init/_mixins.scss create mode 100644 sass/init/_variables.scss create mode 100644 sass/style.scss diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0f17867 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fada4a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# Files +.DS_Store +.env +*.log +.sass-cache + +# Directories +node_modules diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/LICENSE b/LICENSE index 5dd5463..16902f8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,14 @@ BSD 3-Clause License -Copyright (c) 2018, LBRY +Copyright (c) LBRY Inc. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. +* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 080877f..fbac44c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,26 @@ -# components +# @lbry/components Styling for shared components across LBRY properties + + + +### Installation + +```bash +$ npm i @lbry/components sass -D SOON +``` + +We recommend using this module with [Dart Sass](https://www.npmjs.com/package/sass) for its' focus on speed and low dependency count. + +If you are using `@lbry/components`, you can safely remove [@lbry/color](https://github.com/lbryio/color) if you've already included it separately (this module includes it by default). + + + +### Usage + +TBD + + + +### License + +[BSD-3-Clause](LICENSE) Copyright (c) LBRY Inc. diff --git a/package.json b/package.json new file mode 100644 index 0000000..fb549ca --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "author": { + "email": "paul+github@lbry.io", + "name": "Paul Anthony Webb" + }, + "bugs": { + "url": "https://github.com/lbryio/components/issues" + }, + "description": "Styling for shared components across LBRY properties", + "devDependencies": { + "@inc/sasslint-config": "^1.1.1", + "@lbry/color": "^1.0.5", + "npm-run-all": "^4.1.5", + "sass": "^1.15.1", + "sass-lint": "^1.12.1", + "updates": "^5.3.0" + }, + "homepage": "https://github.com/lbryio/components#readme", + "license": "BSD-3-Clause", + "name": "@lbry/components", + "repository": { + "type": "git", + "url": "https://github.com/lbryio/components.git" + }, + "scripts": { + "sass:dev": "sass --load-path=node_modules --watch sass:dist --style compressed", + "sass:prod": "sass --load-path=node_modules --update sass:dist --style compressed", + "test": "run-s test:*", + "test:dependencies": "updates --update ./", + "test:sass": "sass-lint --config ./node_modules/@inc/sasslint-config/config.json --verbose --no-exit" + }, + "version": "1.0.1" +} diff --git a/sass/init/_mixins.scss b/sass/init/_mixins.scss new file mode 100644 index 0000000..5635b93 --- /dev/null +++ b/sass/init/_mixins.scss @@ -0,0 +1,7 @@ +// Use CSS variables without upsetting Sass-Lint +// https://github.com/sasstools/sass-lint/issues/1161#issuecomment-390537190 +@mixin root-prop($prop: null, $value: null) { + @if ($prop and $value) { + #{$prop}: $value; + } +} diff --git a/sass/init/_variables.scss b/sass/init/_variables.scss new file mode 100644 index 0000000..beb44de --- /dev/null +++ b/sass/init/_variables.scss @@ -0,0 +1,41 @@ +:root { + @include root-prop(--spacing-xxs, 0.2rem); + @include root-prop(--spacing-xs, 0.4rem); + @include root-prop(--spacing-s, 0.8rem); + @include root-prop(--spacing-m, 1.6rem); + @include root-prop(--spacing-l, 2.4rem); + @include root-prop(--spacing-xl, 3.2rem); + @include root-prop(--spacing-xxl, 6.4rem); + + // 12:5 + @include root-prop(--aspect-ratio-bluray, 41.6666666667%); + + // 11:4 + @include root-prop(--aspect-ratio-panavision, 36.3636363636%); + + // 4:3 + @include root-prop(--aspect-ratio-sd, 75%); + + // 16:9 + @include root-prop(--aspect-ratio-standard, 56.25%); + + // --spacing-xxs: 0.2rem; + // --spacing-xs: 0.4rem; + // --spacing-s: 0.8rem; + // --spacing-m: 1.6rem; + // --spacing-l: 2.4rem; + // --spacing-xl: 3.2rem; + // --spacing-xxl: 6.4rem; + + // // 12:5 + // --aspect-ratio-bluray: 41.6666666667%; + + // // 11:4 + // --aspect-ratio-panavision: 36.3636363636%; + + // // 4:3 + // --aspect-ratio-sd: 75%; + + // // 16:9 + // --aspect-ratio-standard: 56.25%; +} diff --git a/sass/style.scss b/sass/style.scss new file mode 100644 index 0000000..0c8af20 --- /dev/null +++ b/sass/style.scss @@ -0,0 +1,5 @@ +@charset "utf-8"; + +@import "@lbry/color/lbry-color"; +@import "init/mixins"; +@import "init/variables";