forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in PGW-18-header-images (pull request civicrm#145)
PGW-18: Header Images on paragraph pages and events details Approved-by: Mukesh Ram <[email protected]>
- Loading branch information
Showing
11 changed files
with
287 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// SCSS variables are information about icon's compiled state, stored under its original file name | ||
// | ||
// .icon-home { | ||
// width: $icon-home-width; | ||
// } | ||
// | ||
// The large array-like variables contain all information about a single icon | ||
// $icon-home: x y offset_x offset_y width height total_width total_height image_path; | ||
// | ||
// At the bottom of this section, we provide information about the spritesheet itself | ||
// $spritesheet: width height image $spritesheet-sprites; | ||
$caption-name: 'caption'; | ||
$caption-x: 0px; | ||
$caption-y: 0px; | ||
$caption-offset-x: 0px; | ||
$caption-offset-y: 0px; | ||
$caption-width: 32px; | ||
$caption-height: 32px; | ||
$caption-total-width: 53px; | ||
$caption-total-height: 32px; | ||
$caption-image: 'sprite.png'; | ||
$caption: (0px, 0px, 0px, 0px, 32px, 32px, 53px, 32px, 'sprite.png', 'caption', ); | ||
$fullscreen-name: 'fullscreen'; | ||
$fullscreen-x: 33px; | ||
$fullscreen-y: 0px; | ||
$fullscreen-offset-x: -33px; | ||
$fullscreen-offset-y: 0px; | ||
$fullscreen-width: 20px; | ||
$fullscreen-height: 20px; | ||
$fullscreen-total-width: 53px; | ||
$fullscreen-total-height: 32px; | ||
$fullscreen-image: 'sprite.png'; | ||
$fullscreen: (33px, 0px, -33px, 0px, 20px, 20px, 53px, 32px, 'sprite.png', 'fullscreen', ); | ||
$spritesheet-width: 53px; | ||
$spritesheet-height: 32px; | ||
$spritesheet-image: 'sprite.png'; | ||
$spritesheet-sprites: ($caption, $fullscreen, ); | ||
$spritesheet: (53px, 32px, 'sprite.png', $spritesheet-sprites, ); | ||
|
||
// The provided mixins are intended to be used with the array-like variables | ||
// | ||
// .icon-home { | ||
// @include sprite-width($icon-home); | ||
// } | ||
// | ||
// .icon-email { | ||
// @include sprite($icon-email); | ||
// } | ||
// | ||
// Example usage in HTML: | ||
// | ||
// `display: block` sprite: | ||
// <div class="icon-home"></div> | ||
// | ||
// To change `display` (e.g. `display: inline-block;`), we suggest using a common CSS class: | ||
// | ||
// // CSS | ||
// .icon { | ||
// display: inline-block; | ||
// } | ||
// | ||
// // HTML | ||
// <i class="icon icon-home"></i> | ||
@mixin sprite-width($sprite) { | ||
width: nth($sprite, 5); | ||
} | ||
|
||
@mixin sprite-height($sprite) { | ||
height: nth($sprite, 6); | ||
} | ||
|
||
@mixin sprite-position($sprite) { | ||
$sprite-offset-x: nth($sprite, 3); | ||
$sprite-offset-y: nth($sprite, 4); | ||
background-position: $sprite-offset-x $sprite-offset-y; | ||
} | ||
|
||
@mixin sprite-image($sprite) { | ||
$sprite-image: nth($sprite, 9); | ||
background-image: url(#{$sprite-image}); | ||
} | ||
|
||
@mixin sprite($sprite) { | ||
@include sprite-image($sprite); | ||
@include sprite-position($sprite); | ||
@include sprite-width($sprite); | ||
@include sprite-height($sprite); | ||
} | ||
|
||
// The `sprites` mixin generates identical output to the CSS template | ||
// but can be overridden inside of SCSS | ||
// | ||
// @include sprites($spritesheet-sprites); | ||
@mixin sprites($sprites) { | ||
@each $sprite in $sprites { | ||
$sprite-name: nth($sprite, 10); | ||
.#{$sprite-name} { | ||
@include sprite($sprite); | ||
} | ||
} | ||
} |