<commit_before>//
// This forms the public API for the column-policy functionality.
//
@import "compass/utilities/general/clearfix";
@import "_column-policy-private";

//
// Display the default styles for all columns if they have not been
// generated yet. Allows base styling to be applied outside of media
// queries if the first call is in a media query.
// Sets the class name and data attribute name to be used globally 
// by the mixin.
//
// @param string $classname - The name of the class to use.
// @param string $data-attribute - The name of the data attribute to use. The name does not have the data- prefix on it. That gets added by the mixin.
//
@mixin column-policy-base($classname: $column-policy-internal-class-name, $data-attribute: $column-policy-internal-attribute-name) {
    $column-policy-internal-class-name: $classname !global;
    $column-policy-internal-attribute-name: $data-attribute !global;

    @include _column-policy-common-styles;
}

//
// This mixin generates styles for the column block. It deines how each
// column should act (fixed vs. fluid). There are two main approaches 
// that can be taken when creating columns: dynamic and static. Dynamic
// refers to the ability to add new elements to the column grid on the
// fly (e.g. via javascript). Static refers to a layout whose DOM can
// not be changed on the fly by just adding a new element and the
// formatting just "updates".
//
// For the dynamic approach a class of column is only needed. For the
// static approach a data-column attribute is needed to indicate that
// the div is part of a grid column layout. The value of the data-column
// attribute indicates which column the content should show up in. The
// value can have multiple values delimited by spaces. The column
// modifiers must follow the physical ordering of the divs (the first
// div has an attribute of data-column="2-1", the second div
// data-column="2-2", etc.).
//
// Static examples:
// Example of creating a simple two column layout with a fixed width
// second column:
//
// HTML
//
//     <div class="content">
//         <div data-column="2-1">Some content here</div>
//         <div data-column="2-2">Some additional content here</div>
//         <div data-column="2-1">Some content here</div>
//         <div data-column="2-2">Some additional content here</div>
//     </div>
//
// SASS
// 
//     .content {
//         @include column-policy-options($use-data-attribute:true, $use-nth-of-type:false, $use-once:true);
//         @include column-policy(100%, 320px); // After this call the options set previously are reset back to their defaults.
//     }
//
// Example of creating a fluid 3 column layout for screen sizes of 800px
// or greater and a two column layout for screen sizes less then 800px.
//
// HTML
//
//     <div class="content">
//         <div data-column="2-1 3-1">Some content here</div>
//         <div data-column="2-2 3-2">Some content here</div>
//         <div data-column="2-1 3-3">Some content here</div>
//         <div data-column="2-2 3-1">Some content here</div>
//         <div data-column="2-1 3-2">Some content here</div>
//         <div data-column="2-2 3-3">Some content here</div>
//     </div>
//
// SASS
// 
//     @include column-policy-options($use-data-attribute:true, $use-nth-of-type:false);
//     .content {
//         @include column-policy(100%, 320px);
//
//         @media (min-width: 800px) {
//             @include column-policy(33%, 34%, 33%);
//         }
//     }
//     @include column-policy-options(); // Resets the options back to the defaults.
//
// Dynamic examples
// Example of creating a simple two column layout with a fixed width
// second column:
//
// HTML
//
//     <div class="content">
//         <div class="column">Some content here</div>
//         <div class="column">Some additional content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some additional content here</div>
//     </div>
//
// SASS
//
//     .content {
//         @include column-policy(100%, 320px);
//     }
//
// Example of creating a fluid 3 column layout for screen sizes of 800px
// or greater and a two column layout for screen sizes less then 800px.
//
// HTML
//
//     <div class="content">
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//     </div>
//
// SASS
// 
//     .content {
//         @include column-policy(100%, 320px);
//
//         @media (min-width: 800px) {
//             @include column-policy(33%, 34%, 33%);
//         }
//     }
//
// @access public
// @param number with unit $columnWidths: The width of each column in
// the layout. This can either be a percentage or a hard value like pixels.
//
@mixin column-policy($columnWidths...) {
    $totalColumns: length($columnWidths);
    $fixedWidths: 0px;

    //
    // Display the default styles for all columns if they have not been
    // generated yet.
    //
    @include _column-policy-common-styles;

    //
    // Cacluate the correct padding needed based on the total fixed
    // width columns.
    //
    @each $width in $columnWidths {
        $unit: unit($width);

        @if ($unit != "%") {
            $fixedWidths: $fixedWidths + $width;
        }
    }

    & {
        @include clearfix;
    }

    //
    // Determine the margin-right and padding-right to generate for each fluid column.
    //
    @for $columnToDisplay from 1 to $totalColumns + 1 {
        $clear: none;
        $columnWidth: nth($columnWidths, $columnToDisplay);
        $fluid-negative-space: 0;

        @if ($columnToDisplay == 1) {
            $clear: left;
        }

        @if ($columnToDisplay == $totalColumns) {
            $clear: right;
        }

        //
        // Each fluid column gets a percentage of the fixed width so that it
        // can make room on the row. So if the column is at 60% then 60% of
        // the calculated fixed with is applied to the column's margin and
        // padding.
        // The padding will push the content of the column visually while
        // the negative margin will allow for the next column block to pull
        // itself so it visually is right next to the column.
        //
        @if (unit($columnWidth) == "%") {
            $fluid-negative-space: $fixedWidths * ($columnWidth / 100%);
        }

        @include _column-policy-column($totalColumns, $columnToDisplay) {
            clear: $clear;

            //
            // Order is important here. The output of _column-policy-column-width can have a padding which can be overwritten by _column-policy-column-padding
            //
            @include _column-policy-column-width($columnWidth, $fluid-negative-space);
            @include _column-policy-column-padding($columnToDisplay - 1, $totalColumns, $fluid-negative-space);
        }
    }

    @include column-policy-options;
}

//
// Sets the global options for column policy processing or resets the
// global options to the defaults.
//
// @access public
// @param boolean $use-nth-of-type: (optional) If true then styles using
// nth-of-type will be generated to create the columns.
// @param boolean $use-data-attribute: (optional) If true then styles
// using data-column will be generated to create the columns.
// @param boolean $use-nth-child-hack: (optional) If true then styles
// using the adjcent selector (+) and first-child will be generated to
// create the columns. This is really only for browsers that are unable
// to use nth-child.
// @param number $set-nth-child-hack-depth: (optional) The max items
// that will be considered when using the nth-child-hack option. Any
// items after will not be put in a column but use the default styling
// only for all columns.
// @param boolean $use-once: (optional) If true then the custom options
// set will only be used on the next call to column-policy all calls
// afterward will use the default options as first defined by the
// library.
// @returns: Boolean true.
//
@mixin column-policy-options(
    $use-nth-of-type:          $column-policy-default-flag-nth-of-type-support,
    $use-data-attribute:       $column-policy-default-flag-data-attribute-support,
    $use-nth-child-hack:       $column-policy-default-flag-nth-child-hack-support,
    $set-nth-child-hack-depth: $column-policy-default-flag-nth-child-hack-depth,
    $set-nth-child-offset:     $column-policy-default-flag-nth-child-offset,
    $set-nth-of-type-set:      $column-policy-default-flag-nth-of-type-set,
    $column-padding:           $column-policy-default-flag-column-padding,
    $use-calc:                 $column-policy-default-flag-calc-support,
    $use-once:                 $column-policy-default-flag-use-once
) {
    @if (not $use-once) {
        @include _column-policy-set-factory-settings(
            $use-nth-of-type: $use-nth-of-type,
            $use-data-attribute: $use-data-attribute,
            $use-nth-child-hack: $use-nth-child-hack,
            $set-nth-child-hack-depth: $set-nth-child-hack-depth,
            $set-nth-child-offset: $set-nth-child-offset,
            $set-nth-of-type-set: $set-nth-of-type-set,
            $column-padding: $column-padding,
            $use-calc: $use-calc,
            $use-once: $use-once
        );
    }

    $column-policy-flag-nth-of-type-support:    $use-nth-of-type !global;
    $column-policy-flag-data-attribute-support: $use-data-attribute !global;
    $column-policy-flag-nth-child-hack-support: $use-nth-child-hack !global;
    $column-policy-flag-nth-child-hack-depth:   $set-nth-child-hack-depth !global;
    $column-policy-flag-nth-child-offset:       $set-nth-child-offset !global;
    $column-policy-flag-nth-of-type-set:        $set-nth-of-type-set !global;
    $column-policy-flag-column-padding:         $column-padding !global;
    $column-policy-flag-calc-support:           $use-calc !global;
    $column-policy-flag-use-once:               $use-once !global;
}

//
// Allows for the setting of options for one time use. See
// column-policy-options for parameter information.
//
@mixin column-policy-options-once(
    $use-nth-of-type:          $column-policy-default-flag-nth-of-type-support,
    $use-data-attribute:       $column-policy-default-flag-data-attribute-support,
    $use-nth-child-hack:       $column-policy-default-flag-nth-child-hack-support,
    $set-nth-child-hack-depth: $column-policy-default-flag-nth-child-hack-depth,
    $set-nth-child-offset:     $column-policy-default-flag-nth-child-offset,
    $set-nth-of-type-set:      $column-policy-default-flag-nth-of-type-set,
    $column-padding:           $column-policy-default-flag-column-padding,
    $use-calc:                 $column-policy-default-flag-calc-support
) {
    @include column-policy-options(
        $use-nth-of-type: $use-nth-of-type,
        $use-data-attribute: $use-data-attribute,
        $use-nth-child-hack: $use-nth-child-hack,
        $set-nth-child-hack-depth: $set-nth-child-hack-depth,
        $set-nth-child-offset: $set-nth-child-offset,
        $set-nth-of-type-set: $set-nth-of-type-set,
        $column-padding: $column-padding,
        $use-calc: $use-calc,
        $use-once: true
    );
}

//
// Set the options to their defaults.
//
@include column-policy-options;
<commit_msg>[issues-45] Removes compass' clearfix<commit_after>//
// This forms the public API for the column-policy functionality.
//
@import "_column-policy-private";

//
// Display the default styles for all columns if they have not been
// generated yet. Allows base styling to be applied outside of media
// queries if the first call is in a media query.
// Sets the class name and data attribute name to be used globally 
// by the mixin.
//
// @param string $classname - The name of the class to use.
// @param string $data-attribute - The name of the data attribute to use. The name does not have the data- prefix on it. That gets added by the mixin.
//
@mixin column-policy-base($classname: $column-policy-internal-class-name, $data-attribute: $column-policy-internal-attribute-name) {
    $column-policy-internal-class-name: $classname !global;
    $column-policy-internal-attribute-name: $data-attribute !global;

    @include _column-policy-common-styles;
}

//
// This mixin generates styles for the column block. It deines how each
// column should act (fixed vs. fluid). There are two main approaches 
// that can be taken when creating columns: dynamic and static. Dynamic
// refers to the ability to add new elements to the column grid on the
// fly (e.g. via javascript). Static refers to a layout whose DOM can
// not be changed on the fly by just adding a new element and the
// formatting just "updates".
//
// For the dynamic approach a class of column is only needed. For the
// static approach a data-column attribute is needed to indicate that
// the div is part of a grid column layout. The value of the data-column
// attribute indicates which column the content should show up in. The
// value can have multiple values delimited by spaces. The column
// modifiers must follow the physical ordering of the divs (the first
// div has an attribute of data-column="2-1", the second div
// data-column="2-2", etc.).
//
// Static examples:
// Example of creating a simple two column layout with a fixed width
// second column:
//
// HTML
//
//     <div class="content">
//         <div data-column="2-1">Some content here</div>
//         <div data-column="2-2">Some additional content here</div>
//         <div data-column="2-1">Some content here</div>
//         <div data-column="2-2">Some additional content here</div>
//     </div>
//
// SASS
// 
//     .content {
//         @include column-policy-options($use-data-attribute:true, $use-nth-of-type:false, $use-once:true);
//         @include column-policy(100%, 320px); // After this call the options set previously are reset back to their defaults.
//     }
//
// Example of creating a fluid 3 column layout for screen sizes of 800px
// or greater and a two column layout for screen sizes less then 800px.
//
// HTML
//
//     <div class="content">
//         <div data-column="2-1 3-1">Some content here</div>
//         <div data-column="2-2 3-2">Some content here</div>
//         <div data-column="2-1 3-3">Some content here</div>
//         <div data-column="2-2 3-1">Some content here</div>
//         <div data-column="2-1 3-2">Some content here</div>
//         <div data-column="2-2 3-3">Some content here</div>
//     </div>
//
// SASS
// 
//     @include column-policy-options($use-data-attribute:true, $use-nth-of-type:false);
//     .content {
//         @include column-policy(100%, 320px);
//
//         @media (min-width: 800px) {
//             @include column-policy(33%, 34%, 33%);
//         }
//     }
//     @include column-policy-options(); // Resets the options back to the defaults.
//
// Dynamic examples
// Example of creating a simple two column layout with a fixed width
// second column:
//
// HTML
//
//     <div class="content">
//         <div class="column">Some content here</div>
//         <div class="column">Some additional content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some additional content here</div>
//     </div>
//
// SASS
//
//     .content {
//         @include column-policy(100%, 320px);
//     }
//
// Example of creating a fluid 3 column layout for screen sizes of 800px
// or greater and a two column layout for screen sizes less then 800px.
//
// HTML
//
//     <div class="content">
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//         <div class="column">Some content here</div>
//     </div>
//
// SASS
// 
//     .content {
//         @include column-policy(100%, 320px);
//
//         @media (min-width: 800px) {
//             @include column-policy(33%, 34%, 33%);
//         }
//     }
//
// @access public
// @param number with unit $columnWidths: The width of each column in
// the layout. This can either be a percentage or a hard value like pixels.
//
@mixin column-policy($columnWidths...) {
    $totalColumns: length($columnWidths);
    $fixedWidths: 0px;

    //
    // Display the default styles for all columns if they have not been
    // generated yet.
    //
    @include _column-policy-common-styles;

    //
    // Cacluate the correct padding needed based on the total fixed
    // width columns.
    //
    @each $width in $columnWidths {
        $unit: unit($width);

        @if ($unit != "%") {
            $fixedWidths: $fixedWidths + $width;
        }
    }

    @if ($column-policy-flag-calc-support == false) {
        & {
            overflow: hidden;
        }
    }

    //
    // Determine the margin-right and padding-right to generate for each fluid column.
    //
    @for $columnToDisplay from 1 to $totalColumns + 1 {
        $clear: none;
        $columnWidth: nth($columnWidths, $columnToDisplay);
        $fluid-negative-space: 0;

        @if ($columnToDisplay == 1) {
            $clear: left;
        }

        @if ($columnToDisplay == $totalColumns) {
            $clear: right;
        }

        //
        // Each fluid column gets a percentage of the fixed width so that it
        // can make room on the row. So if the column is at 60% then 60% of
        // the calculated fixed with is applied to the column's margin and
        // padding.
        // The padding will push the content of the column visually while
        // the negative margin will allow for the next column block to pull
        // itself so it visually is right next to the column.
        //
        @if (unit($columnWidth) == "%") {
            $fluid-negative-space: $fixedWidths * ($columnWidth / 100%);
        }

        @include _column-policy-column($totalColumns, $columnToDisplay) {
            clear: $clear;

            //
            // Order is important here. The output of _column-policy-column-width can have a padding which can be overwritten by _column-policy-column-padding
            //
            @include _column-policy-column-width($columnWidth, $fluid-negative-space);
            @include _column-policy-column-padding($columnToDisplay - 1, $totalColumns, $fluid-negative-space);
        }
    }

    @include column-policy-options;
}

//
// Sets the global options for column policy processing or resets the
// global options to the defaults.
//
// @access public
// @param boolean $use-nth-of-type: (optional) If true then styles using
// nth-of-type will be generated to create the columns.
// @param boolean $use-data-attribute: (optional) If true then styles
// using data-column will be generated to create the columns.
// @param boolean $use-nth-child-hack: (optional) If true then styles
// using the adjcent selector (+) and first-child will be generated to
// create the columns. This is really only for browsers that are unable
// to use nth-child.
// @param number $set-nth-child-hack-depth: (optional) The max items
// that will be considered when using the nth-child-hack option. Any
// items after will not be put in a column but use the default styling
// only for all columns.
// @param boolean $use-once: (optional) If true then the custom options
// set will only be used on the next call to column-policy all calls
// afterward will use the default options as first defined by the
// library.
// @returns: Boolean true.
//
@mixin column-policy-options(
    $use-nth-of-type:          $column-policy-default-flag-nth-of-type-support,
    $use-data-attribute:       $column-policy-default-flag-data-attribute-support,
    $use-nth-child-hack:       $column-policy-default-flag-nth-child-hack-support,
    $set-nth-child-hack-depth: $column-policy-default-flag-nth-child-hack-depth,
    $set-nth-child-offset:     $column-policy-default-flag-nth-child-offset,
    $set-nth-of-type-set:      $column-policy-default-flag-nth-of-type-set,
    $column-padding:           $column-policy-default-flag-column-padding,
    $use-calc:                 $column-policy-default-flag-calc-support,
    $use-once:                 $column-policy-default-flag-use-once
) {
    @if (not $use-once) {
        @include _column-policy-set-factory-settings(
            $use-nth-of-type: $use-nth-of-type,
            $use-data-attribute: $use-data-attribute,
            $use-nth-child-hack: $use-nth-child-hack,
            $set-nth-child-hack-depth: $set-nth-child-hack-depth,
            $set-nth-child-offset: $set-nth-child-offset,
            $set-nth-of-type-set: $set-nth-of-type-set,
            $column-padding: $column-padding,
            $use-calc: $use-calc,
            $use-once: $use-once
        );
    }

    $column-policy-flag-nth-of-type-support:    $use-nth-of-type !global;
    $column-policy-flag-data-attribute-support: $use-data-attribute !global;
    $column-policy-flag-nth-child-hack-support: $use-nth-child-hack !global;
    $column-policy-flag-nth-child-hack-depth:   $set-nth-child-hack-depth !global;
    $column-policy-flag-nth-child-offset:       $set-nth-child-offset !global;
    $column-policy-flag-nth-of-type-set:        $set-nth-of-type-set !global;
    $column-policy-flag-column-padding:         $column-padding !global;
    $column-policy-flag-calc-support:           $use-calc !global;
    $column-policy-flag-use-once:               $use-once !global;
}

//
// Allows for the setting of options for one time use. See
// column-policy-options for parameter information.
//
@mixin column-policy-options-once(
    $use-nth-of-type:          $column-policy-default-flag-nth-of-type-support,
    $use-data-attribute:       $column-policy-default-flag-data-attribute-support,
    $use-nth-child-hack:       $column-policy-default-flag-nth-child-hack-support,
    $set-nth-child-hack-depth: $column-policy-default-flag-nth-child-hack-depth,
    $set-nth-child-offset:     $column-policy-default-flag-nth-child-offset,
    $set-nth-of-type-set:      $column-policy-default-flag-nth-of-type-set,
    $column-padding:           $column-policy-default-flag-column-padding,
    $use-calc:                 $column-policy-default-flag-calc-support
) {
    @include column-policy-options(
        $use-nth-of-type: $use-nth-of-type,
        $use-data-attribute: $use-data-attribute,
        $use-nth-child-hack: $use-nth-child-hack,
        $set-nth-child-hack-depth: $set-nth-child-hack-depth,
        $set-nth-child-offset: $set-nth-child-offset,
        $set-nth-of-type-set: $set-nth-of-type-set,
        $column-padding: $column-padding,
        $use-calc: $use-calc,
        $use-once: true
    );
}

//
// Set the options to their defaults.
//
@include column-policy-options;

{'fraction_non_alphanumeric': 0.13882760112481074, 'fraction_numerical': 0.009171533636166991, 'mean_word_length': 2.3657542224810717, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 99, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3676938', 'n_tokens_mistral': 7228, 'n_tokens_neox': 7011, 'n_words': 2070}