Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Files
npm-debug.log
*.css.map
style.css

# Folders
bower_components/
node_modules/
.sass-cache/
45 changes: 45 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks( "grunt-contrib-jshint" );
grunt.loadNpmTasks( "grunt-html" );
grunt.loadNpmTasks( "grunt-jscs" );
grunt.loadNpmTasks( "grunt-sass" );
grunt.loadNpmTasks( "grunt-autoprefixer" );
grunt.loadNpmTasks( "grunt-contrib-watch" );

grunt.initConfig({
jshint: {
Expand All @@ -13,6 +16,47 @@ grunt.initConfig({
},
jscs: {
all: [ "*.js" ]
},
sass: {
dist: {
options: {
sourceMap: true,
outputStyle: "compressed"
},
files: [ {
expand: true,
cwd: "scss",
src: [ "*.scss" ],
dest: "",
ext: ".css"
} ]
}
},
autoprefixer: {
dist: {
options: {
map: true,
browsers: [
"> 1%",
"last 2 versions",
"safari >= 5.1",
"ios >= 6.1",
"android 2.3",
"android >= 4",
"ie >= 8"
]
},
src: "*.css"
}
},
watch: {
sass: {
files: [ "scss/**/*.scss" ],
tasks: [ "sass", "autoprefixer" ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be an alias that can be called directly (when not using watch), that could be used here as well, like "build".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could use that alias in here too?

options: {
spawn: false
}
}
}
});

Expand All @@ -34,5 +78,6 @@ grunt.registerTask( "update-authors", function() {
});

grunt.registerTask( "default", [ "jshint", "jscs" ] );
grunt.registerTask( "build", [ "sass", "autoprefixer" ] );

};
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,25 @@ Chassis is an attempt at creating open standards designed for CSS libraries, Jav
## Project Collaboration and Interoperability

If you maintain a JavaScript library that has UI components, we'd love for you to join our efforts. We'd be happy to hear your feedback and work through updates of your project(s) to support CSS Framework. If you have the time and interest to help define the standards and improve on our implementation, that's even better! Check out the [contribution guidelines](https://github.com/jquery/css-chassis/blob/master/CONTRIBUTING.md) for more information.


## Getting started

### Prerequisites

Node.js and npm should be installed. [[installer]](http://nodejs.org/download/)

### Building

Once you've cloned Chassis to your machine, run `npm install` and `grunt build` from the root Chassis directory.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grunt build - suggest you to have an npm alias for this, like in core - https://github.com/jquery/jquery/blob/master/package.json#L54 that way you would never have grunt version conflicts.


```
$ npm install
$ grunt build
```

### Other grunt commands
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grunt -h isn't enough?


* `grunt` - JS lint and style check
* `grunt build` - Compiles the Sass into CSS
* `grunt watch` - Watches Sass files for changes. Upon change, compiles the Sass.
94 changes: 48 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
{
"name": "css-chassis",
"title": "Chassis",
"description": "An attempt at creating open standards designed for CSS libraries, JavaScript UI libraries, and web developers in general",
"version": "0.0.1-pre",
"author": {
"name": "jQuery Foundation and other contributors",
"url": "https://github.com/jquery/css-chassis/blob/master/AUTHORS.txt"
},
"maintainers": [
{
"name": "Sarah Frisk",
"email": "sarah@sarahfrisk.net",
"url": "http://sarahfrisk.net"
},
{
"name": "Alexander Schmitz",
"email": "arschmitz@gmail.com",
"url": "http://arschmitz.me"
},
{
"name": "Chris Bracco",
"email": "chris@cbracco.me",
"url": "http://cbracco.me"
}

],
"repository": {
"type": "git",
"url": "git://github.com/jquery/css-chassis.git"
},
"bugs": "http://github.com/jquery/css-chassis/issues/",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jquery/css-chassis/blob/master/LICENSE.txt"
}
],
"dependencies": {},
"devDependencies": {
"commitplease": "2.0.0",
"grunt": "0.4.2",
"grunt-contrib-jshint": "0.10.0",
"grunt-git-authors": "2.0.0",
"grunt-jscs": "0.6.2"
},
"keywords": []
"name": "css-chassis",
"title": "Chassis",
"description": "An attempt at creating open standards designed for CSS libraries, JavaScript UI libraries, and web developers in general",
"version": "0.0.1-pre",
"author": {
"name": "jQuery Foundation and other contributors",
"url": "https://github.com/jquery/css-chassis/blob/master/AUTHORS.txt"
},
"maintainers": [
{
"name": "Sarah Frisk",
"email": "sarah@sarahfrisk.net",
"url": "http://sarahfrisk.net"
},
{
"name": "Alexander Schmitz",
"email": "arschmitz@gmail.com",
"url": "http://arschmitz.me"
},
{
"name": "Chris Bracco",
"email": "chris@cbracco.me",
"url": "http://cbracco.me"
}
],
"repository": {
"type": "git",
"url": "git://github.com/jquery/css-chassis.git"
},
"bugs": "http://github.com/jquery/css-chassis/issues/",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jquery/css-chassis/blob/master/LICENSE.txt"
}
],
"dependencies": {},
"devDependencies": {
"commitplease": "2.0.0",
"grunt": "0.4.2",
"grunt-autoprefixer": "^2.1.0",
"grunt-contrib-jshint": "0.10.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-git-authors": "2.0.0",
"grunt-jscs": "0.6.2",
"grunt-sass": "^0.17.0"
},
"keywords": []
}
19 changes: 19 additions & 0 deletions scss/_utilities/_clearfix.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ==========================================================================
// Clearfix
// ==========================================================================


@mixin clearfix() {
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear: both;
}
}

.clearfix {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems weird that we'd define one of these. Do we use it a whole bunch? Doesn't seem necessary in modern design patterns IMO.

Is overflow: auto not descriptive enough for the cases where we want .clearfix.

Also, is this actually going to define .clearfix as a class in the output file? Seems like we'd at least want to "namespace" that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use it a whole bunch?

I know I do and many others do.

overflow is definitely what I use when I can, but it can cause unexpected side effects (scroll bars, positioning issues, cut off child elements). They aren't the worst side effects in the world, but they're there. #

It currently does output .clearfix in the output file. This can change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding naming here, this really is dependent upon final decision on #4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave it in for name (the name), and if we decided to have different naming conventions for #4, then we can change it.

Also might as well leave the clearfix mixin there for now, since in some cases it could definitely be handy to have.

@include clearfix;
}
3 changes: 3 additions & 0 deletions scss/_utilities/_colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// ==========================================================================
// Colors
// ==========================================================================
3 changes: 3 additions & 0 deletions scss/atoms/icons/_icons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// ==========================================================================
// Icons
// ==========================================================================
12 changes: 12 additions & 0 deletions scss/atoms/typography/_functions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// ==========================================================================
// Typography functions
// ==========================================================================

// em() function
// Convert px to em in a readable fashion.
// Examples:
// 1. font-size: em(14px);
// 2. font-size: em(30px/14px);
@function em($value, $context: map-get($root-font, font-size)) {
@return ($value / $context * 1em);
}
7 changes: 7 additions & 0 deletions scss/atoms/typography/_typography.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// ==========================================================================
// Typography
// ==========================================================================

@import
"variables",
"functions";
19 changes: 19 additions & 0 deletions scss/atoms/typography/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ==========================================================================
// Typography variables
// ==========================================================================

// Change these values when using custom fonts
// For example, normal: 400;
$normal: normal;
$bold: bold;

$root-font:(
color: #222,
font-size: 20px,
line-height: 1.5
);

// Typefaces
$monospace: "courier new", monospace;
$serif: Georgia, "Times New Roman", Times, serif;
$sans: Helvetica, Arial, sans-serif;
14 changes: 14 additions & 0 deletions scss/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// ==========================================================================
// CSS Chassis
// ==========================================================================

@import
"_utilities/clearfix",
"_utilities/colors";

@import
"atoms/icons/icons",
"atoms/typography/typography";

@import
"views/main";
3 changes: 3 additions & 0 deletions scss/views/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// ==========================================================================
// Main
// ==========================================================================