Disallow @import
nzakas edited this page Oct 25, 2011
·
2 revisions
Pages 48
- Home
- About
- Avoid un anchored hovers
- Beware of box model size
- Build System
- Build System Integration
- Bulletproof font face
- Command line interface
- Contributing
- Developer Guide
- Disallow !important
- Disallow @import
- Disallow adjoining classes
- Disallow box sizing
- Disallow duplicate background images
- Disallow duplicate properties
- Disallow IDs in selectors
- Disallow negative text indent
- Disallow non alphabetical
- Disallow outline:none
- Disallow overqualified elements
- Disallow qualified headings
- Disallow selectors that look like regular expressions
- Disallow star hack
- Disallow too many floats
- Disallow underscore hack
- Disallow units for zero values
- Disallow universal selector
- Disallow unqualified attribute selectors
- Don't use too many font size declarations
- Don't use too many web fonts
- Headings should only be defined once
- IDE integration
- Ignoring parts of CSS during linting
- New Release
- Require all gradient definitions
- Require compatible vendor prefixes
- Require fallback colors
- Require properties appropriate for display
- Require shorthand properties
- Require standard property with vendor prefix
- Require use of known properties
- Rules
- Rules by ID
- Source Code
- Unit Tests
- Using in a Node.js Application
- Working with Rules
- Show 33 more pages…
Clone this wiki locally
The @import command is used to include CSS files within other CSS files, for example:
@import url(more.css);
@import url(andmore.css);
a {
color: black;
}This code includes two more style sheets at the beginning of a style sheet. When the browser parses this code, it stops at each @import and starts to download the specified file. The browser doesn't continue downloading other style sheets until this one has finished, eliminating any possible parallel downloads of CSS.
There are two alternatives to using @import:
- Use a build system to concatenate CSS files together before deploying.
- Use multiple
<link>tags to include the style sheets you want. These will still be downloaded in parallel.
Rule Details
Rule ID: import
This rule warns when @import is being used in CSS.
The following pattern is considered a warning:
@import url(foo.css);