_mixins.scss 3.64 KB
Newer Older
1 2 3
// lms - utilities - mixins and extends
// ====================

4 5 6
// mixins - font sizing
@mixin font-size($sizeValue: 16){
  font-size: $sizeValue + px;
7
 // font-size: ($sizeValue/10) + rem;
8 9
}

10 11 12
// mixins - line height
@mixin line-height($fontSize: auto){
  line-height: ($fontSize*1.48) + px;
13
 // line-height: (($fontSize/10)*1.48) + rem;
14 15
}

16 17 18 19
// image-replacement hidden text
@mixin text-hide() {
  text-indent: 100%;
  white-space: nowrap;
20
  overflow: hidden;
21 22
}

Galen Frechette committed
23 24 25
@mixin vertically-and-horizontally-centered ( $height, $width ) {
  left: 50%;
  margin-left: -$width / 2;
Galen Frechette committed
26
  //margin-top: -$height / 2;
Galen Frechette committed
27 28
  min-height: $height;
  min-width: $width;
Galen Frechette committed
29 30
  position: absolute;
  top: 150px;
Galen Frechette committed
31
}
32 33 34 35 36 37 38

// sunsetted, but still used mixins
@mixin hide-text(){
  text-indent: -9999px;
  overflow: hidden;
  display: block;
}
39

40 41 42 43
@function em($pxval, $base: 16) {
  @return #{$pxval / $base}em;
}

44
// line-height
45 46 47 48
@function lh($amount: 1) {
  @return $body-line-height * $amount;
}

49
// ====================
50

51
// theme mixin styles
52
@mixin login_register_h1_style {}
53 54 55 56
@mixin footer_references_style {}

// ====================

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
// extends - UI - used for page/view-level wrappers (for centering/grids)
%ui-wrapper {
  @include clearfix();
  @include box-sizing(border-box);
  width: 100%;
}

// extends - UI - window
%ui-window {
  @include clearfix();
  border-radius: 3px;
  box-shadow: 0 1px 2px 1px $shadow-l1;
  margin-bottom: $baseline;
  border: 1px solid $light-gray;
  background: $white;
}

// extends - UI archetypes - well
%ui-well {
  box-shadow: inset 0 1px 2px 1px $shadow-l1;
  padding: ($baseline*0.75) $baseline;
}

80
// extends - UI - visual link
81
%ui-fake-link {
82 83 84 85
  cursor: pointer;
}

// extends - UI - functional disable
86
%ui-disabled {
87 88
  pointer-events: none;
  outline: none;
89
  cursor: default;
90 91 92
}

// extends - UI - depth levels
93 94 95 96 97 98
%ui-depth0 { z-index: 0; }
%ui-depth1 { z-index: 10; }
%ui-depth2 { z-index: 100; }
%ui-depth3 { z-index: 1000; }
%ui-depth4 { z-index: 10000; }
%ui-depth5 { z-index: 100000; }
99

100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
// extends - UI - utility - nth-type style clearing
%wipe-first-child {

  &:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
  }
}

// extends - UI - utility - nth-type style clearing
%wipe-last-child {

  &:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
  }
}

120
// extends -hidden elems - screenreaders
121
%text-sr {
122 123 124 125 126 127 128 129 130
  border: 0;
  clip: rect(1px 1px 1px 1px);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
131 132

// extends - UI - removes list styling/spacing when using uls, ols for navigation and less content-centric cases
133
%ui-no-list {
134 135 136 137 138 139 140 141 142 143 144 145
  list-style: none;
  margin: 0;
  padding: 0;
  text-indent: 0;

  li, dt, dd {
    margin: 0;
    padding: 0;
  }
}

// extends - text - image-replacement hidden text
146
%text-hide {
147 148 149 150 151 152
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
}

// extends - text - wrapping
153
%text-wrap {
154 155 156 157 158 159 160
  text-wrap: wrap;
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  word-wrap: break-word;
}

// extends - text - text overflow by ellipsis
161
%text-truncated {
162 163 164 165 166
  @include box-sizing(border-box);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205

// border control
%no-border-top {
  border-top: none;
}

%no-border-bottom {
  border-bottom: none;
}

%no-border-left {
  border-left: none;
}

%no-border-right {
  border-right: none;
}

// outline
%no-outline {
  outline: none;
}

// shame-based mixins to centrally override poor styling
%shame-link-base {
  color: $link-color;

  &:hover, &:focus {
    color: saturate($link-color, 50%);
  }
}

%shame-link-text {
  @extend %shame-link-base;

  &:hover, &:focus {
    text-decoration: underline !important;
  }
}