StartBootstrap / pro-feedback

11 stars 3 forks source link

Classes overriding #5

Closed mavelar closed 4 years ago

mavelar commented 4 years ago

I trying to use style and structure in Yii2, when I compile scss with gulp, styles.css is not the same as theone in dist folder.

For example:

.mt-n10 it use the one under @max-width not the same as styles.css in dist folder.

initplatform commented 4 years ago

Which project repository are you referring to? None of our pro products use gulp.

jhaldi commented 4 years ago

I'm also having a problem with the out of the box scss files as they relate to overlapping page headers. I've got the next container after the page header set to <div class="container-fluid mt-n10"> but when I examine the computed properties for margin-top the entry at line 8813 which reads as follows: .mt-n10, .my-n10 { margin-top: -6rem !important; } is getting overridden by entries on line 9231 which read as follows: .mt-n10, .my-n10 { margin-top: -0.25rem !important; } I'm not experienced with SCSS, but if I create a new entry in _spacing.scss as follows: n5: ( $spacer * -3, ), n9: ( $spacer * -6, ), n10: ( $spacer * -6, ), and then reference this new item in my html as follows: <div class="container-fluid mt-n9"> It works as expected. It seems as if maybe the "n10" is getting turned into "n1" somewhere and that's why I'm getting the weird behavior in my compiled css.

initplatform commented 4 years ago

Hi @mavelar

In src/styles/sb-admin-pro/variables/_spacing.scss there was a bug with the way the spacers are defined that has been fixed.

Bootstrap now includes the negative margins, so now we only need to set the 10 and 15. But also note the comma inside the parenthesis is messing things up:

Good ->

$spacers: map-merge(
    (
        10: (
            $spacer * 6
        ),
        15: (
            $spacer * 9
        )
    ),
    $spacers
);

Bad ->

$spacers: map-merge(
    (
        10: (
            $spacer * 6,
        ),
        15: (
            $spacer * 9,
        )
    ),
    $spacers
);

So with the commas removed your css should look like:

n5: ( $spacer * -3 ), n9: ( $spacer * -6 ), n10: ( $spacer * -6 ),

Please let me know if that fixes the issue.

jhaldi commented 4 years ago

Worked like a charm - thank you very much! :)

mavelar commented 4 years ago

FIXED!!! Thanks a lot @jhaldi