-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor drop theme arrows into a helper (for use by Select/Tooltip/S…
…hepherd etc.)
- Loading branch information
1 parent
69c1898
commit 24104c9
Showing
3 changed files
with
143 additions
and
134 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
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 |
---|---|---|
@@ -1,137 +1,10 @@ | ||
@import compass/css3 | ||
@import compass/utilities/general/clearfix | ||
@import helpers/drop-theme-arrows | ||
|
||
$themePrefix: "drop" | ||
$tetherThemePrefx: "tether" // TODO -- make $tetherThemePrefx the same as $themePrefix once Zack does the coffeescript prefixer thing | ||
$arrowSize: 16px | ||
$backgroundColor: #fff | ||
$color: inherit | ||
$useDropShadow: true | ||
|
||
.drop.drop-theme-arrows | ||
max-width: 100% | ||
max-height: 100% | ||
|
||
.drop-content | ||
+border-radius(5px) | ||
-webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .2)) | ||
position: relative | ||
font-family: inherit | ||
background: $backgroundColor | ||
color: $color | ||
padding: 1em | ||
font-size: 1.1em | ||
line-height: 1.5em | ||
|
||
&:before | ||
content: "" | ||
display: block | ||
position: absolute | ||
width: 0 | ||
height: 0 | ||
border-color: transparent | ||
border-width: $arrowSize | ||
border-style: solid | ||
|
||
// Centers and middles | ||
&.tether-element-attached-bottom.tether-element-attached-center .drop-content | ||
margin-bottom: $arrowSize | ||
|
||
&:before | ||
top: 100% | ||
left: 50% | ||
margin-left: - $arrowSize | ||
border-top-color: $backgroundColor | ||
|
||
&.tether-element-attached-top.tether-element-attached-center .drop-content | ||
margin-top: $arrowSize | ||
|
||
&:before | ||
bottom: 100% | ||
left: 50% | ||
margin-left: - $arrowSize | ||
border-bottom-color: $backgroundColor | ||
|
||
&.tether-element-attached-right.tether-element-attached-middle .drop-content | ||
margin-right: $arrowSize | ||
|
||
&:before | ||
left: 100% | ||
top: 50% | ||
margin-top: - $arrowSize | ||
border-left-color: $backgroundColor | ||
|
||
&.tether-element-attached-left.tether-element-attached-middle .drop-content | ||
margin-left: $arrowSize | ||
|
||
&:before | ||
right: 100% | ||
top: 50% | ||
margin-top: - $arrowSize | ||
border-right-color: $backgroundColor | ||
|
||
// Top and bottom corners | ||
&.tether-element-attached-top.tether-element-attached-left.tether-target-attached-bottom .drop-content | ||
margin-top: $arrowSize | ||
|
||
&:before | ||
bottom: 100% | ||
left: $arrowSize | ||
border-bottom-color: $backgroundColor | ||
|
||
&.tether-element-attached-top.tether-element-attached-right.tether-target-attached-bottom .drop-content | ||
margin-top: $arrowSize | ||
|
||
&:before | ||
bottom: 100% | ||
right: $arrowSize | ||
border-bottom-color: $backgroundColor | ||
|
||
&.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-top .drop-content | ||
margin-bottom: $arrowSize | ||
|
||
&:before | ||
top: 100% | ||
left: $arrowSize | ||
border-top-color: $backgroundColor | ||
|
||
&.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-top .drop-content | ||
margin-bottom: $arrowSize | ||
|
||
&:before | ||
top: 100% | ||
right: $arrowSize | ||
border-top-color: $backgroundColor | ||
|
||
// Side corners | ||
&.tether-element-attached-top.tether-element-attached-right.tether-target-attached-left .drop-content | ||
margin-right: $arrowSize | ||
|
||
&:before | ||
top: $arrowSize | ||
left: 100% | ||
border-left-color: $backgroundColor | ||
|
||
&.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .drop-content | ||
margin-left: $arrowSize | ||
|
||
&:before | ||
top: $arrowSize | ||
right: 100% | ||
border-right-color: $backgroundColor | ||
|
||
&.tether-element-attached-bottom.tether-element-attached-right.tether-target-attached-left .drop-content | ||
margin-right: $arrowSize | ||
|
||
&:before | ||
bottom: $arrowSize | ||
left: 100% | ||
border-left-color: $backgroundColor | ||
|
||
&.tether-element-attached-bottom.tether-element-attached-left.tether-target-attached-right .drop-content | ||
margin-left: $arrowSize | ||
|
||
&:before | ||
bottom: $arrowSize | ||
right: 100% | ||
border-right-color: $backgroundColor | ||
+drop-theme-arrows($themePrefix: $themePrefix, $tetherThemePrefx: $tetherThemePrefx, $arrowSize: $arrowSize, $backgroundColor: $backgroundColor, $color: $color, $useDropShadow: $useDropShadow) |
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,136 @@ | ||
@import compass/css3 | ||
@import compass/utilities/general/clearfix | ||
|
||
=drop-theme-arrows($themePrefix: "drop", $tetherThemePrefx: "tether", $arrowSize: 16px, $backgroundColor: #fff, $color: inherit, $useDropShadow: false) // TODO -- make $tetherThemePrefx the same as $themePrefix once Zack does the coffeescript prefixer thing | ||
.drop.#{ $themePrefix }-theme-arrows | ||
max-width: 100% | ||
max-height: 100% | ||
|
||
.#{ $themePrefix }-content | ||
+border-radius(5px) | ||
position: relative | ||
font-family: inherit | ||
background: $backgroundColor | ||
color: $color | ||
padding: 1em | ||
font-size: 1.1em | ||
line-height: 1.5em | ||
|
||
@if $useDropShadow | ||
-webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .2)) | ||
|
||
&:before | ||
content: "" | ||
display: block | ||
position: absolute | ||
width: 0 | ||
height: 0 | ||
border-color: transparent | ||
border-width: $arrowSize | ||
border-style: solid | ||
|
||
// Centers and middles | ||
&.#{ $tetherThemePrefx }-element-attached-bottom.#{ $tetherThemePrefx }-element-attached-center .#{ $themePrefix }-content | ||
margin-bottom: $arrowSize | ||
|
||
&:before | ||
top: 100% | ||
left: 50% | ||
margin-left: - $arrowSize | ||
border-top-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-top.#{ $tetherThemePrefx }-element-attached-center .#{ $themePrefix }-content | ||
margin-top: $arrowSize | ||
|
||
&:before | ||
bottom: 100% | ||
left: 50% | ||
margin-left: - $arrowSize | ||
border-bottom-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-right.#{ $tetherThemePrefx }-element-attached-middle .#{ $themePrefix }-content | ||
margin-right: $arrowSize | ||
|
||
&:before | ||
left: 100% | ||
top: 50% | ||
margin-top: - $arrowSize | ||
border-left-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-left.#{ $tetherThemePrefx }-element-attached-middle .#{ $themePrefix }-content | ||
margin-left: $arrowSize | ||
|
||
&:before | ||
right: 100% | ||
top: 50% | ||
margin-top: - $arrowSize | ||
border-right-color: $backgroundColor | ||
|
||
// Top and bottom corners | ||
&.#{ $tetherThemePrefx }-element-attached-top.#{ $tetherThemePrefx }-element-attached-left.#{ $tetherThemePrefx }-target-attached-bottom .#{ $themePrefix }-content | ||
margin-top: $arrowSize | ||
|
||
&:before | ||
bottom: 100% | ||
left: $arrowSize | ||
border-bottom-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-top.#{ $tetherThemePrefx }-element-attached-right.#{ $tetherThemePrefx }-target-attached-bottom .#{ $themePrefix }-content | ||
margin-top: $arrowSize | ||
|
||
&:before | ||
bottom: 100% | ||
right: $arrowSize | ||
border-bottom-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-bottom.#{ $tetherThemePrefx }-element-attached-left.#{ $tetherThemePrefx }-target-attached-top .#{ $themePrefix }-content | ||
margin-bottom: $arrowSize | ||
|
||
&:before | ||
top: 100% | ||
left: $arrowSize | ||
border-top-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-bottom.#{ $tetherThemePrefx }-element-attached-right.#{ $tetherThemePrefx }-target-attached-top .#{ $themePrefix }-content | ||
margin-bottom: $arrowSize | ||
|
||
&:before | ||
top: 100% | ||
right: $arrowSize | ||
border-top-color: $backgroundColor | ||
|
||
// Side corners | ||
&.#{ $tetherThemePrefx }-element-attached-top.#{ $tetherThemePrefx }-element-attached-right.#{ $tetherThemePrefx }-target-attached-left .#{ $themePrefix }-content | ||
margin-right: $arrowSize | ||
|
||
&:before | ||
top: $arrowSize | ||
left: 100% | ||
border-left-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-top.#{ $tetherThemePrefx }-element-attached-left.#{ $tetherThemePrefx }-target-attached-right .#{ $themePrefix }-content | ||
margin-left: $arrowSize | ||
|
||
&:before | ||
top: $arrowSize | ||
right: 100% | ||
border-right-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-bottom.#{ $tetherThemePrefx }-element-attached-right.#{ $tetherThemePrefx }-target-attached-left .#{ $themePrefix }-content | ||
margin-right: $arrowSize | ||
|
||
&:before | ||
bottom: $arrowSize | ||
left: 100% | ||
border-left-color: $backgroundColor | ||
|
||
&.#{ $tetherThemePrefx }-element-attached-bottom.#{ $tetherThemePrefx }-element-attached-left.#{ $tetherThemePrefx }-target-attached-right .#{ $themePrefix }-content | ||
margin-left: $arrowSize | ||
|
||
&:before | ||
bottom: $arrowSize | ||
right: 100% | ||
border-right-color: $backgroundColor |