GithubHelp home page GithubHelp logo

sass-basis / basis Goto Github PK

View Code? Open in Web Editor NEW
144.0 7.0 14.0 4.79 MB

A lightweight responsive Sass/CSS framework based on flexible box.

Home Page: https://sass-basis.github.io/

License: MIT License

CSS 5.38% JavaScript 8.96% SCSS 83.29% EJS 2.37%
scss sass css css-framework flexbox mixin

basis's Introduction

Basis

A lightweight responsive Sass/CSS framework based on flexible box.

Basis

Why it's awesome?

  • Basis isn't about a UI framework. Basis provides only basic frame of components. So you build a responsive web page quickly and easy to overwrite with your Sass or CSS.
  • CSS architecture of Basis is FLOCSS. So it is possible a modular approach.
  • Basis has incorporated the concept of vertical rhythm. So you can be a good-balanced design.
  • Basis has many mixins. Usufule mixins and abstract mixin of compornents.

Demo ( HTML5 Templates )

Get started

Using Basis Project (Starter Kit)

$ git clone https://github.com/sass-basis/starter-kit.git
$ cd starter-kit
$ npm install
$ npm start

Using NPM

Installs Basis

$ npm install sass-basis

Imports Basis your Sass/SCSS.

/* If you want to use Basis classes */
@import node_modules/sass-basis/src/css/basis;

/* If you want to use Basis mixins only */
@import node_modules/sass-basis/src/css/basis-core;

Imports JavaScript

import 'node_modules/sass-basis/src/js/basis.js';

Download from GitHub

Download the basis from https://github.com/sass-basis/basis/releases

Imports Basis your Sass/SCSS.

/* If you want to use Basis classes */
@import basis/src/css/basis;

/* If you want to use Basis mixins only */
@import basis/src/css/basis-core;

or Just this link.

<link rel="stylesheet" href="basis/dist/css/basis.min.css">

Loads JavaScripts

<script src="node_modules/sass-basis/dist/js/basis.min.js"></script>

Using CDN (jsDelivr)

https://cdn.jsdelivr.net/npm/sass-basis@latest/dist/

Sample for using classes

<a class="c-btn c-btn--block">Btn</a>

Sample for using abstracts

.c-btn {
  @include _c-btn();

  &--block {
    display: block;
  }
}
<a class="c-btn c-btn--block">Btn</a>

Browser support

Modern Browser only

How to contribute

Please make an issue if there is a problem and needs. Please don't make the new issue if the issue of the same content already exists. If you can coding, please give me a pull request. But, please do not send in the master branch. Pull request sent to the master branch doesn't merge.

License

MIT License

basis's People

Contributors

inc2734 avatar qtamaki avatar segayuu avatar torounit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

basis's Issues

Add heading classes

Boostrap の .h1、.h2 みたいなクラスがあったほうが良い気がする。article や section でセクション区切って見出しレベルをリセットしたときにサイズに戸惑うことがある。

a._c-btn show the text underline.

a 要素に _c-btn を付与すると、テキストに下線が表示されてします。_c-btn に text-decoration: none が必要。

Gird is Components?

https://github.com/hiloki/flocss
フレームワークとして提供するなら、コンポーネントレイヤーにした方が良いと思う。
「ProjectレイヤーがComponentレイヤーのモジュールを変更すること」のみが許可されているので。

The media object bug at small window size.

スマホサイズのときに、_c-media__figure と _c-media__body が被ってしまう場合がある。flex-glow: 1 ではなく、flex: 1 に修正すれば良さそう。

style.scss -> basis.scss

sass で import する場合もある(というかそっちの方が多いはず)から、名前はプロダクト名にしといたほうがいいはず!

hero object

http://bulma.io/ の hero オブジェクトのようにフルスクリーンサイズでメインビジュアルを表示できるようなのはほしい。

The need for modifiers of the ._c-row

_c-row--md-left とか、_c-row--md-top とか位置系のモディファイアは果たして本当に必要なのか。ブレイクポイント毎に左寄せ右寄せとか、上寄せ下寄せを切り替えることはほとんど無い気が…。これ消せばサイズも結構減らせるメリットも。

.css also should be included in the repository ?

リポジトリに .css は含まれていないので、Gulp の環境が作れない人は簡単に使うことができない。結構致命的だと思うので .css もリポジトリに含めて、リリース時だけ .css もコミットするとかしたほうが良いかも。

Separate the foundation/_base.scss

実際にサイト制作するときに、_base.scss で定義されたスタイルは邪魔になりそう。基本は normalize.css だけにして、_base.scss はテーマ CSS の1つとして分離するほうが良い気がする。

Change comments format.

不要なコメントが書き出されないようにコメントのフォーマットを見直す。

assets dir はいらない

フレームワークなので、レポジトリ直下にsrcもしくはcssとかって置くべき。

Naming convention

変数・関数・ミックスインの命名規則をなぜか -(ハイフン)つなぎにしてたけど、エディタで選択しにくいので (アンダースコア)区切りのほうが良くないか…。
Sass の場合「-」と「
」は同一視されるので後方互換性的には問題ないし…

pre overflow

There is a case in which the long contents of the pre element is overflowing. So added overflow: auto;

Ghost button hover effect

_c-btn--ghost のホバー時のスタイルがついているが、案件によってホバーのスタイルは変わるので不要。

Rename col classes.

._row__col--1-2 ではなく、._row__col--1of2 のほうがわかりやすいのではないか?

bottom margin of row

._row--margin としたときに、カラム間の左右の margin は 16px だけど、上下の margin は 8px と左右の半分になっている。ここは同じように 16px の margin となるようにするのが良いのではないか?

Refactoring variable, function, mixin layer.

サイト全体で管理するべきグローバル変数・関数と、その場だけで良いローカルな変数・関数を整理したい。ミックスインもファイル構成を整理する(できれば #48 も可能なように)

Support IE8

basis-ie9.css を読み込むと、inline-block のグリッドシステムが有効になり ._c-row のフォントサイズが 0 になるが、_c-row__col のフォントサイズ指定が rem のため IE8 以下ではフォントサイズが 0 のままとなり文字が表示されなくなる場合がある。そのため、basis-ie9.css でフォントサイズを px に直す必要あり。

The document to another repository

ドキュメントをきちんと整備(デザインとかも含め)しようとすると別リポジトリに分けておいたほうが管理しやすそう。

Opacity transition bug

opacity に transition をかけると 1px ずれることがある。@mixin bs-transition-opacity()に下記のコードを追加して対処する。

backface-visibility: hidden;

add !default.

すべての変数に !default をつける。v2までにやらないとやばい

bs-bounce-scale-#{$suffix} Invalid Name Error

初Issues失礼します。
NetBeans8.1を用いてサイト制作していたのですが、Basis v5.0.0でのcss出力時にエラーが出ておりました。

@keyframes bs-bounce-scale-110.0 {(ry)}

理由はcss出力時にbs-strip-unitによって'.'が入り込んでいて、それは識別子として使用不可な文字だからです。
@keyframeの定義
CSS識別子の定義
ブラウザ上では問題ないのですがそのためだけにエラーを手動で潰すのは少し面倒ですし、衛生的に少しよろしくありません。
ご確認と可能であれば修正、よろしくおねがいします。

The coefficient variable for margin and heading size.

サイトによって余白を大きくしたい、とかがあるのでバーティカルリズムを崩さずに余白サイズを変更できるように、余白サイズに対する係数を設定できる変数を用意する。

見出しサイズも基本は h1 〜 h6 までカバーしているが、それだと h2 や h3 が相対的に大きくなりすぎる問題があるので、記事中で h5 や h6 を使わないのであれば相対的に h2 や h3 を小さくできるようにできたほうが便利である。そこで、こちらも見出しサイズに対する係数を設定できる変数を用意する。

Semantic Versioning

後方互換性を破壊する変更( class の削除、命名の変更 )は、バージョン番号の一桁目を変更すべき。
二桁目は、機能追加。
三桁目は、機能に変更がない修正。(バグフィックスなど)

npmでアップデートしたりしたときに事故る。

Don't auto build on npm install

#26npm install したときに css を自動ビルドするようにしたけど下記のような問題点や検討点がある。

  • 他のパッケージから npm install sass-basis として Travis CI でビルドさせるとき、Basis の自動ビルドが何度かこけて、リトライの末ビルドされる。#80
  • 自動ビルドした CSS を使用する場合 node_modules/sass-basis の中にある CSS を読み込むことになるがサーバー上に node_modules をアップするのは微妙な気がする。
  • 自動ビルドさせるために色々なパッケージを dependencies にしているので無駄にサイズが大きくなる。
  • npm install で Basis を使うようなユーザーは自分でビルドできるはず。

以上の理由から、npm install 時の自動ビルドは廃止し、ビルドされた CSS がほしいユーザー向けには引き続き GitHub の release ページからビルド済みの Basis を提供する。

Error npm install

npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm

> [email protected] install /Users/xxx/Desktop/test/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /Users/xxx/Desktop/test/node_modules/node-sass/vendor/darwin-x64-46/binding.node

> [email protected] postinstall /Users/xxx/Desktop/test/node_modules/node-sass
> node scripts/build.js

"/Users/xxx/Desktop/test/node_modules/node-sass/vendor/darwin-x64-46/binding.node" exists. 
 testing binary.
Binary is fine; exiting.

> [email protected] postinstall /Users/xxx/Desktop/test/node_modules/sass-basis
> gulp build

module.js:339
    throw err;
    ^

Error: Cannot find module 'browser-sync'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/xxx/Desktop/test/node_modules/sass-basis/gulpfile.js:11:20)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
/Users/xxx/Desktop/test
└── (empty)

npm WARN enoent ENOENT: no such file or directory, open '/Users/xxx/Desktop/test/package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install" "sass-basis"
npm ERR! node v4.2.1
npm ERR! npm  v3.6.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `gulp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'gulp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sass-basis package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sass-basis
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sass-basis
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/xxx/Desktop/test/npm-debug.log
npm ERR! code 1

$bs-font-size when $bs-use-mixin-only: true

$bs-use-mixin-onlyfalse のとき(デフォルト)、$bs-font-size は 1.6rem で 16px 相当となるけど、$bs-use-mixin-onlytrue のときは foundation 層の CSS も読み込まれないため $bs-font-size が 1.6rem だと 25.6px 相当となってしまう。

GridのClassの命名が微妙かも。

_row, _col となっているが、基本的には、

_rowの直下の子要素に_colが来る

という使い方以外はしないはずなので、であれば、_row__col のようなElementとして命名すべきかと。

._c-row--margin bug

._c-row--margin の各サイズのマージンがおかしい気がする。

._row__col--flex

._row__col--flex は用途的に子の高さを全て揃えたいときに使うことがほとんどだと思うので、._row--flex にしたほうが良いのではないか。

hidden and visible classes bug

ブレイクポイントを em ベースにしたことで ._u-hidden-xx、_u-visible-xx が正しく動作しないようになっている。例えば、._u-hidden-md だと (max-width: 63em) and (min-width: 40em) だけど、lg は 64em〜となっており、63em と 64em 間の 16px の間で意図した動作が行われない。

これらのクラスおよび関連するミックスインを利用する場合は px ベースに変換するようにしたほうが良さそう。

ちなみに Foundation6 だと 63.9375em みたいになってる。こっちのが良いかな…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.