/**
 *
 * @ai-apps/angular v2.152.0 | _typography.import.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
//-------------------------------------------
// Compatibility notes (*.import.scss)
// ------------------------------------------
//
// This file is intended to be consumed and processed with dart-sass.
// It is incompatible with node-sass/libsass as it contains sass language features
// or functions that are unavailable in node-sass/libsass, such as `math.div`.
//
// The non-`.import` suffixed version of this file eg. `_filename.scss`
// is intended to be compatible with node-sass/libsass.
//
// Styles authored within this file must be duplicated to the corresponding
// compatibility file to ensure we continue to support node-sass and dart-sass
// in v10.

@use 'sass:meta';
@use 'sass:math';
@import 'vars';

/// Base font size in px
/// @access public
/// @group global-typography
/// @type Number
/// @deprecated (For v10) Superseded by `$carbon--base-font-size`
$base-font-size: 16px !default;

/// Convert px to rem
/// @access public
/// @param {Number} $px - Value of type in pixels
/// @returns {Number} In rem
/// @example rem(48px);
/// @group global-typography
/// @deprecated (For v10) Use `carbon--rem()`
@function rem($px) {
  @if unit($px) != 'px' {
    // TODO: update to @error in v11
    @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
  }

  @if meta.function-exists('div', 'math') {
    @return math.div($px, $base-font-size) * 1rem;
  } @else {
    @return ($px / $base-font-size) * 1rem;
  }
}

/// Convert px to em
/// @access public
/// @param {Number} $px - Value of type in pixels
/// @returns {Number} In em
/// @example em(48px);
/// @group global-typography
/// @deprecated (For v10) Use `carbon--em()`
@function em($px) {
  @if unit($px) != 'px' {
    // TODO: update to @error in v11
    @warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
  }

  @if meta.function-exists('div', 'math') {
    @return math.div($px, $base-font-size) * 1em;
  } @else {
    @return ($px / $base-font-size) * 1em;
  }
}

// 🔬 Experimental
// stylelint-disable-next-line no-invalid-position-at-import-rule
@import '../../globals/scss/vendor/@carbon/elements/scss/type/font-family';
// stylelint-disable-next-line no-invalid-position-at-import-rule
@import '../../globals/scss/vendor/@carbon/elements/scss/type/styles';

/// Different type styles per token
/// @access public
/// @param {String} $name - The name of the token to get the styles for
/// @param {Bool} $fluid [false] - Specify whether to include fluid styles
/// @example @include type-style('body-short-01');
/// @group global-typography
@mixin type-style($name, $fluid: false) {
  @include carbon--type-style($name, $fluid);
}
