Git Product home page Git Product logo

grund.css's Introduction

Grund – a foundation to build upon

"Grund" is "foundation" in Swedish. This is my own SCSS foundation I start out new projects from. It's built with Compass in mind, but that dependency can be easily pulled out.

Why create Grund?

Since I'm tired of setting up the same file structure for every new project. I find myself copying over the same files and snippets all over again. Having these resources in a repository is great for collaboration, learning and developing good practices.

Building modular reusable CSS is hard. Thanks to SCSS we are able to do some more fancy work, but when developing a semi-large project it's important to have structure and a way of thinking.

I've written a post on the subject some time ago which you should read: "Bringing order to CSS".

Installation

There are a couple of ways:

1. Use the gem

I've created a RubyGem for easy installations of Grund. You didn't think I'd create a reusable CSS foundation without a quick way of putting it into a new project, did you?

gem install grund
grund install

It'll pull down the files in this repo and put it in the current directory. Run grund help for brief info. The repository for the CLI client is located here: github.com/johanbrook/grund.

2. Download the ZIP package

Download the ZIP file with the files.

3. Clone the git repo

git clone git://github.com/johanbrook/grund.css.git

For development, forking, etc.

How I use the file structure

The sass-globbing gem lets you include whole trees of Scss files. Se _main.scss. Thus, all files in the directories common, partials, and views will be auto imported in _main.scss.

Install sass-globbing with

gem install sass-globbing
  • common. I usually put common stuff in .. yeah, common. It may be general, site wide things like styles for buttons, forms, headings, modal boxes, etc.
  • lib. In here, styles which potentially can be re-used in different projects should live. General helpers, mixins, font definitions, animations, etc.
  • partials. Here I put styles for different regions of the site, such as header, footer, articles, etc.
  • views contains a Scss file for each major view of the site. Could be structured in nested directories, thanks to sass-globbing.
  • viewports contains files with media queries. Must be explicitly imported in _main.scss.

Contribute

Contributions, tips and suggestions are welcomed! CSS is a living thing – new best practices develops, and while I'd like to keep the bloat down, it would be great to learn how others are doing it.

License (MIT)

Copyright © 2012 Johan Brook, http://johanbrook.com

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.

grund.css's People

Contributors

johanbrook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.