{"id":21262387,"url":"https://github.com/johanbrook/johan-compass-kit","last_synced_at":"2025-07-11T04:30:34.085Z","repository":{"id":138667261,"uuid":"1783478","full_name":"johanbrook/Johan-Compass-Kit","owner":"johanbrook","description":"A nice file structure of Sass files to start off a new project.","archived":false,"fork":false,"pushed_at":"2012-03-12T20:13:47.000Z","size":364,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-15T12:13:31.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://playground.johanbrook.com/css/compass-boilerplate/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johanbrook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-22T10:49:32.000Z","updated_at":"2017-06-15T02:57:07.000Z","dependencies_parsed_at":"2023-03-13T10:53:24.371Z","dependency_job_id":null,"html_url":"https://github.com/johanbrook/Johan-Compass-Kit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2FJohan-Compass-Kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2FJohan-Compass-Kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2FJohan-Compass-Kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2FJohan-Compass-Kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johanbrook","download_url":"https://codeload.github.com/johanbrook/Johan-Compass-Kit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225674918,"owners_count":17506272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T04:58:18.894Z","updated_at":"2024-11-21T04:58:19.565Z","avatar_url":"https://github.com/johanbrook.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Johan's Compass Kit\n\n### Version 1.6\n\nMy sort-of personal CSS framework. Using [Sass](http://sass-lang.com) and [Compass](http://compass-style.org).\n\n[Demo](http://playground.johanbrook.com/css/compass-boilerplate/)\n\n# What is it\n\n**This is a drop-in collection of Sass files wrapped up in a nice structure to help me start off a new project in no time. **\n\nMy Compass Kit is quite stripped – it mainly consists of handy variables, mixins, and functions. I created [Dyluni](https://github.com/johanbrook/dyluni) a while ago, but this is a Compass based version, with a bit cleaner approach. Its strength is the file structure: make sure that your Sass files are in order, just like the rest of your app/site. Don't Repeat Yourself, and Convention Over Configuration, etc. A pro tip is to give the Sass files in the `views` directory the same names as your app's views (the same goes for the partials). No more 'finding that special CSS section'.\n\n# What it's not\n\nMy Compass Kit is not a large scale \"framework\" for advanced CSS layouts and magic trickery. It's a base set of files ordered in a file structured meant for reuse. It's a living thing (which means I might change stuff as I see fit, evolved from my own workflow and other best practices).\n\nA great Compass extension for CSS patterns is [Stitch](http://stitchcss.com/) – give that a try as well (the timing functions are to die for).\n\n# Why?\n\nI'm fed up with copying and pasting code. I want to create. Fast. I believe in [DRY](http://en.wikipedia.org/wiki/DRY), and having a collection of Sass files around makes perfect sense. Every file in its place. If you separate the different sections of your site in nice modules, you could reuse the code in a flexible way later on.\n\n# How?\n\nThe master file is, yeah, `master.scss`. Everything is imported into that, single file. Reference it from your HTML.\n\nCompile the project (when standing in this directory):\n\n\t$ compass compile\n\nIf you're in a parent directory, just append the dirname to the end:\n\n\t$ compass compile public\n\n... assuming 'public' is the directory where all these files live.\n\nThis outputs:\n\n\toverwrite stylesheets/ie.css \n\toverwrite stylesheets/master.css\n\nTo have Compass watch your Sass file, and compile them on-the-fly:\n\n\t$ compass watch\n\n(`Ctrl + C` to abort).\n\n## Import scheme\n\n\tmaster\n\t  - vendor/normalize\n\t  - compass/css3\n\n\t  - library/variables\n\t  - library/mixins\n\t  - library/helpers\n\n\t  - main\t\n\t\n\t\t- common\n\t\t  - common/elements\n\t\t  - common/buttons\n\t\t  - common/forms\n\t\t  - common/columns\n\t\t  - common/animations\n\n\t\t- partials/header\n\t\t- partials/footer\n\t\t- partials/post\n\n\t\t- views/home\n\t\t- views/print\n\t\n\t  - responsive\n\nCompass compiles Sass files into CSS in development mode by default, so your CSS files will be uncompressed in development. Please see below (\"Config\" section) for quickly compiling for production. You're however able to [override this via the command line](http://compass-style.org/help/tutorials/command-line/).\n\n### _main.scss\n\nThe main site file. In here you write your CSS. I recommend you to branch out your site with imports (see below).\n\n### Partials\n\nThanks to Sass' powerful `@import` command, you're able to pull in external files directly into your main files without extra HTTP requests. Therefore I've divided the header, footer, and form sections into separate files. Prepend a \"_\" (underscore) to your partials.\n\n### _common.scss\n\nI've discovered that having some common elements in separate files are pretty good. It could be buttons, article styles, or other stuff that your *might* make use of in other places later on.\n\n### _responsive.scss, _print.scss, and ie.scss\n\nExtra files. `_responsive.scss` includes some media queries (and debug helpers: [http://johanbrook.com/design/css/debugging-css-media-queries](http://johanbrook.com/design/css/debugging-css-media-queries/)).\n\n\n# Custom mixins\n\n\t@include debugmessage($message, $color: yellow)\n\nWhenever you want to debug media queries, for instance, use this mixins with a parameter `$message` and an optional parameter of `$color`. It'll be prepended to the body element (i.e. sit as a flash above your content).\n\n\t@include stretch($height: true, $width: true)\n\nStretch an element horizontally (`$width` is true) and vertically (`$height` is true).\n\n## Clearfix\n\n\t#element{\n\t\t@include clearfix;\n\t}\n\nUse `@include clearfix` in your SCSS code whenever you want to apply the clearfix hack on a parent element, or the classname `group` in the markup.\n\n# Functions\n\n\t#element{\n\t\twidth: make_fluid(300px);\t// make_fluid(measure_in_pixels, $total: $page_width)\n\t}\n\nIn responsive web design, it's handy to calculate percentage widths relative to parent elements. This is easy with Sass – you're able to do it on the fly.\n\nThe width of the element above will depend on which base `$page_width` you've set (defaults to 992px). You can provide an optional width for the function to use as a reference in the second parameter.\n\n\t#element{\n\t\twidth: get_columns(4);\n\t}\n\nSpecify an amount of columns, and the function will return a pixel width including gutters.\n\nThis saves you a ton of time, and you don't have to use classnames in markup that often. Uses the variables `$column` and `$gutter` (check in `_base.scss`).\n\nAll together now:\n\n\t#element{\n\t\twidth: make_fluid(get_columns(4), 800px);\n\t}\n\n\n# Config\n\n### Config.rb\n\nCompass' `config.rb` includes a basic setup, sets some paths, and so on. Feel free to poke around. Especially double-check the `http_path` variable, and set it to the path of this directory. I've used a sample 'compass-boilerplate' name right now. This is important to get right, since various Compass helpers (such as the insanely great [`image_url` function](http://compass-style.org/reference/compass/helpers/urls/) relies on a correct path).\n\nFor more info, please see the [Compass configuration reference](http://compass-style.org/help/tutorials/configuration-reference/).\n\n### Rakefile\n\nIncludes two simple tasks:\n\n\t$ rake compile:production\n\t\n\t# =\u003e overwrite stylesheets/ie.css \n\t# =\u003e overwrite stylesheets/master.css \n\t# =\u003e * Sass compiled for production\n\t\n\t$ rake compile:dev\n\t\n\t# =\u003e overwrite stylesheets/ie.css \n\t# =\u003e overwrite stylesheets/master.css \n\t# =\u003e * Sass compiled\n\nThe Rakefile includes a `compile:production` task for quickly generating a production ready, compressed stylesheet.\n\n\n# License\n\nFree to use under the [MIT license](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (C) 2011 by Johan Brook\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanbrook%2Fjohan-compass-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohanbrook%2Fjohan-compass-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanbrook%2Fjohan-compass-kit/lists"}