# CSS区域有很多代码，我可以制作主题组件吗？

**URL:** <https://meta.discourse.org/t/there-is-a-lot-of-code-in-the-css-area-can-i-make-theme-components/308594>\
**Category:** Development\
**Tags:** css\
**Created:** [2024 年5 月 19 日 10:45 UTC](https://meta.discourse.org/t/there-is-a-lot-of-code-in-the-css-area-can-i-make-theme-components/308594 "2024-05-19T10:45:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
发布日期： [2024 年5 月 19 日 11:52 UTC](https://meta.discourse.org/t/there-is-a-lot-of-code-in-the-css-area-can-i-make-theme-components/308594/2 "2024-05-19T11:52:51Z")

</div>

> [@ogulcan1787](#):
>
> CSS 会拖累网站吗？

如果“拖累”指的是性能，那是有可能的。但是，你需要加载极其庞大或复杂的 CSS。在主题组件、插件或网站自定义的上下文中，通常只是小块的 CSS；无论你怎么做，都不会有明显的影响。

在最坏的情况下，你可能会因为低效的选择器、动画的不当使用或字体加载而减慢渲染过程，但除非你的页面非常大并且你做错了什么，否则你都会没事的。你可以遵循最佳实践（互联网上有很多资源）。

另外，我认为在大多数情况下，你遇到的会是 JS 性能问题，而不是 CSS 问题。

> **[Performance fundamentals - Performance | MDN](https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/Fundamentals)**
>
> Performance means efficiency. In the context of Open Web Apps, this document explains in general what performance is, how the browser platform helps improve it, and what tools and processes you can use to test and improve it.

> **[CSS performance optimization - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Performance/CSS)**
>
> When developing a website, you need to consider how the browser is handling the CSS on your site. To mitigate any performance issues that CSS might be causing, you should optimize it. For example, you should optimize the CSS to mitigate...

> **[Web performance | MDN](https://developer.mozilla.org/en-US/docs/Web/Performance)**
>
> Web performance is the objective measurements and the perceived user experience of load time and runtime.
> Web performance is how long a site takes to load, become interactive and responsive, and how smooth the content is during user...

---

_[View the full topic](https://meta.discourse.org/t/there-is-a-lot-of-code-in-the-css-area-can-i-make-theme-components/308594)._
