生产文件夹生成问题与吞噬(production folder build issue with gulp)

系统教程 行业动态 更新时间:2024-06-14 16:57:18
生产文件夹生成问题与吞噬(production folder build issue with gulp)

我试图找出为什么我在我的css中添加的动画名称样式没有从我的开发环境复制到我的生产环境。

这是我的生产环境中的代码。

@keyframes a {
    0% {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.site-main__home-links {
    animation: a 2s
} 
  
 

这是我的开发环境中的代码。

@-webkit-keyframes fadeButtons {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes fadeButtons {
	from { opacity: 0; }
	to { opacity: 1; }
}

.site-main__home-links {
	-webkit-animation: fadeButtons 2s;
	        animation: fadeButtons 2s;
} 
  
 

这里是我的package.json的列表

I'm trying to figure out why my animation-name style I added in my css is not copying over from my development environment to my production environment.

This is the code that is in my production environment.

@keyframes a {
    0% {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.site-main__home-links {
    animation: a 2s
} 
  
 

This is the code in my development environment.

@-webkit-keyframes fadeButtons {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes fadeButtons {
	from { opacity: 0; }
	to { opacity: 1; }
}

.site-main__home-links {
	-webkit-animation: fadeButtons 2s;
	        animation: fadeButtons 2s;
} 
  
 

Here's a list of my package.json

最满意答案

因为gulp-cssnano所做的一些工作就是减少可以腾出太空空间的长名字,所以“fadeButtons”变成了“a”。 这是正常的,也是缩小过程的一部分 - 它被称为“改变”名称。 你的代码在缩小之后应该可以正常工作。

您必须查看cssnano文档以查看是否可以关闭mangling名称(或某些指定的名称)。

Because some of what gulp-cssnano does is to reduce long names where it can to space space, so "fadeButtons" got changed to "a". This is normal and part of the minification process - it Is called "mangling" the names. And your code should work just fine after this minification.

You would have to look at the cssnano documentation to see If mangling names (or certain specified names) can be turned off.

更多推荐

本文发布于:2023-04-12 20:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/2713bc8aadb13ad0d107cb729e4c0e71.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:成问题   文件   production   folder   issue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!