TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Knowing CSS is mastery to front end development

215 点作者 tipiirai2 个月前

27 条评论

bryanhogan2 个月前
I disagree with many of the comments here. CSS is not too complicated. It&#x27;s a good way to style HTML elements.<p>There are some popular abstractions to writing CSS such as Tailwind. Although I do see it misguiding a lot of people. When you don&#x27;t know CSS but want a webpage, use a template instead. If you want deep custom styling you will need to understand CSS. Tailwind is just a collection of predefined utility classes which you then over use, breaking a few clean code principles along the way, but you get a decent looking website without writing all the utility classes yourself, which can be helpful especially in larger team projects.<p>There are improvements to this problem such as DaisyUI.<p>But regardless, they do require some understanding of CSS. And if you do understand some CSS, getting to the next level and learning how to write scalable CSS is not much harder. The simple requirement of having global and scoped styling is a given in every modern framework.<p>This is partly what led me to create a guide on writing modern scalable HTML and CSS: <a href="https:&#x2F;&#x2F;webdev.bryanhogan.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;webdev.bryanhogan.com&#x2F;</a><p>- Tailwind (wow, the website is laggy): <a href="https:&#x2F;&#x2F;tailwindcss.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tailwindcss.com&#x2F;</a><p>- DaisyUI: <a href="https:&#x2F;&#x2F;daisyui.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;daisyui.com&#x2F;</a><p>- Some modern framework, e.g. Astro: <a href="https:&#x2F;&#x2F;astro.build&#x2F;" rel="nofollow">https:&#x2F;&#x2F;astro.build&#x2F;</a>
评论 #43229667 未加载
评论 #43230625 未加载
评论 #43233593 未加载
评论 #43232517 未加载
评论 #43233680 未加载
评论 #43230178 未加载
评论 #43230899 未加载
评论 #43236372 未加载
评论 #43230813 未加载
评论 #43233635 未加载
评论 #43230477 未加载
评论 #43234244 未加载
评论 #43239172 未加载
评论 #43234012 未加载
评论 #43231869 未加载
评论 #43242723 未加载
karaterobot2 个月前
It&#x27;s astonishing to me how many front end developers refuse to learn how to use vanilla CSS and Javascript, and the lengths they go to avoid touching them. I think of a lot of modern web tooling as a giant mech suit developers climb into to do battle with the underlying technologies of the web. There&#x27;s so many layers of abstraction between you and the medium you work in, you can go your whole career without learning how to build a website yourself.<p>The original justification was &#x27;scaling&#x27; (a word that stands behind a lot of bad behavior, actually), because you cannot just write bare CSS for a large production website, <i>obviously</i>. But then it creeps down the ladder until pretty soon your hobby website is a 20 megabyte SPA with 500 NPM packages backing it.
评论 #43232547 未加载
评论 #43233539 未加载
评论 #43306164 未加载
评论 #43230971 未加载
iammrpayments2 个月前
I’m forking Shopify’s polaris-react library for my personal use and some of the components are clearly made to people who don’t know how to use CSS.<p>For example, there’s a component called “InlineStack” which is just a javascript wrapper for a div with flex. This stuff drives me nuts.
评论 #43230739 未加载
评论 #43228953 未加载
评论 #43228946 未加载
评论 #43228257 未加载
alberth2 个月前
CSS for <i>styling</i> is straight forward (which makes sense since ‘CSS’ is cascading ‘styling’ sheets)<p>CSS for <i>layout</i> takes sometime getting use too.<p>For me, the benefit of any css framework is not in prepackaged styles - it’s in simplifying layout for desktop&#x2F;tablet&#x2F;phone.
phartenfeller2 个月前
For me TailwindCSS actually was helpful in learning CSS. You still apply the same core CSS fundamentals. If you created a complex layout in Tailwind, you can also do it in normal CSS. I look up the exact rules behind their classes frequently in their docs.<p>If you just copy classes and don&#x27;t care to understand them, it&#x27;s a different story of course.
评论 #43229155 未加载
RealCodingOtaku2 个月前
The mastery to front end development is understanding the semantics of HTML.<p>At every single company I worked for, I had to teach people to stop using div tag for everything. You can style things however you want, or even create components that the browser does not allow you to style (as long as you have fallbacks).
评论 #43246393 未加载
评论 #43306221 未加载
评论 #43231850 未加载
评论 #43231097 未加载
评论 #43230782 未加载
ulrischa2 个月前
&quot;Knowing&quot; CSS in these days is nearly impossible. There are so many language features. Don&#x27;t get me wrong: CSS today is cool and nearly anything is possible (can Doom run wirh CSS by the way?), but I work as frontend dev for years and I have not the feeling I really know CSS in depth
评论 #43229470 未加载
评论 #43228972 未加载
评论 #43229425 未加载
评论 #43229039 未加载
评论 #43228704 未加载
评论 #43229724 未加载
评论 #43228659 未加载
评论 #43237062 未加载
评论 #43228418 未加载
bpev2 个月前
Frankly, I feel like it goes even further than CSS. People don&#x27;t really talk about HTML that much, probably just because it doesn&#x27;t change as much as JS frameworks, etc. But that doesn&#x27;t mean you should ignore it completely and just use a bunch of divs!<p>When you start digging into all the different HTML elements and aria guidelines (for example, the differences between `&lt;nav &#x2F;&gt;` and `&lt;menu role=&quot;menubar&quot; &#x2F;&gt;`), I think development starts to be a bit more clear, because you start to see how your tools are intended to be used. I think it also makes decisions around CSS styling more clear. And as a bonus, your code just starts becoming more accessible, which is nice.<p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Accessibility&#x2F;ARIA&#x2F;ARIA_Techniques" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Accessibility&#x2F;A...</a>
ripped_britches2 个月前
This is why I fully moved to flutter. Everything, including styling, is just a widget. It’s surprisingly liberating to write boring C# looking code that accurately describes a UI component without inheritance, overrides, style compiling, etc
评论 #43230388 未加载
评论 #43229041 未加载
评论 #43230654 未加载
评论 #43228934 未加载
评论 #43229207 未加载
noelwelsh2 个月前
Between Tailwind and LLM generation I doubt I&#x27;ll ever write more than a handful of CSS lines by hand in any future project I work on. CSS has, for me, become like the ASM output of the compilers I use. The result is good enough 99.999% of the time for me and I want to work at a higher level of abstraction.
评论 #43229861 未加载
评论 #43228836 未加载
rossant2 个月前
Wow, so much hate against CSS here. I like CSS. I first learnt CSS in 1999 or something. Granted, it has grown much more complex (and powerful) since then, it has a lot of quirks, but it&#x27;s not that bad.<p>Lately, I&#x27;ve built simple websites and small web apps in vanilla Javascript and CSS, without using any framework, and it&#x27;s much more enjoyable than years ago.
评论 #43259476 未加载
rekabis2 个月前
I agree wholeheartedly. And IMO, CSS isn’t even difficult, it just requires you to properly and effectively visualize the cascade to handle downstream effects.<p>My problem is when people start using cognitive crutches such as LESS and SASS, which bloat the CSS immensely with insanely redundant styling. I once took a generated CSS file from a “professional” and cut it down from over 500kb to less than 180Kb with zero loss of functionality or presentation. One HTML widget had separate - and absolutely identical - CSS for each and every single one of the 25+ pages it was present on. That was 250+ lines of CSS, instantly evaporated by consolidating down to one common class and two special cases that had extra stuff. Which is insane.
radicalriddler2 个月前
At this point, if you know how the box model works and the difference between margin and padding, you&#x27;re ahead of 50% of &quot;frontend developers&quot;.
Gualdrapo2 个月前
I agree. But I feel like nowadays knowing CSS is <i>not</i> necessary to land a job in FED - while knowing frameworks as React&#x2F;Next&#x2F;Vue&#x2F;whatever is.
评论 #43229209 未加载
评论 #43231108 未加载
评论 #43230520 未加载
brigandish2 个月前
The comments here remind of the &quot;Git isn&#x27;t hard to understand&quot; humblebrags that we hear again and again on this forum, surrounded by a sea of honest and justified criticism.<p>If lots of people complain about understanding your product - intelligent people - then your product is hard to understand. <i>Why</i> is the important question.
评论 #43230882 未加载
评论 #43231941 未加载
moi23882 个月前
CSS is not the performance bottleneck.<p>CSS is also not difficult. Tailwind is absolute nonsense imo.<p>Either write some good simple plain css, use a framework with scoped css which already completely eliminates the need for tailwind, or use JavaScript css properties (with a slight performance penalty).<p>The performance issues are because of use of heavy frameworks, unoptimised images and 1000 ads and trackers which nobody asked for (except management of course).
ninetyninenine2 个月前
Css is a garbage api. Styling things should not be this hard. We are stuck with it because of tech debt. That’s most of web technology today.
sublinear2 个月前
&gt; To me, the main reason is different: You won’t be a master at frontend development if you don’t understand underlying mechanisms of a language.<p>True for any paradigm, not just frontend.
评论 #43228246 未加载
评论 #43229275 未加载
spoonfeeder0062 个月前
&gt; Custom icons for an input field? Welp, it’s not that easy for privacy reasons to add a pseudo-class here in certain cases.<p>What exactly are those privacy reasons? And by custom icon for input field is meant replacing the cursor with e.g. an svg?
评论 #43234024 未加载
mrcwinn2 个月前
For better or worse, I’ve been using Tailwind since it was released. I’m not even sure I remember intermediate to complex CSS. Better places to spend time. I’m really grateful for what that team has done.
Waterluvian2 个月前
CSS is one of those things you can become very effective with, without knowing it all. I really don’t think you need to know it all.<p>I also think it has a lot of tools you don’t always need. Don’t go crazy with selectors!
efortis2 个月前
Why CSS Modules are so unpopular?
评论 #43234171 未加载
arcosdev2 个月前
CSS is still a masochistic mess that should be replaced
评论 #43232453 未加载
joeevans10002 个月前
htmx
sunami-ai2 个月前
CSS: The AI&#x27;s Achilles Heel
评论 #43228768 未加载
评论 #43228388 未加载
评论 #43228585 未加载
评论 #43228595 未加载
sirolimus2 个月前
AI has maketh CSS obsolote
评论 #43229158 未加载
andrewstuart2 个月前
Master Css then get the AI to do it.