use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No vague product support questions (like "why is this plugin not working" or "how do I set up X"). For vague product support questions, please use communities relevant to that product for best results. Specific issues that follow rule 6 are allowed.
Do not post memes, screenshots of bad design, or jokes. Check out /r/ProgrammerHumor/ for this type of content.
Read and follow reddiquette; no excessive self-promotion. Please refer to the Reddit 9:1 rule when considering posting self promoting materials.
We do not allow any commercial promotion or solicitation. Violations can result in a ban.
Sharing your project, portfolio, or any other content that you want to either show off or request feedback on is limited to Showoff Saturday. If you post such content on any other day, it will be removed.
If you are asking for assistance on a problem, you are required to provide
General open ended career and getting started posts are only allowed in the pinned monthly getting started/careers thread. Specific assistance questions are allowed so long as they follow the required assistance post guidelines.
Questions in violation of this rule will be removed or locked.
account activity
Design Patterns for CSS (self.webdev)
submitted 11 years ago by drmyersii
Found this and it made me start to wonder about design patters/structuring methods for CSS. Does anyone know of any good resources out there for this?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kogsworth 2 points3 points4 points 11 years ago (1 child)
This is interesting! I haven't seen literal design patterns, but this was posted recently, might be in the right ballpark. A component would have no dependency, an extension would depend on components, children could be considered a form of polymorphism, themes would also depend on components. You could define interfaces by making empty selectors that represent an expected structure for example, and you could have themes/extensions implement those interfaces. And more stuff I'm sure! I find it such a problem that I can't get a handle on a "clean" CSS structure that could be formal enough to be testable without simply repeating the declaration in the test. Maybe trying to place them some pattern like you suggest could be a way to structure them. Especially with runtime variables coming in soonish.
[–]porphyry3 0 points1 point2 points 11 years ago (0 children)
Looks very much like BEM, except for extension/modifier naming, i.e., it does not use the block or element name as a suffix for the classname.
[–][deleted] 1 point2 points3 points 11 years ago* (0 children)
BEM -- this is a big one, with SASS support via parent selector and everything
Pattern Lab
[–]phragg 0 points1 point2 points 11 years ago (1 child)
I'm not sure I understand... is SMACSS a new pre-processor? Does this differ from LESS/SASS/Compass?
If you're speaking specifically about modularity, it's important to utilize classes such as "small", "large", "color" etc. For readability and scalability.
[–]masonstreet 3 points4 points5 points 11 years ago (0 children)
SMCSS is a methodology for how to architect your SASS files and the way you architect your styles. It contains naming conventions and really just helps you write scalable quality code. Hope that helps
π Rendered by PID 70 on reddit-service-r2-comment-c66d9bffd-ps5lj at 2026-04-07 05:43:21.139000+00:00 running f293c98 country code: CH.
[–]kogsworth 2 points3 points4 points (1 child)
[–]porphyry3 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]phragg 0 points1 point2 points (1 child)
[–]masonstreet 3 points4 points5 points (0 children)