Click here to Skip to main content
15,894,896 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Is there any risk in installing Linux on top of Windows? Pin
RichardGrimmer29-May-18 3:17
RichardGrimmer29-May-18 3:17 
GeneralRe: Is there any risk in installing Linux on top of Windows? Pin
patbob29-May-18 6:03
patbob29-May-18 6:03 
GeneralGame Pin
Nelek26-May-18 4:14
protectorNelek26-May-18 4:14 
GeneralSplitting CSS? Pin
RandyBuchholz26-May-18 3:14
RandyBuchholz26-May-18 3:14 
GeneralRe: Splitting CSS? Pin
Sander Rossel26-May-18 3:41
professionalSander Rossel26-May-18 3:41 
GeneralRe: Splitting CSS? Pin
RandyBuchholz26-May-18 5:05
RandyBuchholz26-May-18 5:05 
GeneralRe: Splitting CSS? Pin
Sander Rossel26-May-18 22:52
professionalSander Rossel26-May-18 22:52 
GeneralRe: Splitting CSS? Pin
Marc Clifton26-May-18 6:02
mvaMarc Clifton26-May-18 6:02 
RandyBuchholz wrote:
For example, a skeletons.css file that only contains layout styles and a skin.css file that only contains theming styles.


I'm fine with that, but I tend to think (and mind you, this is based on the fact that I still consider myself somewhat junior with web development) that the bigger problem is the abuse of CSS. So you lets say you have class="bigBox" for several divs. Now someone asks you to change the style in for just one of those divs. Now you have to create a separate style for just that one div. What if you don't realize that there are other divs using that style? How do you find them? Sure, by searching, which seems easy enough but I've discovered isn't, particularly if you don't have access to all the scripts -- perhaps it's a common style sheet used across multiple web apps.

The result then ends up being a mess of another kind -- lots of styles with minor variations, not to mention the potential nightmare of nested styles. And what do you name them? bigBox2? bigBoxThatJoeWanted?

So, knowing that, you create separate styles based on the function of the div. So you might have bigBoxLogin and bigBoxLogout. But then your mostly needlessly creating redundant styles for the potential future of having to change the style later on.

Alternatively, you could just code the style directly in the div. But that's frowned upon and worse, if you want to change the style for all the divs of a particular "look", you're back to the first problem -- searching for where the common styles are used.

Or, you have styles associated strictly with the unique id of the element. Still the same problem.

Personally, I believe that the idea of associating styles with an id or a class is a totally farked up kludge. It's bassackwards IMHO. Tags should be what they're supposed to be -- ways to find an unique element or a set of common elements.

Personally, I'd like to see a completely separate mapping, ok, use the class and id tag values, that would map those values to the css that styles those elements. And there should be a simple rule -- an ID overrides / extends any styling that the element's class value mapped style defines.

To me, that would be a clean separation of concern and make it really easy to change the style globally or of specific element without caring about whether the style is used elsewhere.

Maybe such a thing exists. It shouldn't be to hard to actually write something like that that applies styles to elements after the DOM is loaded but before the page is rendered.
Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

Artificial intelligence is the only remedy for natural stupidity. - CDP1802

GeneralRe: Splitting CSS? Pin
RandyBuchholz26-May-18 8:55
RandyBuchholz26-May-18 8:55 
GeneralRe: Splitting CSS? Pin
Sander Rossel26-May-18 10:13
professionalSander Rossel26-May-18 10:13 
PraiseRe: Splitting CSS? Pin
kmoorevs26-May-18 6:33
kmoorevs26-May-18 6:33 
GeneralRe: Splitting CSS? Pin
dandy7226-May-18 7:15
dandy7226-May-18 7:15 
GeneralRe: Splitting CSS? Pin
RandyBuchholz26-May-18 8:38
RandyBuchholz26-May-18 8:38 
GeneralRe: Splitting CSS? Pin
dandy7226-May-18 9:40
dandy7226-May-18 9:40 
GeneralRe: Splitting CSS? Pin
Chris Maunder26-May-18 7:47
cofounderChris Maunder26-May-18 7:47 
GeneralRe: Splitting CSS? Pin
RandyBuchholz26-May-18 8:51
RandyBuchholz26-May-18 8:51 
GeneralRe: Splitting CSS? Pin
Chris Maunder26-May-18 10:26
cofounderChris Maunder26-May-18 10:26 
GeneralRe: Splitting CSS? Pin
RandyBuchholz26-May-18 11:19
RandyBuchholz26-May-18 11:19 
GeneralRe: Splitting CSS? Pin
jgakenhe26-May-18 8:07
professionaljgakenhe26-May-18 8:07 
GeneralRe: Splitting CSS? Pin
RandyBuchholz26-May-18 8:44
RandyBuchholz26-May-18 8:44 
GeneralWhy does most C/C++ developer prefers char *c instead of char* c? Pin
.jpg26-May-18 2:20
.jpg26-May-18 2:20 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
User 1106097926-May-18 2:30
User 1106097926-May-18 2:30 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Mike Hankey26-May-18 2:57
mveMike Hankey26-May-18 2:57 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
lopatir26-May-18 3:12
lopatir26-May-18 3:12 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
User 1106097926-May-18 3:22
User 1106097926-May-18 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.