[CSS][Pro CSS for High Traffic Websites].pdf

(11880 KB) Pobierz
Download from Wow! eBook <www.wowebook.com>
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
CONTENTS AT A GLANCE
Contents at a Glance
Foreword............................................................................................................. xvii
About the Authors.............................................................................................. xviii
About the Technical Reviewer ............................................................................. xix
Acknowledgments ................................................................................................ xx
Preface................................................................................................................. xxi
Background Information..................................................................................... xxii
Chapter 1: The Value of Process .............................................................................1
Chapter 2: CSS Style Guide ...................................................................................37
Chapter 3: Fundamentals
.............................................................................................67
Chapter 4: Frameworks and Integration.............................................................101
Chapter 5: Brand Implementation.......................................................................137
Chapter 6: CSS and Accessibility........................................................................165
Chapter 8: Performance......................................................................................223
Chapter 9: Dynamic CSS .....................................................................................261
Chapter 10: Testing and Debugging....................................................................301
Chapter 11: Creating Your CSS ...........................................................................331
Appendix 1: CSS Standards Guide ......................................................................361
Appendix 2: Accessibility Guidelines ..................................................................369
Appendix 3: Browser Support Guidelines ...........................................................373
Appendix 4: Development Process .....................................................................377
Index ...................................................................................................................383
iii
BACKGROUND INFORMATION
Background Information
This book assumes certain pieces of knowledge on the reader’s part. This section aims to ensure that you
are aware of these pieces of information, and explain what you can get out of this book. Seasoned
developers or anyone who has been working in the web industry for a reasonable amount of time should
be able to safely skip to the first chapter.
Who Is This Book For?
Although we will be providing examples of CSS code to demonstrate techniques and subjects we are
covering, these are not to demonstrate the latest selectors or properties, but instead to demonstrate how
to format, comment, and model your code to keep it sane and follow best practices in your processes. To
that end, this book is about the entire team as much as it is about the developer and should be of value
to all of its members.
This book is for the following:
Anyone working on a high-traffic website. This is any website expecting
upward of 10,000 unique visitors per day, or with occasional spikes of traffic
higher than this amount.
Anyone working on a very large website one with perhaps upward of 2,000
individual pages or with more than 30 minisites.
Anyone working on websites in companies with large amounts of staff
modifying the same codebase, with upward of 30 developers working on the
CSS.
Anyone working for a company with the capacity to become a very large
company and wanting to build a good basis for its web development
processes.
Developers without previous experience of working in large teams.
However, the practices involved are best practices for websites of any size.
What Will I Learn?
Throughout the course of this book, you will learn the following:
The value of process
How to share knowledge among staff and teams
xxii
BACKGROUND INFORMATION
How to quickly get new CSS developers up and running
How to incorporate CSS into builds and deployments
How to write reusable and modular CSS
How to maximize performance of your website(s)
How to keep branding consistent
Best practices for cross-browser and accessible CSS
Dynamic CSS techniques
The final chapter provides a simple CSS framework we developed specifically for this book that
demonstrates many of the things that we touch upon, as well as the process we have followed to build it.
The four appendices provide concrete examples of guides and processes that you should find useful.
Why Is This Book Different From Others?
Before embarking on the writing of this book, we did much investigation into which alternative
resources were available. A plethora of books on learning the basics of CSS, advanced CSS techniques,
CSS3 selectors/properties, and different CSS design patterns are all easily obtainable.
This book does not compete with or replace these titles. This book instead explores the challenges of
working in large teams or among large numbers of individual teams, on sites with many pages or
subsites that receive considerable traffic. This book is not about using the latest and flashiest techniques
for image replacement or cross-browser rounded corners; rather, it is focused on making it easy for
newcomers to teams to easily comprehend and add to existing code, and for CSS within your
infrastructure to be considered from the outset and built in a sane and performant manner.
Even though this book is aimed at both beginners and experts alike, we assume that you are
comfortable using HTML and CSS, or are at least familiar with their syntax. We will be discussing the
usage of modular, reusable code that is both robust and practical throughout the chapters in this book.
Separation of Concerns
Separation of concerns
is an important concept to understand when writing CSS. Many different
architectures for applications and systems exist. The justifications and benefits of them are far beyond
the scope of this book; however, it is worth giving a very simple explanation of multitier architecture
since the logic behind it is easily applicable to CSS and the browser application model.
A multitier architecture approach is a design that separates logic, data, and presentation.
1
This
usually describes a client-server system, where there is a client application and a server application. The
majority of the processing takes place on the server, and the client is concerned with displaying the
information and giving the user an interface to manipulate it. The multitier approach applies as such:
Client application:
presentation
Application:
logic
1
Model View Controller (MVC) is an example of this.
xxiii
Zgłoś jeśli naruszono regulamin