Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Should I have one base style sheet for the whole site and one for each individual page for customizations?</p> </blockquote> <p>Be pragmatic. If you have few enough rules that you can organise them all in one file and retain an oversight of what does what, do that. If you have a significant number of rules that only apply to certain sections or individual pages in your site, by all means break them out into their own sub-stylesheets, but don't feel the need to create a separate stylesheet for every single page even when it only contains two rules. Add a page-specific class or id to &lt;body> so you can pick out single pages from a shared stylesheet should you need to.</p> <p>The separation of styles into stylesheets is for your benefit as an author, so do what you find easiest to manage. For a complicated site that'll probably be more than one CSS file, but it's not going to be dozens.</p> <blockquote> <p>Should I have another for print styles?</p> </blockquote> <p>Generally yes. Whilst you can embed print styles inside another stylesheet using an @media rule, this has traditionally been buggy, so putting the media in the &lt;link> tag is usually easiest. In any case print stylesheets are often so different from their screen counterparts that it just makes sense to keep their rules separate.</p> <blockquote> <p>I've heard that linking more files takes more time for the browser to retrieve them.</p> </blockquote> <p>Yes, but this effect is often overstated. HTTP/1.1 reduces the per-request latency by keeping connections between the client and server alive, which is a strong mitigation.</p> <blockquote> <p>How many is is too many?</p> </blockquote> <p>Enough that you're extremely unlikely to have that many stylesheets. Scripts can be a problem if you're using the kind of framework that demands one script file per class, but otherwise are generally OK. It's more commonly problematic with lots of small images.</p> <blockquote> <p>Do you heavily comment your CSS?</p> </blockquote> <p>Light commenting usually should be enough. CSS's declarative rule style doesn't usually get complicated enough to need the in-depth explanations code can demand. In particular though, document anything counterintuitive like browser-specific hacks.</p> <blockquote> <p>Alphabetize within elements?</p> </blockquote> <p>Not unless that makes it easier for you to manage. Usually it wouldn't, you'd try to group similar rules, or rules applying to similar groups of elements.</p> <blockquote> <p>Do I need a reset? </p> </blockquote> <p>A full reset? Not if you know what you're doing and can select the particular problematic defaults you want to reset.</p> <blockquote> <p>Should I include one or two nice libraries (JQuery and Prototype, for example)</p> </blockquote> <p>Don't include more than one framework unless you absolutely have to.</p> <blockquote> <p>and then have another included for each page?</p> </blockquote> <p>If each page has particular custom behaviour you could. But that doesn't usually happen. If you make progressive-enhancement behaviour scripts that bind to eg. class names, you can include the script for each behaviour on each page that uses it, then let it find the elements to bind to automatically.</p> <blockquote> <p>Directory Structure: How do you organize a site?</p> </blockquote> <p>Personally, for my Python/WSGI applications:</p> <pre><code>appfolder application.py - main WSGI entry point and control/configuration script data - run-time writable application file store private - files not available through the web server public - mounted as a virtual directory on the web server logs - access, error, application log files system - all the static application code and data htdocs - web server root folder file - static servable files img - static images script - JavaScript style - CSS lib - Python modules used by site appmodule - main application code package templates - HTML page templates mail - mail text templates </code></pre> <p>It's important for me to keep the ‘data’ in a separate place (with separate permissions) to the application in ‘system’. You need to be able to swap out the ‘system’ folder to upgrade the application, without having to worry that there are uploaded images in htdocs/img you have to worry about keeping.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload