Skip to content

Commit

Permalink
# This is a combination of 2 commits.
Browse files Browse the repository at this point in the history
# The first commit's message is:

Images: Added basic styles jquery-archive#148

Images: Initial Commit jquery-archive#148

# This is the 2nd commit message:

Images: Added basic styles jquery-archive#148
  • Loading branch information
thejdeep committed Mar 13, 2016
1 parent 4d3769f commit 5af84a2
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 4 deletions.
30 changes: 30 additions & 0 deletions demos/images.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Chassis - Images</title>
<meta name="description" content="Styling of Images">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../dist/css/chassis.css">
<link rel="stylesheet" href="demos.css">
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,400italic,700italic" rel="stylesheet">
</head>
<body>

<h1>CSS Chassis</h1>

<hr>
<h2>Default Image</h2>
<img class="img" src="http://placehold.it/150x150">
<hr>
<h2>Rounded Image</h2>
<img class="img-round" src="http://placehold.it/150x150">
<hr>
<h2>Circle Image</h2>
<img class="img-circle" src="http://placehold.it/150x150">
<hr>
<h2>Thumbnail Image</h2>
<img class="img-thumbnail" src="http://placehold.it/150x150">
<hr>
</body>
</html>
4 changes: 2 additions & 2 deletions scss/atoms/buttons/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}

.btn {
@include btn( map-get($ui-btn, margin));
@include btn(map-get($ui-btn, margin));
}

/* Button Colors */
Expand All @@ -65,7 +65,7 @@
}

.btn-danger {
@include btn-colors($ui-btn-danger );
@include btn-colors($ui-btn-danger);
}

/* Button Sizes */
Expand Down
35 changes: 35 additions & 0 deletions scss/atoms/images/_images.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* ==========================================================================
* Images
* ==========================================================================
*/

@import
"dist/chassis",
"mixins";

.img-round {
@include img();
border-radius: map-get($img-round, border-radius);
}
.img-circle {
@include img();
border-radius: map-get($img-circle, border-radius);
}
.img-thumbnail {
@include img();
display: inline-block;
max-width: 100%;
height: auto;
padding: map-get($img-thumbnail, padding);
line-height: map-get($img-thumbnail, line-height);
background-color: map-get($img-thumbnail, background-color);
border: map-get($img-thumbnail, border-width) map-get($img-thumbnail, border-style) map-get($img-thumbnail, border-color);
border-radius: map-get($img-thumbnail, border-radius);
}
.img-responsive {
@include img();
display: block;
max-width: 100%;
height: auto;
}
5 changes: 5 additions & 0 deletions scss/atoms/images/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@mixin img() {
border: 0;
max-width: 100%;
vertical-align: map-get($img-default, alignment);
}
3 changes: 2 additions & 1 deletion scss/lint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
@import
"atoms/icons/icons",
"atoms/typography/typography",
"atoms/buttons/buttons";
"atoms/buttons/buttons",
"atoms/images/images";

@import
"views/main";
3 changes: 2 additions & 1 deletion scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
@import
"atoms/icons/icons",
"atoms/typography/typography",
"atoms/buttons/buttons";
"atoms/buttons/buttons",
"atoms/images/images";

@import
"views/main";
48 changes: 48 additions & 0 deletions scss/variables/images.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
( function( root, factory ) {
if ( typeof define === "function" && define.amd ) {
define( [ "./chassis" ], factory );
} else if ( typeof exports === "object" ) {
module.exports = factory( require( "./chassis" ) );
} else {
root.chassis = factory( root.chassis );
}
}( this, function( chassis ) {

var lineHeight = 1.5;

chassis.images = {
"img-default": {
name: "Image - Normal",
value: {
"alignment": "middle"
}
},
"img-round": {
name: "Image - Rounded",
value: {
"border-radius": "9px"
}
},
"img-circle": {
name: "Image - Circle",
value: {
"border-radius": "50%"
}
},
"img-thumbnail": {
name: "Image - Thumbnail",
value: {
"padding": "4px",
"line-height": lineHeight,
"background-color": "#fff",
"border-width": "1px",
"border-style": "solid",
"border-color": "#f5f5f5",
"border-radius": "4px",
}
}

};

return chassis;
} ) );

0 comments on commit 5af84a2

Please sign in to comment.