doggystyle 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.hound.yml +5 -0
- data/.npmignore +18 -0
- data/.ruby-version +1 -0
- data/.scss-lint.yml +243 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/RELEASING.md +1 -0
- data/Rakefile +9 -0
- data/bin/doggystyle +5 -0
- data/bower.json +38 -0
- data/circle.yml +13 -0
- data/core/_imports.scss +229 -0
- data/core/animations/_jump.scss +7 -0
- data/core/animations/_shake.scss +24 -0
- data/core/animations/_wobble.scss +8 -0
- data/core/functions/_mobile-first.scss +3 -0
- data/core/functions/_opposite-direction.scss +45 -0
- data/core/functions/casts/_to-bool.scss +19 -0
- data/core/functions/casts/_to-color.scss +74 -0
- data/core/functions/casts/_to-list.scss +38 -0
- data/core/functions/casts/_to-map.scss +27 -0
- data/core/functions/casts/_to-null.scss +15 -0
- data/core/functions/casts/_to-number.scss +66 -0
- data/core/functions/casts/_to-string.scss +15 -0
- data/core/functions/colours/_colour-contrast.scss +61 -0
- data/core/functions/colours/_colour.scss +69 -0
- data/core/functions/colours/_random-colour.scss +78 -0
- data/core/functions/lists/_contains.scss +62 -0
- data/core/functions/lists/_first.scss +19 -0
- data/core/functions/lists/_insert-nth.scss +37 -0
- data/core/functions/lists/_last.scss +11 -0
- data/core/functions/lists/_merge.scss +30 -0
- data/core/functions/lists/_prepend.scss +11 -0
- data/core/functions/lists/_remove-nth.scss +53 -0
- data/core/functions/lists/_remove.scss +30 -0
- data/core/functions/lists/_replace-nth.scss +55 -0
- data/core/functions/lists/_replace.scss +36 -0
- data/core/functions/lists/_reverse.scss +31 -0
- data/core/functions/lists/_second.scss +19 -0
- data/core/functions/lists/_shift.scss +24 -0
- data/core/functions/lists/_slice.scss +52 -0
- data/core/functions/lists/_sort.scss +51 -0
- data/core/functions/maps/_map-deep-get.scss +51 -0
- data/core/functions/maps/_map-deep-set.scss +34 -0
- data/core/functions/maps/_map-depth.scss +23 -0
- data/core/functions/maps/_map-extend.scss +47 -0
- data/core/functions/maps/_map-has-keys.scss +23 -0
- data/core/functions/maps/_map-has-nested-keys.scss +24 -0
- data/core/functions/maps/_map-set.scss +4 -0
- data/core/functions/maps/_map-zip.scss +50 -0
- data/core/functions/numbers/_add-unit.scss +54 -0
- data/core/functions/numbers/_pad.scss +16 -0
- data/core/functions/numbers/_spacer.scss +16 -0
- data/core/functions/numbers/_strip.scss +29 -0
- data/core/functions/numbers/_units.scss +17 -0
- data/core/functions/svg/_dots.scss +84 -0
- data/core/functions/svg/_fake-radius.scss +131 -0
- data/core/functions/svg/_lines.scss +76 -0
- data/core/functions/svg/_svg.scss +12 -0
- data/core/functions/text/_smart-lineheight.scss +13 -0
- data/core/functions/text/_string-explode.scss +45 -0
- data/core/functions/text/_string-replace.scss +38 -0
- data/core/helpers/_custom-elements.scss +114 -0
- data/core/helpers/_eases.scss +44 -0
- data/core/helpers/_reset.scss +282 -0
- data/core/helpers/_show-breakpoints.scss +25 -0
- data/core/helpers/_strings.scss +648 -0
- data/core/helpers/_warnings.scss +3 -0
- data/core/helpers/checks/_check.scss +69 -0
- data/core/helpers/checks/_is-absolute-length.scss +25 -0
- data/core/helpers/checks/_is-angel.scss +25 -0
- data/core/helpers/checks/_is-arglist.scss +11 -0
- data/core/helpers/checks/_is-bool.scss +23 -0
- data/core/helpers/checks/_is-calc.scss +11 -0
- data/core/helpers/checks/_is-colour.scss +23 -0
- data/core/helpers/checks/_is-dark.scss +14 -0
- data/core/helpers/checks/_is-duration.scss +15 -0
- data/core/helpers/checks/_is-false.scss +13 -0
- data/core/helpers/checks/_is-first-character.scss +11 -0
- data/core/helpers/checks/_is-frequency.scss +15 -0
- data/core/helpers/checks/_is-function.scss +44 -0
- data/core/helpers/checks/_is-integer.scss +15 -0
- data/core/helpers/checks/_is-length.scss +16 -0
- data/core/helpers/checks/_is-light.scss +14 -0
- data/core/helpers/checks/_is-list.scss +11 -0
- data/core/helpers/checks/_is-map.scss +11 -0
- data/core/helpers/checks/_is-null.scss +11 -0
- data/core/helpers/checks/_is-number.scss +19 -0
- data/core/helpers/checks/_is-percentage.scss +13 -0
- data/core/helpers/checks/_is-position.scss +16 -0
- data/core/helpers/checks/_is-pseudo.scss +24 -0
- data/core/helpers/checks/_is-relative-length.scss +25 -0
- data/core/helpers/checks/_is-resolution.scss +15 -0
- data/core/helpers/checks/_is-selector.scss +3 -0
- data/core/helpers/checks/_is-string.scss +11 -0
- data/core/helpers/checks/_is-time.scss +15 -0
- data/core/helpers/checks/_is-unit.scss +16 -0
- data/core/helpers/private/_arglist-to-list.scss +36 -0
- data/core/helpers/private/_brightness.scss +13 -0
- data/core/helpers/private/_find-digits.scss +41 -0
- data/core/helpers/private/_find-integer.scss +40 -0
- data/core/helpers/private/_from-hex.scss +48 -0
- data/core/helpers/private/_from-hsl.scss +55 -0
- data/core/helpers/private/_from-rgb.scss +55 -0
- data/core/helpers/private/_get-color-value.scss +26 -0
- data/core/helpers/private/_hash-fix.scss +15 -0
- data/core/helpers/private/_hex-to-dec.scss +28 -0
- data/core/helpers/private/_length.scss +26 -0
- data/core/helpers/private/_lightness.scss +15 -0
- data/core/helpers/private/_list-items-to-strings.scss +8 -0
- data/core/helpers/private/_min-max-number.scss +12 -0
- data/core/helpers/private/_pow.scss +29 -0
- data/core/helpers/private/_string-compare.scss +38 -0
- data/core/helpers/private/_string-explode.scss +43 -0
- data/core/helpers/private/_sudo.scss +23 -0
- data/core/helpers/symbols/_arrows.scss +337 -0
- data/core/helpers/symbols/_block.scss +97 -0
- data/core/helpers/symbols/_box.scss +385 -0
- data/core/helpers/symbols/_common.scss +101 -0
- data/core/helpers/symbols/_currency.scss +82 -0
- data/core/helpers/symbols/_dingbats.scss +565 -0
- data/core/helpers/symbols/_geometric.scss +289 -0
- data/core/helpers/symbols/_letterlike.scss +235 -0
- data/core/helpers/symbols/_misc.scss +568 -0
- data/core/helpers/symbols/_operators.scss +766 -0
- data/core/helpers/symbols/_punctuation.scss +214 -0
- data/core/mixins/_align.scss +15 -0
- data/core/mixins/_animate.scss +16 -0
- data/core/mixins/_aspect-ratio.scss +86 -0
- data/core/mixins/_backface-visibility.scss +7 -0
- data/core/mixins/_background-image.scss +13 -0
- data/core/mixins/_blend.scss +10 -0
- data/core/mixins/_blendmodes.scss +24 -0
- data/core/mixins/_border-radius.scss +105 -0
- data/core/mixins/_browsers.scss +155 -0
- data/core/mixins/_bulletpoint.scss +12 -0
- data/core/mixins/_center.scss +3 -0
- data/core/mixins/_clearfix.scss +7 -0
- data/core/mixins/_columns.scss +22 -0
- data/core/mixins/_custom-property.scss +15 -0
- data/core/mixins/_devices.scss +97 -0
- data/core/mixins/_dropdown.scss +38 -0
- data/core/mixins/_fake-radius.scss +99 -0
- data/core/mixins/_filters.scss +163 -0
- data/core/mixins/_flip.scss +11 -0
- data/core/mixins/_font-face.scss +11 -0
- data/core/mixins/_fontsize.scss +126 -0
- data/core/mixins/_gallery.scss +134 -0
- data/core/mixins/_gradient.scss +72 -0
- data/core/mixins/_image-size.scss +18 -0
- data/core/mixins/_image.scss +12 -0
- data/core/mixins/_inputs.scss +18 -0
- data/core/mixins/_keyframes.scss +8 -0
- data/core/mixins/_last.scss +5 -0
- data/core/mixins/_nth-last.scss +7 -0
- data/core/mixins/_nth.scss +10 -0
- data/core/mixins/_placeholder.scss +15 -0
- data/core/mixins/_prefixer.scss +55 -0
- data/core/mixins/_selection.scss +15 -0
- data/core/mixins/_shadow.scss +7 -0
- data/core/mixins/_size.scss +13 -0
- data/core/mixins/_smart-horizontal.scss +21 -0
- data/core/mixins/_sudo-image.scss +12 -0
- data/core/mixins/_text-shadow.scss +30 -0
- data/core/mixins/_transforms.scss +264 -0
- data/core/mixins/_transition.scss +189 -0
- data/core/mixins/_triangle-classic.scss +170 -0
- data/core/mixins/_triangle.scss +250 -0
- data/core/mixins/_unwrap.scss +5 -0
- data/core/mixins/_user-select.scss +5 -0
- data/core/mixins/_vertical.scss +10 -0
- data/core/mixins/columns/_columns.scss +92 -0
- data/core/mixins/flexbox/_flex-container.scss +201 -0
- data/core/mixins/flexbox/_flex-grid.scss +235 -0
- data/core/mixins/flexbox/_flex-items.scss +140 -0
- data/core/mixins/flexbox/_flex-remove.scss +12 -0
- data/core/mixins/grid/_break-between.scss +6 -0
- data/core/mixins/grid/_grid.scss +150 -0
- data/core/mixins/svg/_svg-size.scss +4 -0
- data/core/mixins/svg/_svg.scss +9 -0
- data/core/placeholders/_clear.scss +27 -0
- data/core/placeholders/_cursor.scss +35 -0
- data/core/placeholders/_misc.scss +20 -0
- data/core/placeholders/_rendering.scss +21 -0
- data/core/placeholders/_text.scss +41 -0
- data/core/settings/_colours.scss +30 -0
- data/core/settings/_directories.scss +7 -0
- data/core/settings/_global.scss +14 -0
- data/core/settings/_grid.scss +24 -0
- data/core/settings/_padding.scss +8 -0
- data/core/settings/_spacing.scss +8 -0
- data/core/settings/_text.scss +13 -0
- data/doggystyle.gemspec +29 -0
- data/eyeglass-exports.js +7 -0
- data/features/install.feature +29 -0
- data/features/step_definitions/doggystyle_steps.rb +31 -0
- data/features/support/bourbon_support.rb +19 -0
- data/features/support/env.rb +1 -0
- data/features/update.feature +30 -0
- data/features/version.feature +5 -0
- data/index.js +7 -0
- data/lib/doggystyle.rb +7 -0
- data/lib/doggystyle/generator.rb +81 -0
- data/lib/doggystyle/version.rb +3 -0
- data/package.json +33 -0
- data/spec/doggystyle/library/border_color_spec.rb +51 -0
- data/spec/doggystyle/library/border_radius_spec.rb +25 -0
- data/spec/doggystyle/library/border_style_spec.rb +51 -0
- data/spec/doggystyle/library/border_width_spec.rb +51 -0
- data/spec/doggystyle/library/buttons_spec.rb +53 -0
- data/spec/doggystyle/library/clearfix_spec.rb +18 -0
- data/spec/doggystyle/library/contrast_switch_spec.rb +23 -0
- data/spec/doggystyle/library/ellipsis_spec.rb +20 -0
- data/spec/doggystyle/library/font_face_spec_1.rb +16 -0
- data/spec/doggystyle/library/font_face_spec_2.rb +21 -0
- data/spec/doggystyle/library/font_face_spec_3.rb +16 -0
- data/spec/doggystyle/library/font_face_spec_4.rb +17 -0
- data/spec/doggystyle/library/font_stacks_spec.rb +40 -0
- data/spec/doggystyle/library/hide_text_spec.rb +17 -0
- data/spec/doggystyle/library/hide_visually_spec.rb +35 -0
- data/spec/doggystyle/library/margin_spec.rb +51 -0
- data/spec/doggystyle/library/modular_scale_spec.rb +43 -0
- data/spec/doggystyle/library/padding_spec.rb +51 -0
- data/spec/doggystyle/library/position_spec.rb +67 -0
- data/spec/doggystyle/library/prefixer_spec.rb +34 -0
- data/spec/doggystyle/library/shade_spec.rb +31 -0
- data/spec/doggystyle/library/size_spec.rb +31 -0
- data/spec/doggystyle/library/strip_unit_spec.rb +31 -0
- data/spec/doggystyle/library/text_inputs_spec.rb +75 -0
- data/spec/doggystyle/library/tint_spec.rb +31 -0
- data/spec/doggystyle/library/triangle_spec.rb +31 -0
- data/spec/doggystyle/library/word_wrap_spec.rb +29 -0
- data/spec/doggystyle/utilities/assign_inputs_spec.rb +50 -0
- data/spec/doggystyle/utilities/collapse_directionals.rb +25 -0
- data/spec/doggystyle/utilities/directional_values_spec.rb +21 -0
- data/spec/doggystyle/utilities/font_source_declaration_spec.rb +29 -0
- data/spec/doggystyle/utilities/retrieve_bourbon_setting_spec.rb +31 -0
- data/spec/doggystyle/utilities/unpack_spec.rb +32 -0
- data/spec/doggystyle/validators/contains_spec.rb +27 -0
- data/spec/doggystyle/validators/is_length_spec.rb +49 -0
- data/spec/doggystyle/validators/is_light_spec.rb +37 -0
- data/spec/doggystyle/validators/is_number_spec.rb +43 -0
- data/spec/doggystyle/validators/is_size_spec.rb +43 -0
- data/spec/fixtures/_setup.scss +1 -0
- data/spec/fixtures/library/border-color.scss +26 -0
- data/spec/fixtures/library/border-radius.scss +17 -0
- data/spec/fixtures/library/border-style.scss +21 -0
- data/spec/fixtures/library/border-width.scss +21 -0
- data/spec/fixtures/library/buttons.scss +17 -0
- data/spec/fixtures/library/clearfix.scss +5 -0
- data/spec/fixtures/library/contrast-switch.scss +9 -0
- data/spec/fixtures/library/ellipsis.scss +5 -0
- data/spec/fixtures/library/font-face-1.scss +6 -0
- data/spec/fixtures/library/font-face-2.scss +10 -0
- data/spec/fixtures/library/font-face-3.scss +8 -0
- data/spec/fixtures/library/font-face-4.scss +7 -0
- data/spec/fixtures/library/font-stacks.scss +41 -0
- data/spec/fixtures/library/hide-text.scss +5 -0
- data/spec/fixtures/library/hide-visually.scss +9 -0
- data/spec/fixtures/library/margin.scss +21 -0
- data/spec/fixtures/library/modular-scale.scss +29 -0
- data/spec/fixtures/library/padding.scss +21 -0
- data/spec/fixtures/library/position.scss +25 -0
- data/spec/fixtures/library/prefixer.scss +13 -0
- data/spec/fixtures/library/shade.scss +17 -0
- data/spec/fixtures/library/size.scss +13 -0
- data/spec/fixtures/library/strip-unit.scss +17 -0
- data/spec/fixtures/library/text-inputs.scss +21 -0
- data/spec/fixtures/library/tint.scss +17 -0
- data/spec/fixtures/library/triangle.scss +9 -0
- data/spec/fixtures/library/word-wrap.scss +9 -0
- data/spec/fixtures/utilities/assign-inputs.scss +19 -0
- data/spec/fixtures/utilities/collapse-directionals.scss +17 -0
- data/spec/fixtures/utilities/directional-values.scss +13 -0
- data/spec/fixtures/utilities/font-source-declaration.scss +11 -0
- data/spec/fixtures/utilities/retrieve-bourbon-setting.scss +16 -0
- data/spec/fixtures/utilities/unpack.scss +17 -0
- data/spec/fixtures/validators/contains.scss +28 -0
- data/spec/fixtures/validators/is-length.scss +35 -0
- data/spec/fixtures/validators/is-light.scss +29 -0
- data/spec/fixtures/validators/is-number.scss +31 -0
- data/spec/fixtures/validators/is-size.scss +31 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/matchers/have_rule.rb +35 -0
- data/spec/support/matchers/have_ruleset.rb +20 -0
- data/spec/support/matchers/have_value.rb +17 -0
- data/spec/support/parser_support.rb +16 -0
- data/spec/support/sass_support.rb +10 -0
- metadata +527 -0
@@ -0,0 +1,155 @@
|
|
1
|
+
$browsers : ie edge firefox chrome opera;
|
2
|
+
|
3
|
+
// Usage : @include browsers(ie 9 10) { ... }
|
4
|
+
// Usage : @include browsers(ie 9, firefox) { ... }
|
5
|
+
// Usage : @include browsers(ie) { ... }
|
6
|
+
// Usage : @include browsers(edge 12, ie 11) { ... }
|
7
|
+
|
8
|
+
/// @link https://github.com/saadeghi/browser-hack-sass-mixins/blob/master/_hacks.scss
|
9
|
+
|
10
|
+
@mixin browsers($args...) {
|
11
|
+
|
12
|
+
// This checks to see if the current selector is html.
|
13
|
+
// This can not be converted into a shorthanded if statement.
|
14
|
+
$selector : null;
|
15
|
+
@if not is-selector(html) { $selector : &; }
|
16
|
+
$selector : string-replace(#{$selector}, 'html', '');
|
17
|
+
|
18
|
+
@each $settings in _arglist-to-list($args...) {
|
19
|
+
|
20
|
+
$browsers-list : ();
|
21
|
+
$versions-list : ();
|
22
|
+
$not : true;
|
23
|
+
|
24
|
+
@each $setting in $settings {
|
25
|
+
@if is-string($setting) and contains($browsers, $setting) {
|
26
|
+
$browsers-list : append($browsers-list, $setting);
|
27
|
+
}
|
28
|
+
@elseif is-bool($setting) {
|
29
|
+
$not : $setting;
|
30
|
+
}
|
31
|
+
@elseif is-number($setting) == number or is-list($setting){
|
32
|
+
@each $version in $setting {
|
33
|
+
$versions-list : append($versions-list, $version);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
@if length($browsers-list) > 1 and length($versions-list) > 0 {
|
39
|
+
@error 'You can not check the same version for 2 browsers in a single argument. Try seperating the arguments using a comma (,)';
|
40
|
+
} @else {
|
41
|
+
@if length($browsers-list) > 0 {
|
42
|
+
@if length($versions-list) > 0 {
|
43
|
+
@each $version in $versions-list {
|
44
|
+
@if $not {
|
45
|
+
@at-root html[data-browser^=#{$browsers-list}][data-browser$='#{$version}'] #{$selector} { @content }
|
46
|
+
} @else {
|
47
|
+
@at-root html:not([data-browser^=#{$browsers-list}][data-browser$='#{$version}']) #{$selector} { @content }
|
48
|
+
}
|
49
|
+
}
|
50
|
+
} @else {
|
51
|
+
@each $browser in $browsers-list {
|
52
|
+
@if $not {
|
53
|
+
@at-root html[data-browser^=#{$browser}] #{$selector} { @content }
|
54
|
+
// Fallback hacks should the Browser not be installed
|
55
|
+
@if $browser == edge {
|
56
|
+
@supports (-ms-accelerator:true) {
|
57
|
+
#{$selector} {
|
58
|
+
@content;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
@elseif $browser == ie {
|
63
|
+
@media all and (-ms-high-contrast:none){
|
64
|
+
*::-ms-backdrop, #{$selector} {
|
65
|
+
@content;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
@elseif $browser == firefox {
|
70
|
+
#{$selector ', x:-moz-any-link'}{
|
71
|
+
@content;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
@elseif $browser == chrome {
|
75
|
+
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
|
76
|
+
//@content;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
@elseif $browser == safari {
|
80
|
+
@supports (overflow:-webkit-marquee) and (justify-content:inherit){
|
81
|
+
#{$selector} {
|
82
|
+
@content;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
} @else {
|
87
|
+
@at-root html:not([data-browser^=#{$browser}]) {
|
88
|
+
#{$selector} { @content }
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
// Usage : @include ie(9 10) { ... }
|
99
|
+
// Usage : @include ie { ... }
|
100
|
+
@mixin ie($version:null) {
|
101
|
+
@include browsers(ie $version) { @content };
|
102
|
+
}
|
103
|
+
|
104
|
+
@mixin edge($version:null) {
|
105
|
+
// TODO: When the browser plugin can detect edge version numbers, remove the next line
|
106
|
+
@include warning('As of March 2016: The plugin used to detect browser versions can not currently output the Edge browser version.
|
107
|
+
This mixin will exclude all version numbers for now.')
|
108
|
+
$version : null;
|
109
|
+
@include browsers(edge $version) { @content };
|
110
|
+
}
|
111
|
+
|
112
|
+
@mixin safari($version:null) {
|
113
|
+
@include browsers(safari $version) { @content };
|
114
|
+
}
|
115
|
+
|
116
|
+
@mixin firefox($version:null) {
|
117
|
+
@include browsers(firefox $version) { @content };
|
118
|
+
}
|
119
|
+
|
120
|
+
@mixin chrome($version:null) {
|
121
|
+
@include browsers(chrome $version) { @content };
|
122
|
+
}
|
123
|
+
|
124
|
+
@mixin opera($version:null) {
|
125
|
+
@include browsers(opera $version) { @content };
|
126
|
+
}
|
127
|
+
|
128
|
+
//////
|
129
|
+
@mixin not-ie($version:null) {
|
130
|
+
@include browsers(ie $version false) { @content };
|
131
|
+
}
|
132
|
+
|
133
|
+
@mixin not-edge($version:null) {
|
134
|
+
// TODO: When the browser plugin can detect edge version numbers, remove the next line
|
135
|
+
@include warning('As of March 2016: The plugin used to detect browser versions can not currently output the Edge browser version.
|
136
|
+
This mixin will exclude all version numbers for now.')
|
137
|
+
$version : null;
|
138
|
+
@include browsers(edge $version false) { @content };
|
139
|
+
}
|
140
|
+
|
141
|
+
@mixin not-safari($version:null) {
|
142
|
+
@include browsers(safari $version false) { @content };
|
143
|
+
}
|
144
|
+
|
145
|
+
@mixin not-firefox($version:null) {
|
146
|
+
@include browsers(firefox $version false) { @content };
|
147
|
+
}
|
148
|
+
|
149
|
+
@mixin not-chrome($version:null) {
|
150
|
+
@include browsers(chrome $version false) { @content };
|
151
|
+
}
|
152
|
+
|
153
|
+
@mixin not-opera($version:null) {
|
154
|
+
@include browsers(opera $version false) { @content };
|
155
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@mixin bulletpoint($colour:$red, $size:8, $sudo:before) { position:relative;
|
2
|
+
&:#{$sudo} { content:"";
|
3
|
+
position:absolute;
|
4
|
+
display:block;
|
5
|
+
@include size($size);
|
6
|
+
@include border-radius(circle);
|
7
|
+
background-color:$colour;
|
8
|
+
left:0;
|
9
|
+
top:addUnit($size/2);
|
10
|
+
@content;
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
// Columns for text
|
2
|
+
@mixin cols($count:2, $spacing:$pad, $width:20em, $target:null) {
|
3
|
+
@include column-count($count);
|
4
|
+
@if $count == 1 {
|
5
|
+
@include column-width(auto);
|
6
|
+
@include column-gap(auto);
|
7
|
+
} @else {
|
8
|
+
@if $width != null { @include column-width($width); }
|
9
|
+
@if $spacing != null { @include column-gap($spacing); }
|
10
|
+
@if $target == null {
|
11
|
+
-webkit-column-break-inside:avoid; page-break-inside:avoid; break-inside:avoid;
|
12
|
+
} @else {
|
13
|
+
#{$target} { -webkit-column-break-inside:avoid; page-break-inside:avoid; break-inside:avoid;
|
14
|
+
@if $spacing != null { margin-bottom:$spacing; }
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
@mixin columns($arg...) {
|
21
|
+
@include cols($args...);
|
22
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
@mixin custom-property($properties, $values:null, $at-root:false) {
|
2
|
+
|
3
|
+
$map : if(type-of($properties) == map, $properties, map-zip($properties, $values));
|
4
|
+
|
5
|
+
@each $property, $value in $map {
|
6
|
+
@if $at-root {
|
7
|
+
@at-root(without:media) & {
|
8
|
+
--#{$property}:$value;
|
9
|
+
}
|
10
|
+
} @else {
|
11
|
+
--#{$property}:$value;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
$devices : mobile tablet desktop;
|
2
|
+
|
3
|
+
@mixin devices($args...) {
|
4
|
+
|
5
|
+
// This checks to see if the current selector is html.
|
6
|
+
// This can not be converted into a shorthanded if statement.
|
7
|
+
$selector : null;
|
8
|
+
@if not is-selector(html) and not is-selector(body) { $selector : &; }
|
9
|
+
|
10
|
+
$selector : str-replace(#{&}, 'body', '');
|
11
|
+
|
12
|
+
@each $settings in _arglist-to-list($args...) {
|
13
|
+
|
14
|
+
$devices-list : ();
|
15
|
+
$types-list : ();
|
16
|
+
$not : true;
|
17
|
+
$space : false;
|
18
|
+
|
19
|
+
@each $setting in $settings {
|
20
|
+
@if is-string($setting) {
|
21
|
+
@if $setting == 'space' {
|
22
|
+
$space : true;
|
23
|
+
} @elseif contains($devices, $setting) and length($devices-list) < 2 {
|
24
|
+
$devices-list : append($devices-list, $setting);
|
25
|
+
} @else {
|
26
|
+
$types-list : append($types-list, $setting);
|
27
|
+
}
|
28
|
+
} @elseif is-bool($setting) {
|
29
|
+
$not : $setting;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
@if length($devices-list) > 1 and length($types-list) > 0 {
|
34
|
+
@error 'You can not check the same version for 2 browsers in a single argument. Try seperating the arguments using a comma (,)';
|
35
|
+
} @else {
|
36
|
+
@if length($devices-list) > 0 {
|
37
|
+
@if length($types-list) > 0 {
|
38
|
+
@each $type in $types-list {
|
39
|
+
// @at-root #{if(not $no-body, body, null)}#{$devices-list}.#{$type} #{$selector} { @content; }
|
40
|
+
@if $not {
|
41
|
+
@at-root body.#{$devices-list}.#{$type} #{$selector} { @content; }
|
42
|
+
} @else {
|
43
|
+
@at-root body:not(.#{$devices-list}).#{$type} #{$selector} { @content; }
|
44
|
+
}
|
45
|
+
}
|
46
|
+
} @else {
|
47
|
+
@each $device in $devices-list {
|
48
|
+
@if $not {
|
49
|
+
@at-root body.#{$device}#{if($space, ' ', '')}#{$selector}{ @content; }
|
50
|
+
} @else {
|
51
|
+
@at-root body:not(.#{$device})#{if($space, ' ', '')}#{$selector}{ @content; }
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
// Usage : @include mobile { ... }
|
61
|
+
// Usage : @include mobile(samgsung) { ... }
|
62
|
+
|
63
|
+
@mixin mobile($type:null) {
|
64
|
+
@include devices(mobile $type) { @content };
|
65
|
+
}
|
66
|
+
|
67
|
+
@mixin tablet($type:null) {
|
68
|
+
@include devices(tablet $type) { @content };
|
69
|
+
}
|
70
|
+
|
71
|
+
@mixin desktop($type:null) {
|
72
|
+
@include devices(desktop $type) { @content };
|
73
|
+
}
|
74
|
+
|
75
|
+
@mixin not-mobile($type:null) {
|
76
|
+
@include devices(mobile $type false) { @content };
|
77
|
+
}
|
78
|
+
|
79
|
+
@mixin not-tablet($type:null) {
|
80
|
+
@include devices(tablet $type false) { @content };
|
81
|
+
}
|
82
|
+
|
83
|
+
@mixin not-desktop($type:null) {
|
84
|
+
@include devices(desktop $type false) { @content };
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
/// Add specical styling for specific classes that sit on the body of the page.
|
89
|
+
/// for example, iphone devices specifcally.
|
90
|
+
/// @todo Add checks and validation
|
91
|
+
@mixin identify($class) {
|
92
|
+
|
93
|
+
$selector : null;
|
94
|
+
@if not is-selector(html) and not is-selector(body){ $selector : &; }
|
95
|
+
|
96
|
+
@at-root body.#{$class} #{$selector} { @content }
|
97
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
@mixin dropdown($height:40, $background:$grey, $select:null, $hover:null, $colour:null, $borders:null, $arrow:null, $target:".dropdown") {
|
2
|
+
$select:if($select == null, darken($background, 10), $select);
|
3
|
+
$hover:if($hover == null, darken($select, 10), $hover);
|
4
|
+
$colour:if($colour == null, light-or-dark($background, $white, $colour), $colour);
|
5
|
+
$borders:if($borders == null, darken($select, 10), $borders);
|
6
|
+
|
7
|
+
$arrow:if($arrow == null, 10, $arrow);
|
8
|
+
#{$target} { position:relative; width:100%; height:$height + px; color:$colour; font-size:$fs; @extend .font1; z-index:2;
|
9
|
+
select { background-color:white; height:$height + px; color:light-or-dark($background, $white, $colour); padding:0 $pad0; background-color:$background; width:100%; border:none; font-size:$size; }
|
10
|
+
div[role="label"] { @include vertical("span"); padding:0 $pad0; color:light-or-dark($background, $white, black); @include ani(background-color color); @extend %unselectable, %pointer, %no-wrap; overflow:hidden; background-color:$background; text-transform: capitalize; position:absolute; top:0; left:0; z-index:1; top:0; left:0; width:100%; height:$height + px; display:flex; align-items: center; justify-content: left;
|
11
|
+
&:after { content:""; border-top:solid 3 + px light-or-dark($background, lighten($background,40), darken($background,30)); border-right:solid 3 + px light-or-dark($background, lighten($background,40), darken($background,30)); position:absolute; top:50%; margin-top:-$arrow/2 + px; right:$padding - $arrow/2 + px; @include rotate(45deg); @include size($arrow); @include ani(rotate border-color margin-top)}
|
12
|
+
&:before { content:""; background-color:$background; @include ani(background-color); position:absolute; top:0; right:0; width:$height + px; height:$height + px; }
|
13
|
+
}
|
14
|
+
ul { height:0; width:100%;overflow: auto; overflow-x:hidden; position:relative; top:$height + px; @include ani(height 0 0.5);
|
15
|
+
&::-webkit-scrollbar { width:5px; height:50%; display:none; z-index:2; }
|
16
|
+
&::-webkit-scrollbar-track { background-color:$background; }
|
17
|
+
&::-webkit-scrollbar-thumb { background-color:darken($background,30); }
|
18
|
+
&.clicked { @include ani(height); }
|
19
|
+
li { @include vertical("span"); width:100%; min-height:$height + px; height:auto; padding:0 $pad; background-color:$background; border-bottom:1 + px solid $borders; text-transform: capitalize; @include ani(background-color color); @extend %unselectable, %pointer; display:flex; align-items: center; justify-content: left;
|
20
|
+
&:hover { background-color:$hover; color:light-or-dark($hover, $white, $colour)}
|
21
|
+
&.selected { background-color:$select; color:light-or-dark($select, $white, $colour); @extend %unselectable, %pointerevents, %cursor; }
|
22
|
+
&.disabled { background-color:lighten($background,4); color:col($colour 0.5); @extend %unselectable, %pointerevents, %cursor;}
|
23
|
+
&:last-of-type { border-bottom:0;}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
// Hoverii
|
27
|
+
&.hover { z-index:999;
|
28
|
+
div[role="label"] { background-color:$select; color:light-or-dark($select, $white, $colour);
|
29
|
+
&:after { @include rotate(135); margin-top:-$arrow/2 + px; border-top-color:white; border-right-color:white; }
|
30
|
+
&:before { background-color:$select; }
|
31
|
+
}
|
32
|
+
ul { height:50vh;
|
33
|
+
&::-webkit-scrollbar { display:block; }
|
34
|
+
}
|
35
|
+
}
|
36
|
+
@content;
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
/// Create a set of border-radius svg sprites with advance settings
|
2
|
+
///
|
3
|
+
/// @author Mark Notton
|
4
|
+
///
|
5
|
+
/// @access public
|
6
|
+
|
7
|
+
@mixin fake-radius($settings...) {
|
8
|
+
|
9
|
+
$count : 0;
|
10
|
+
|
11
|
+
$corner-settings: (
|
12
|
+
top-left : (
|
13
|
+
color : null,
|
14
|
+
width : null,
|
15
|
+
height : null
|
16
|
+
),
|
17
|
+
top-right : (
|
18
|
+
color : null,
|
19
|
+
width : null,
|
20
|
+
height : null
|
21
|
+
),
|
22
|
+
bottom-left : (
|
23
|
+
color : null,
|
24
|
+
width : null,
|
25
|
+
height : null
|
26
|
+
),
|
27
|
+
bottom-right : (
|
28
|
+
color : null,
|
29
|
+
width : null,
|
30
|
+
height : null
|
31
|
+
),
|
32
|
+
);
|
33
|
+
|
34
|
+
$corners : to-list($corner-settings, keys);
|
35
|
+
|
36
|
+
@debug $corners;
|
37
|
+
|
38
|
+
@each $settings in _arglist-to-list($settings...) {
|
39
|
+
$count : $count + 1;
|
40
|
+
|
41
|
+
@each $setting in $settings {
|
42
|
+
|
43
|
+
// If the settings contains one of the corners types, only focus on that one corner for the remaining settings.
|
44
|
+
@if is-string($setting) and contains($corners, $setting) {
|
45
|
+
$corner : $setting;
|
46
|
+
|
47
|
+
@each $setting in $settings {
|
48
|
+
@if is-colour($setting) and map-deep-get($corner-settings, $corner, color) == null {
|
49
|
+
$corner-settings : map-deep-set($corner-settings, $corner, color, colour($setting, true));
|
50
|
+
}
|
51
|
+
@elseif is-number($setting) {
|
52
|
+
@if map-deep-get($corner-settings, $corner, width) == null {
|
53
|
+
$corner-settings : map-deep-set($corner-settings, $corner, width, $setting);
|
54
|
+
} @else {
|
55
|
+
$corner-settings : map-deep-set($corner-settings, $corner, height, $setting);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
// Default colour if not supplied
|
61
|
+
@if map-deep-get($corner-settings, $corner, color) == null {
|
62
|
+
$corner-settings : map-deep-set($corner-settings, $corner, color, colour(red, true));
|
63
|
+
}
|
64
|
+
|
65
|
+
// If not units were found at all, revert the width back to a default radius setting
|
66
|
+
@if map-deep-get($corner-settings, $corner, width) == null {
|
67
|
+
$corner-settings : map-deep-set($corner-settings, $corner, width, $border-radius);
|
68
|
+
}
|
69
|
+
|
70
|
+
// If a second unit was not supplied, the height would be set to null. As a fallback, set height to width
|
71
|
+
@if map-deep-get($corner-settings, $corner, height) == null {
|
72
|
+
$corner-settings : map-deep-set($corner-settings, $corner, height, map-deep-get($corner-settings, $corner, width));
|
73
|
+
}
|
74
|
+
|
75
|
+
}
|
76
|
+
@else {
|
77
|
+
|
78
|
+
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
}
|
83
|
+
@debug $corner-settings;
|
84
|
+
|
85
|
+
$svg : "<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'>";
|
86
|
+
$svg : $svg + "<rect id='top-left' x='0%' y='0%' width='20' height='20' fill='green'/>";
|
87
|
+
$svg : $svg + "<rect id='top-right' x='-100%' y='0%' width='20' height='20' fill='green' transform='scale(-1,1)'/>";
|
88
|
+
$svg : $svg + "<rect id='bottom-left' x='0%' y='-100%' width='20' height='20' fill='blue' transform='scale(1,-1)'/>";
|
89
|
+
$svg : $svg + "<rect id='bottom-right' x='-100%' y='-100%' width='20' height='20' fill='yellow' transform='scale(-1,-1)'/>";
|
90
|
+
$svg : $svg + "</svg>";
|
91
|
+
|
92
|
+
$sudo : before;
|
93
|
+
|
94
|
+
|
95
|
+
&#{_sudo($sudo)} {
|
96
|
+
@extend %sudo;
|
97
|
+
background-image:svg($svg);
|
98
|
+
}
|
99
|
+
}
|