Search code examples
cssvue.jsbuildproduction

Attribute -webkit-box-orient in css not working when build in vuejs?


I use attribute -webkit-box-orient normal when local. But when i build to web by npm run build, then attribute not working and appear in devtools. How to apply this attribute?

I have tried:

.ellipsis {
    /* autoprefixer: ignore next */
    -webkit-box-orient: vertical;
    display: block;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

and

.ellipsis {
    /* autoprefixer: off */
    -webkit-box-orient: vertical;
    /* autoprefixer: on */
    display: block;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

but when build, similar situation happened?

Anyone recommend solution for me? Many thanks.


Solution

  • This was a hard one. My friend found this page https://blog.csdn.net/niesiyuan000/article/details/79301492

    /*! autoprefixer: off */
      -webkit-box-orient: vertical;
      /* autoprefixer: on */
    

    seems to do the trick, if you don't want to change the configuration.