Moving styles to the the theme component #1545
-
I was working on the tag stuff, and hit a roadblock with styles: TagInfo is under component, and TagList is under theme, and it wasn't obvious how to share between the two. Then I started wondering why the components had styles associated with them. Most of them cannot be used free-standing, and so having styles mixed in with them doesn't seem to add much value. It does, however, make it more difficult to manage look-and-feel across different aspects of the site. Having all the css files in theme/ (organized in a way that mirrors the external components that use them) would probably make builds faster, and possibly reduce page load times. Would this be something you'd consider? (I'd happily do the work) Dave |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
The reason is already in docs bro, I almost write everything needed https://vuepress-theme-hope.github.io/v2/guide/advanced/customize.html |
Beta Was this translation helpful? Give feedback.
-
See also https://vuepress-theme-hope.github.io/v2/faq.html#slow-in-a-cold-boot-with-vite |
Beta Was this translation helpful? Give feedback.
-
Right. But the downside is that there is no cohesion between components,
and it is difficult to share styles.
So one list of tags has access to hope-config, and the other doesn't.
I understand the motivation to keep components isolated, but in reality
they aren't. If they were truly independent components, then there wouldn't
be the need for two separate components that both output a list of tags.
I'm not trying to argue with you. This is your code, and you've done an
amazing job. I'm also just beginning to understand the system, so my
ignorance shows. I'm just reporting observations that I've made as I learn
it.
Dave
…On Sun, Mar 6, 2022, 10:10 PM Mr.Hope ***@***.***> wrote:
See also
https://vuepress-theme-hope.github.io/v2/faq.html#slow-in-a-cold-boot-with-vite
[image:
Screenshot_2022-03-07-12-09-20-19_40deb401b9ffe8e1df2f1cc5ba480b12.jpg]
<https://user-images.githubusercontent.com/33315834/156966440-e5bcd0f9-90fe-464f-a439-e156ab2fe4a8.jpg>
—
Reply to this email directly, view it on GitHub
<#1545 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACTGFMUQ75AKZPJ3NEVKDU6V6SBANCNFSM5QBP7IEA>
.
You are receiving this because you authored the thread.Message ID:
<vuepress-theme-hope/vuepress-theme-hope/repo-discussions/1545/comments/2305912
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Well... in order to share a plugin such as components/client/.../TagInfo.ts, you'd have to create a plugin for it: it can't be shared directlt. I've submitted a PR for the tag stuff just to get your feedback. |
Beta Was this translation helpful? Give feedback.
-
I just realize, if we remain the old color logic, we can remove the magic number with using But that will loose the ability to generate colors through hash. |
Beta Was this translation helpful? Give feedback.
-
We already move these components back to theme now. |
Beta Was this translation helpful? Give feedback.
We already move these components back to theme now.