// @package     theme_essential.
// @copyright   2017 Gareth J Barnard.
// @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.

/* Moodle fixes icons begin */

// The only class we need for icons is .icon
// Standardize the size, padding and alignment for all icons in Moodle.
.icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    box-sizing: content-box;

    &.spacer {
        margin-right: 0;
    }
}

// For filler icon when editing and toggle completion.
.section .filler {
    margin-left: 0.5rem;
}

// Fix the first icon for an action menu. This rule exists to reverse the
// icon margin defined in the a:first-of-type > .icon rule.
.action-menu .dropdown a:first-of-type > .icon {
    margin-left: 0;
}

// YUI 2 Tree View icons must not have a margin left.
.ygtvcell .icon {
    margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
}

// In the navigation, tree icons should not have margins.
.block_navigation,
.block_settings {
    .tree_item .icon {
        margin-left: 0;
        margin-right: 0;
    }
    .tree_item .navicon {
        margin-right: 3px;
    }
}

// Apply in special cases where the default icons styles does not work properly. Eg file picker buttons.
.fp-navbar a > .icon {
    margin: 0.5rem;
}

/* Moodle fixes icons end */
