Missak Boyajian
Missak Boyajian

Reputation: 2245

Ionic 2 app.scss issue

I have been working on an ionic 2 app for a month. I usually test in on Android and it was working perfectly fine. I just ran on IOS, and the design is very wrong. It looks like it is not reading the app.scss file which I use for global CSS classes. Any idea what is the issue ?

This is a sample of the app.scss file

/***** Validation *****/
.error {
    background-color: $red;
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 10px 10px 10px 10px;
    color: white;
}

.error ion-icon {
    padding-right: 5px;
}

/***** Loading *****/
ion-spinner {
    position: absolute;
    left: 50%;
    top: 50%;

    .z-index {
        z-index: 2;
    }
}

/***** Menu *****/
.header-md::after, .tabs-md[tabsPlacement="top"] > .tabbar::after, .footer-md::before, .tabs-md[tabsPlacement="bottom"] > .tabbar::before {
    background-image: none;
}

ion-header {
    .navbar {
        padding: 0;
        box-shadow: 0 4px 2px -2px #aeaeae;
    }

    .navbarSection {
        padding: 8px 8px 0px 8px;
    }

    .menuSection {
        text-align: left;

        button:hover,
        button {
            color: white !important;

            div {
                margin-left: 10px;
            }
        }
    }

    .titleSection {
        text-align: center;

        ion-title h5 {
            font-size: 14px;
            color: white;
        }
    }

    .buttonsSection {
        text-align: right;

        button, button:hover {
            background-color: #ffffff !important;
            color: $black;
            font-weight: bolder;
            text-transform: none;
            font-size: 12px;
        }

        ion-icon {
            padding-left: 10px;
            padding-right: 10px;
            font-size: 16px;
        }
    }

    .categoriesSection {
        background-color: white;
        height: 42px;


        .filterSection {
            div {
                display: inline-block;
            }

            .filter-icon {
                color: $blue;
                margin-left: 15px;
                font-weight: bolder;
            }

            .filter-searchbar {
                position: relative;
                margin-left: 10px;
            }
        }
    }

Upvotes: 0

Views: 195

Answers (1)

Suraj Rao
Suraj Rao

Reputation: 29625

Some of your styles included in app.scss seem to be android specific.

eg:

.header-md::after, .tabs-md[tabsPlacement="top"] > .tabbar::after, .footer-md::before, .tabs-md[tabsPlacement="bottom"] > .tabbar::before {

classes with -md suffix are set only for android. You will have to set similar styles for -ios suffix.

.header-ios::after, .tabs-ios[tabsPlacement="top"] > .tabbar::after, .footer-ios::before, .tabs-ios[tabsPlacement="bottom"] > .tabbar::before {

Upvotes: 1

Related Questions