// Vendor Prefixes

// These aim to ensure that Flarum remains compatible with most modern devices.
// The vendor presets below are to try to remain compatible with iOS 9+ and other
// major browsers (Chrome/Firefox/new Edge/Safari desktop).

// Animations
// These remain for backwards compatibility with existing styles.
.animation(@animation) {
  animation: @animation;
}
.animation-name(@name) {
  animation-name: @name;
}
.animation-duration(@duration) {
  animation-duration: @duration;
}
.animation-timing-function(@timing-function) {
  animation-timing-function: @timing-function;
}
.animation-delay(@delay) {
  animation-delay: @delay;
}
.animation-iteration-count(@iteration-count) {
  animation-iteration-count: @iteration-count;
}
.animation-direction(@direction) {
  animation-direction: @direction;
}
.animation-fill-mode(@fill-mode) {
  animation-fill-mode: @fill-mode;
}

// Backface visibility
// Prevent browsers from flickering when using CSS 3D transforms.
// Default value is `visible`, but can be changed to `hidden`
.backface-visibility(@visibility) {
  // Safari
  -webkit-backface-visibility: @visibility;
  backface-visibility: @visibility;
}

// Drop shadows
// These remain for backwards compatibility with existing styles.
.box-shadow(@shadow) {
  box-shadow: @shadow;
}

// Box sizing
// These remain for backwards compatibility with existing styles.
.box-sizing(@boxmodel) {
  box-sizing: @boxmodel;
}

// CSS3 Content Columns
.content-columns(@column-count; @column-gap: @grid-gutter-width) {
  // Safari
  -webkit-column-count: @column-count;
  column-count: @column-count;
  // Safari
  -webkit-column-gap: @column-gap;
  column-gap: @column-gap;
}

// Optional hyphenation
.hyphens(@mode: auto) {
  word-wrap: break-word;
  // Safari
  -webkit-hyphens: @mode;
  hyphens: @mode;
}

// Placeholder text
.placeholder(@color) {
  // Safari
  &::-webkit-input-placeholder,
  &::placeholder {
    color: @color;
  }
}

// Transformations
// These remain for backwards compatibility with existing styles.
.scale(@ratio) {
  transform: scale(@ratio);
}
.scale(@ratioX; @ratioY) {
  transform: scale(@ratioX, @ratioY);
}
.scaleX(@ratio) {
  transform: scaleX(@ratio);
}
.scaleY(@ratio) {
  transform: scaleY(@ratio);
}
.skew(@x; @y) {
  transform: skewX(@x) skewY(@y);
}
.translate(@x; @y) {
  transform: translate(@x, @y);
}
.translate3d(@x; @y; @z) {
  transform: translate3d(@x, @y, @z);
}
.rotate(@degrees) {
  transform: rotate(@degrees);
}
.rotateX(@degrees) {
  transform: rotateX(@degrees);
}
.rotateY(@degrees) {
  transform: rotateY(@degrees);
}
.perspective(@perspective) {
  perspective: @perspective;
}
.perspective-origin(@perspective) {
  perspective-origin: @perspective;
}
.transform-origin(@origin) {
  transform-origin: @origin;
}

// Transitions
// These remain for backwards compatibility with existing styles.
.transition(@transition) {
  transition: @transition;
}
.transition-property(@transition-property) {
  transition-property: @transition-property;
}
.transition-delay(@transition-delay) {
  transition-delay: @transition-delay;
}
.transition-duration(@transition-duration) {
  transition-duration: @transition-duration;
}
.transition-timing-function(@timing-function) {
  transition-timing-function: @timing-function;
}
.transition-transform(@transition) {
  transition: transform @transition;
}

// User select
// For selecting text on the page
.user-select(@select) {
  // Safari + MS Edge
  -webkit-user-select: @select;
  user-select: @select;
}
