forked from jaraco/cssutils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss.html
More file actions
2719 lines (2428 loc) · 163 KB
/
css.html
File metadata and controls
2719 lines (2428 loc) · 163 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Package cssutils.css — cssutils 0.9.8 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.9.8',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="cssutils 0.9.8 documentation" href="../index.html" />
<link rel="next" title="Package cssutils.stylesheets" href="stylesheets.html" />
<link rel="prev" title="serializing CSS" href="serialize.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="stylesheets.html" title="Package cssutils.stylesheets"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="serialize.html" title="serializing CSS"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">cssutils 0.9.8 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-cssutils.css">
<span id="package-cssutils-css"></span><h1>Package <tt class="docutils literal"><span class="pre">cssutils.css</span></tt><a class="headerlink" href="#module-cssutils.css" title="Permalink to this headline">¶</a></h1>
<p>Classes implementing <a class="reference external" href="http://www.w3.org/TR/DOM-Level-2-Style/css.html">DOM Level 2 CSS</a> and <a class="reference external" href="http://www.w3.org/TR/css3-namespace/">CSS Module: Namespaces (W3C Working Draft 28 August 2006)</a></p>
<div class="section" id="cssstylesheet">
<h2><tt class="docutils literal"><span class="pre">CSSStyleSheet</span></tt><a class="headerlink" href="#cssstylesheet" title="Permalink to this headline">¶</a></h2>
<p>A CSSStyleSheet contains all rules. It consists of the different CSS rules like <a class="reference internal" href="#cssutils.css.CSSImportRule" title="cssutils.css.CSSImportRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSImportRule</span></tt></a>, <a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleRule</span></tt></a> etc. It also defines the encoding of the style sheet used for serialization. The encoding might by set with an <a class="reference internal" href="#cssutils.css.CSSCharsetRule" title="cssutils.css.CSSCharsetRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSCharsetRule</span></tt></a> rule or simpler with the <a class="reference internal" href="#cssutils.css.CSSStyleSheet.encoding" title="cssutils.css.CSSStyleSheet.encoding"><tt class="xref py py-attr docutils literal"><span class="pre">encoding</span></tt></a> attribute. The serialized sheet may be obtained from <a class="reference internal" href="#cssutils.css.CSSStyleSheet.cssText" title="cssutils.css.CSSStyleSheet.cssText"><tt class="xref py py-attr docutils literal"><span class="pre">cssText</span></tt></a>. All rules are present in <tt class="xref py py-attr docutils literal"><span class="pre">cssRules</span></tt>, a stylesheet iterates on its rules so this might be easier. Namespaces are available via <a class="reference internal" href="#cssutils.css.CSSStyleSheet.namespaces" title="cssutils.css.CSSStyleSheet.namespaces"><tt class="xref py py-attr docutils literal"><span class="pre">namespaces</span></tt></a> (do not rely on prefixes, see <a class="reference external" href="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</a> how these work). Variables are available via <a class="reference internal" href="#cssutils.css.CSSStyleSheet.variables" title="cssutils.css.CSSStyleSheet.variables"><tt class="xref py py-attr docutils literal"><span class="pre">variables</span></tt></a> which is a <a class="reference internal" href="#cssutils.css.CSSVariablesDeclaration" title="cssutils.css.CSSVariablesDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSVariablesDeclaration</span></tt></a> and contains <strong>all</strong> available variables including the ones defined in imported style sheets. Changes to this object do NOT change the parent sheet!</p>
<dl class="class">
<dt id="cssutils.css.CSSStyleSheet">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSStyleSheet</tt><big>(</big><em>href=None</em>, <em>media=None</em>, <em>title=u''</em>, <em>disabled=None</em>, <em>ownerNode=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em>, <em>ownerRule=None</em>, <em>validating=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>CSSStyleSheet represents a CSS style sheet.</p>
<p>Format:</p>
<div class="highlight-python"><pre>stylesheet
: [ CHARSET_SYM S* STRING S* ';' ]?
[S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
[ namespace [S|CDO|CDC]* ]* # according to @namespace WD
[ [ ruleset | media | page ] [S|CDO|CDC]* ]*</pre>
</div>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">cssRules</span></tt></dt>
<dd>All Rules in this style sheet, a <a class="reference internal" href="#cssutils.css.CSSRuleList" title="cssutils.css.CSSRuleList"><tt class="xref py py-class docutils literal"><span class="pre">CSSRuleList</span></tt></a>.</dd>
</dl>
<dl class="method">
<dt id="cssutils.css.CSSStyleSheet.add">
<tt class="descname">add</tt><big>(</big><em>rule</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add <cite>rule</cite> to style sheet at appropriate position.
Same as <tt class="docutils literal"><span class="pre">insertRule(rule,</span> <span class="pre">inOrder=True)</span></tt>.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.alternate">
<tt class="descname">alternate</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.alternate" title="Permalink to this definition">¶</a></dt>
<dd><p>Not used in cssutils yet.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.cssText">
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.cssText" title="Permalink to this definition">¶</a></dt>
<dd><p>Textual representation of the stylesheet (a byte string).</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSStyleSheet.deleteRule">
<tt class="descname">deleteRule</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.deleteRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Delete rule at <cite>index</cite> from the style sheet.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>index</strong> – <p>The <cite>index</cite> of the rule to be removed from the StyleSheet’s rule
list. For an <cite>index</cite> < 0 <strong>no</strong> <a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a> is
raised but rules for normal Python lists are used. E.g.
<tt class="docutils literal"><span class="pre">deleteRule(-1)</span></tt> removes the last rule in cssRules.</p>
<p><cite>index</cite> may also be a CSSRule object which will then be removed
from the StyleSheet.</p>
</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
Raised if the specified index does not correspond to a rule in
the style sheet’s rule list.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NamespaceErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">NamespaceErr</span></tt></a>:
Raised if removing this rule would result in an invalid StyleSheet</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
Raised if this style sheet is readonly.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.encoding">
<tt class="descname">encoding</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.encoding" title="Permalink to this definition">¶</a></dt>
<dd><p>Encoding set in <a class="reference internal" href="#cssutils.css.CSSCharsetRule" title="cssutils.css.CSSCharsetRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSCharsetRule</span></tt></a> or if <tt class="docutils literal"><span class="pre">None</span></tt>
resulting in default <tt class="docutils literal"><span class="pre">utf-8</span></tt> encoding being used.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.href">
<tt class="descname">href</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.href" title="Permalink to this definition">¶</a></dt>
<dd><p>If the style sheet is a linked style sheet, the value of this attribute is its location. For inline style sheets, the value of this attribute is None. See the href attribute definition for the LINK element in HTML 4.0, and the href pseudo-attribute for the XML style sheet processing instruction.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSStyleSheet.insertRule">
<tt class="descname">insertRule</tt><big>(</big><em>rule</em>, <em>index=None</em>, <em>inOrder=False</em>, <em>_clean=True</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.insertRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Used to insert a new rule into the style sheet. The new rule now
becomes part of the cascade.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>rule</strong> – a parsable DOMString, in cssutils also a
<a class="reference internal" href="#cssutils.css.CSSRule" title="cssutils.css.CSSRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSRule</span></tt></a> or <a class="reference internal" href="#cssutils.css.CSSRuleList" title="cssutils.css.CSSRuleList"><tt class="xref py py-class docutils literal"><span class="pre">CSSRuleList</span></tt></a></li>
<li><strong>index</strong> – of the rule before the new rule will be inserted.
If the specified <cite>index</cite> is equal to the length of the
StyleSheet’s rule collection, the rule will be added to the end
of the style sheet.
If <cite>index</cite> is not given or <tt class="docutils literal"><span class="pre">None</span></tt> rule will be appended to rule
list.</li>
<li><strong>inOrder</strong> – if <tt class="docutils literal"><span class="pre">True</span></tt> the rule will be put to a proper location while
ignoring <cite>index</cite> and without raising
<a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.HierarchyRequestErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">HierarchyRequestErr</span></tt></a>.
The resulting index is returned nevertheless.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The index within the style sheet’s rule collection</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.HierarchyRequestErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">HierarchyRequestErr</span></tt></a>:
Raised if the rule cannot be inserted at the specified <cite>index</cite>
e.g. if an @import rule is inserted after a standard rule set
or other at-rule.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
Raised if the specified <cite>index</cite> is not a valid insertion point.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
Raised if this style sheet is readonly.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.SyntaxErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">SyntaxErr</span></tt></a>:
Raised if the specified rule has a syntax error and is
unparsable.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.namespaces">
<tt class="descname">namespaces</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.namespaces" title="Permalink to this definition">¶</a></dt>
<dd><p>All Namespaces used in this CSSStyleSheet.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.ownerNode">
<tt class="descname">ownerNode</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.ownerNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Not used in cssutils yet.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.ownerRule">
<tt class="descname">ownerRule</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.ownerRule" title="Permalink to this definition">¶</a></dt>
<dd><p>A ref to an @import rule if it is imported, else <tt class="docutils literal"><span class="pre">None</span></tt>.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.parentStyleSheet">
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>For style sheet languages that support the concept of style sheet inclusion, this attribute represents the including style sheet, if one exists. If the style sheet is a top-level style sheet, or the style sheet language does not support inclusion, the value of this attribute is None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.seq">
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSStyleSheet.setSerializer">
<tt class="descname">setSerializer</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.setSerializer" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the cssutils global Serializer used for all output.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSStyleSheet.setSerializerPref">
<tt class="descname">setSerializerPref</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSStyleSheet.setSerializerPref" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a Preference of CSSSerializer used for output.
See <a class="reference internal" href="serialize.html#cssutils.serialize.Preferences" title="cssutils.serialize.Preferences"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.serialize.Preferences</span></tt></a> for possible
preferences to be set.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.type">
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.type" title="Permalink to this definition">¶</a></dt>
<dd><p>This specifies the style sheet language for this style sheet. The style sheet language is specified as a content type (e.g. <tt class="docutils literal"><span class="pre">text/css</span></tt>). The content type is often specified in the ownerNode. Also see the type attribute definition for the LINK element in HTML 4.0, and the type pseudo-attribute for the XML style sheet processing instruction. For CSS this is always <tt class="docutils literal"><span class="pre">text/css</span></tt>.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSStyleSheet.variables">
<tt class="descname">variables</tt><a class="headerlink" href="#cssutils.css.CSSStyleSheet.variables" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference internal" href="#cssutils.css.CSSVariablesDeclaration" title="cssutils.css.CSSVariablesDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSVariablesDeclaration</span></tt></a> containing all available variables in this CSSStyleSheet including the ones defined in imported sheets.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="css-rules">
<h2>CSS rules<a class="headerlink" href="#css-rules" title="Permalink to this headline">¶</a></h2>
<div class="section" id="cssrule">
<h3><tt class="docutils literal"><span class="pre">CSSRule</span></tt><a class="headerlink" href="#cssrule" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSRule">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSRule</tt><big>(</big><em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base interface for any type of CSS statement. This includes
both rule sets and at-rules. An implementation is expected to preserve
all rules specified in a CSS style sheet, even if the rule is not
recognized by the parser. Unrecognized rules are represented using the
<tt class="xref py py-class docutils literal"><span class="pre">CSSUnknownRule</span></tt> interface.</p>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.CHARSET_RULE">
<tt class="descname">CHARSET_RULE</tt><em class="property"> = 2</em><a class="headerlink" href="#cssutils.css.CSSRule.CHARSET_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSCharsetRule" title="cssutils.css.CSSCharsetRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSCharsetRule</span></tt></a> (not used in CSSOM anymore)</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.COMMENT">
<tt class="descname">COMMENT</tt><em class="property"> = 1001</em><a class="headerlink" href="#cssutils.css.CSSRule.COMMENT" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSComment" title="cssutils.css.CSSComment"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSComment</span></tt></a> - not in the offical spec,
Value has changed in 0.9.7a3</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.FONT_FACE_RULE">
<tt class="descname">FONT_FACE_RULE</tt><em class="property"> = 5</em><a class="headerlink" href="#cssutils.css.CSSRule.FONT_FACE_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSFontFaceRule" title="cssutils.css.CSSFontFaceRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSFontFaceRule</span></tt></a></p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.IMPORT_RULE">
<tt class="descname">IMPORT_RULE</tt><em class="property"> = 3</em><a class="headerlink" href="#cssutils.css.CSSRule.IMPORT_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSImportRule" title="cssutils.css.CSSImportRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSImportRule</span></tt></a></p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.MEDIA_RULE">
<tt class="descname">MEDIA_RULE</tt><em class="property"> = 4</em><a class="headerlink" href="#cssutils.css.CSSRule.MEDIA_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSMediaRule" title="cssutils.css.CSSMediaRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSMediaRule</span></tt></a></p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.NAMESPACE_RULE">
<tt class="descname">NAMESPACE_RULE</tt><em class="property"> = 10</em><a class="headerlink" href="#cssutils.css.CSSRule.NAMESPACE_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSNamespaceRule" title="cssutils.css.CSSNamespaceRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSNamespaceRule</span></tt></a>,
Value has changed in 0.9.7a3 due to a change in the CSSOM spec.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.PAGE_RULE">
<tt class="descname">PAGE_RULE</tt><em class="property"> = 6</em><a class="headerlink" href="#cssutils.css.CSSRule.PAGE_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSPageRule" title="cssutils.css.CSSPageRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSPageRule</span></tt></a></p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.STYLE_RULE">
<tt class="descname">STYLE_RULE</tt><em class="property"> = 1</em><a class="headerlink" href="#cssutils.css.CSSRule.STYLE_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSStyleRule</span></tt></a></p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.UNKNOWN_RULE">
<tt class="descname">UNKNOWN_RULE</tt><em class="property"> = 0</em><a class="headerlink" href="#cssutils.css.CSSRule.UNKNOWN_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSUnknownRule</span></tt> (not used in CSSOM anymore)</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.VARIABLES_RULE">
<tt class="descname">VARIABLES_RULE</tt><em class="property"> = 1008</em><a class="headerlink" href="#cssutils.css.CSSRule.VARIABLES_RULE" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#cssutils.css.CSSVariablesRule" title="cssutils.css.CSSVariablesRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSVariablesRule</span></tt></a> - experimental rule
not in the offical spec</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.atkeyword">
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSRule.atkeyword" title="Permalink to this definition">¶</a></dt>
<dd><p>Literal keyword of an @rule (e.g. <tt class="docutils literal"><span class="pre">@IMport</span></tt>).</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.cssText">
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSRule.cssText" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSRule.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The Parent Node of this CSSRule or None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.parentRule">
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSRule.parentRule" title="Permalink to this definition">¶</a></dt>
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.parentStyleSheet">
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>The style sheet that contains this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.seq">
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSRule.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.type">
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSRule.type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.typeString">
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSRule.typeString" title="Permalink to this definition">¶</a></dt>
<dd><p>Descriptive name of this rule’s type.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRule.wellformed">
<tt class="descname">wellformed</tt><a class="headerlink" href="#cssutils.css.CSSRule.wellformed" title="Permalink to this definition">¶</a></dt>
<dd><p>If the rule is wellformed.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="cssrulelist">
<h3><tt class="docutils literal"><span class="pre">CSSRuleList</span></tt><a class="headerlink" href="#cssrulelist" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSRuleList">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSRuleList</tt><big>(</big><em>*ignored</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList" title="Permalink to this definition">¶</a></dt>
<dd><p>The CSSRuleList object represents an (ordered) list of statements.</p>
<p>The items in the CSSRuleList are accessible via an integral index,
starting from 0.</p>
<p>Subclasses a standard Python list so theoretically all standard list
methods are available. Setting methods like <tt class="docutils literal"><span class="pre">__init__</span></tt>, <tt class="docutils literal"><span class="pre">append</span></tt>,
<tt class="docutils literal"><span class="pre">extend</span></tt> or <tt class="docutils literal"><span class="pre">__setslice__</span></tt> are added later on instances of this
class if so desired.
E.g. CSSStyleSheet adds <tt class="docutils literal"><span class="pre">append</span></tt> which is not available in a simple
instance of this class!</p>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.append">
<tt class="descname">append</tt><big>(</big><em>*ignored</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Implemented in class using a CSSRuleList only.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.count">
<tt class="descname">count</tt><big>(</big><em>value</em><big>)</big> → integer -- return number of occurrences of value<a class="headerlink" href="#cssutils.css.CSSRuleList.count" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.extend">
<tt class="descname">extend</tt><big>(</big><em>*ignored</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Implemented in class using a CSSRuleList only.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.index">
<tt class="descname">index</tt><big>(</big><em>value</em><span class="optional">[</span>, <em>start</em><span class="optional">[</span>, <em>stop</em><span class="optional">]</span><span class="optional">]</span><big>)</big> → integer -- return first index of value.<a class="headerlink" href="#cssutils.css.CSSRuleList.index" title="Permalink to this definition">¶</a></dt>
<dd><p>Raises ValueError if the value is not present.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.insert">
<tt class="descname">insert</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>L.insert(index, object) – insert object before index</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.item">
<tt class="descname">item</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.item" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) Retrieve a CSS rule by ordinal <cite>index</cite>. The order in this
collection represents the order of the rules in the CSS style
sheet. If index is greater than or equal to the number of rules in
the list, this returns None.</p>
<p>Returns CSSRule, the style rule at the index position in the
CSSRuleList, or None if that is not a valid index.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSRuleList.length">
<tt class="descname">length</tt><a class="headerlink" href="#cssutils.css.CSSRuleList.length" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The number of CSSRules in the list.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.pop">
<tt class="descname">pop</tt><big>(</big><span class="optional">[</span><em>index</em><span class="optional">]</span><big>)</big> → item -- remove and return item at index (default last).<a class="headerlink" href="#cssutils.css.CSSRuleList.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Raises IndexError if list is empty or index is out of range.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.remove">
<tt class="descname">remove</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.remove" title="Permalink to this definition">¶</a></dt>
<dd><p>L.remove(value) – remove first occurrence of value.
Raises ValueError if the value is not present.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.reverse">
<tt class="descname">reverse</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>L.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.rulesOfType">
<tt class="descname">rulesOfType</tt><big>(</big><em>type</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.rulesOfType" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield the rules which have the given <cite>type</cite> only, one of the
constants defined in <a class="reference internal" href="#cssutils.css.CSSRule" title="cssutils.css.CSSRule"><tt class="xref py py-class docutils literal"><span class="pre">cssutils.css.CSSRule</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSRuleList.sort">
<tt class="descname">sort</tt><big>(</big><big>)</big><a class="headerlink" href="#cssutils.css.CSSRuleList.sort" title="Permalink to this definition">¶</a></dt>
<dd><p>L.sort(cmp=None, key=None, reverse=False) – stable sort <em>IN PLACE</em>;
cmp(x, y) -> -1, 0, 1</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="csscharsetrule">
<h3><tt class="docutils literal"><span class="pre">CSSCharsetRule</span></tt><a class="headerlink" href="#csscharsetrule" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSCharsetRule">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSCharsetRule</tt><big>(</big><em>encoding=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSCharsetRule" title="Permalink to this definition">¶</a></dt>
<dd><p>The CSSCharsetRule interface represents an @charset rule in a CSS style
sheet. The value of the encoding attribute does not affect the encoding
of text data in the DOM objects; this encoding is always UTF-16
(also in Python?). After a stylesheet is loaded, the value of the
encoding attribute is the value found in the @charset rule. If there
was no @charset in the original document, then no CSSCharsetRule is
created. The value of the encoding attribute may also be used as a hint
for the encoding used on serialization of the style sheet.</p>
<p>The value of the @charset rule (and therefore of the CSSCharsetRule)
may not correspond to the encoding the document actually came in;
character encoding information e.g. in an HTTP header, has priority
(see CSS document representation) but this is not reflected in the
CSSCharsetRule.</p>
<p>This rule is not really needed anymore as setting
<a class="reference internal" href="#cssutils.css.CSSStyleSheet.encoding" title="cssutils.css.CSSStyleSheet.encoding"><tt class="xref py py-attr docutils literal"><span class="pre">CSSStyleSheet.encoding</span></tt></a> is much easier.</p>
<p>Format:</p>
<div class="highlight-python"><pre>charsetrule:
CHARSET_SYM S* STRING S* ';'</pre>
</div>
<p>BUT: Only valid format is (single space, double quotes!):</p>
<div class="highlight-python"><pre>@charset "ENCODING";</pre>
</div>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.atkeyword">
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.atkeyword" title="Permalink to this definition">¶</a></dt>
<dd><p>Literal keyword of an @rule (e.g. <tt class="docutils literal"><span class="pre">@IMport</span></tt>).</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.cssText">
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.cssText" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The parsable textual representation.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.encoding">
<tt class="descname">encoding</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.encoding" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM)The encoding information used in this @charset rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The Parent Node of this CSSRule or None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.parentRule">
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.parentRule" title="Permalink to this definition">¶</a></dt>
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.parentStyleSheet">
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>The style sheet that contains this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.seq">
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.type">
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSCharsetRule.typeString">
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSCharsetRule.typeString" title="Permalink to this definition">¶</a></dt>
<dd><p>Descriptive name of this rule’s type.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="cssfontfacerule">
<h3><tt class="docutils literal"><span class="pre">CSSFontFaceRule</span></tt><a class="headerlink" href="#cssfontfacerule" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSFontFaceRule">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSFontFaceRule</tt><big>(</big><em>style=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSFontFaceRule" title="Permalink to this definition">¶</a></dt>
<dd><p>The CSSFontFaceRule interface represents a @font-face rule in a CSS
style sheet. The @font-face rule is used to hold a set of font
descriptions.</p>
<p>Format:</p>
<div class="highlight-python"><pre>font_face
: FONT_FACE_SYM S*
'{' S* declaration [ ';' S* declaration ]* '}' S*
;</pre>
</div>
<p>cssutils uses a <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration" title="cssutils.css.CSSStyleDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleDeclaration</span></tt></a> to
represent the font descriptions. For validation a specific profile
is used though were some properties have other valid values than
when used in e.g. a <a class="reference internal" href="#cssutils.css.CSSStyleRule" title="cssutils.css.CSSStyleRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleRule</span></tt></a>.</p>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.atkeyword">
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.atkeyword" title="Permalink to this definition">¶</a></dt>
<dd><p>Literal keyword of an @rule (e.g. <tt class="docutils literal"><span class="pre">@IMport</span></tt>).</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.cssText">
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.cssText" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The parsable textual representation of this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The Parent Node of this CSSRule or None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.parentRule">
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.parentRule" title="Permalink to this definition">¶</a></dt>
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.parentStyleSheet">
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>The style sheet that contains this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.seq">
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.style">
<tt class="descname">style</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.style" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The declaration-block of this rule set, a <a class="reference internal" href="#cssutils.css.CSSStyleDeclaration" title="cssutils.css.CSSStyleDeclaration"><tt class="xref py py-class docutils literal"><span class="pre">CSSStyleDeclaration</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.type">
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.typeString">
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.typeString" title="Permalink to this definition">¶</a></dt>
<dd><p>Descriptive name of this rule’s type.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSFontFaceRule.valid">
<tt class="descname">valid</tt><a class="headerlink" href="#cssutils.css.CSSFontFaceRule.valid" title="Permalink to this definition">¶</a></dt>
<dd><p>CSSFontFace is valid if properties <cite>font-family</cite> and <cite>src</cite> are set and all properties are valid.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="cssimportrule">
<h3><tt class="docutils literal"><span class="pre">CSSImportRule</span></tt><a class="headerlink" href="#cssimportrule" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSImportRule">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSImportRule</tt><big>(</big><em>href=None</em>, <em>mediaText=None</em>, <em>name=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSImportRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an @import rule within a CSS style sheet. The @import rule
is used to import style rules from other style sheets.</p>
<p>Format:</p>
<div class="highlight-python"><pre>import
: IMPORT_SYM S*
[STRING|URI] S* [ medium [ COMMA S* medium]* ]? S* STRING? S* ';' S*
;</pre>
</div>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.atkeyword">
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.atkeyword" title="Permalink to this definition">¶</a></dt>
<dd><p>Literal keyword of an @rule (e.g. <tt class="docutils literal"><span class="pre">@IMport</span></tt>).</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.cssText">
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.cssText" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The parsable textual representation of this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.href">
<tt class="descname">href</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.href" title="Permalink to this definition">¶</a></dt>
<dd><p>Location of the style sheet to be imported.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.media">
<tt class="descname">media</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.media" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) A list of media types for this rule of type <a class="reference internal" href="stylesheets.html#cssutils.stylesheets.MediaList" title="cssutils.stylesheets.MediaList"><tt class="xref py py-class docutils literal"><span class="pre">MediaList</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.name">
<tt class="descname">name</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.name" title="Permalink to this definition">¶</a></dt>
<dd><p>An optional name for the imported sheet.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The Parent Node of this CSSRule or None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.parentRule">
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.parentRule" title="Permalink to this definition">¶</a></dt>
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.parentStyleSheet">
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>The style sheet that contains this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.seq">
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.styleSheet">
<tt class="descname">styleSheet</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.styleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>(readonly) The style sheet referred to by this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.type">
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.typeString">
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.typeString" title="Permalink to this definition">¶</a></dt>
<dd><p>Descriptive name of this rule’s type.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSImportRule.wellformed">
<tt class="descname">wellformed</tt><a class="headerlink" href="#cssutils.css.CSSImportRule.wellformed" title="Permalink to this definition">¶</a></dt>
<dd><p>Depending on if media is used at all.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="cssmediarule">
<h3><tt class="docutils literal"><span class="pre">CSSMediaRule</span></tt><a class="headerlink" href="#cssmediarule" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSMediaRule">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSMediaRule</tt><big>(</big><em>mediaText='all'</em>, <em>name=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Objects implementing the CSSMediaRule interface can be identified by the
MEDIA_RULE constant. On these objects the type attribute must return the
value of that constant.</p>
<p>Format:</p>
<div class="highlight-python"><pre>: MEDIA_SYM S* medium [ COMMA S* medium ]*
STRING? # the name
LBRACE S* ruleset* '}' S*;</pre>
</div>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">cssRules</span></tt></dt>
<dd>All Rules in this media rule, a <a class="reference internal" href="#cssutils.css.CSSRuleList" title="cssutils.css.CSSRuleList"><tt class="xref py py-class docutils literal"><span class="pre">CSSRuleList</span></tt></a>.</dd>
</dl>
<dl class="method">
<dt id="cssutils.css.CSSMediaRule.add">
<tt class="descname">add</tt><big>(</big><em>rule</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add <cite>rule</cite> to end of this mediarule.
Same as <a class="reference internal" href="#cssutils.css.CSSMediaRule.insertRule" title="cssutils.css.CSSMediaRule.insertRule"><tt class="xref py py-meth docutils literal"><span class="pre">insertRule()</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.atkeyword">
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.atkeyword" title="Permalink to this definition">¶</a></dt>
<dd><p>Literal keyword of an @rule (e.g. <tt class="docutils literal"><span class="pre">@IMport</span></tt>).</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.cssText">
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.cssText" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The parsable textual representation of this rule.</p>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSMediaRule.deleteRule">
<tt class="descname">deleteRule</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule.deleteRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Delete the rule at <cite>index</cite> from the media block.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>index</strong> – <p>The <cite>index</cite> of the rule to be removed from the media block’s rule
list. For an <cite>index</cite> < 0 <strong>no</strong> <a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a> is
raised but rules for normal Python lists are used. E.g.
<tt class="docutils literal"><span class="pre">deleteRule(-1)</span></tt> removes the last rule in cssRules.</p>
<p><cite>index</cite> may also be a CSSRule object which will then be removed
from the media block.</p>
</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
Raised if the specified index does not correspond to a rule in
the media rule list.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
Raised if this media rule is readonly.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="cssutils.css.CSSMediaRule.insertRule">
<tt class="descname">insertRule</tt><big>(</big><em>rule</em>, <em>index=None</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSMediaRule.insertRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert <cite>rule</cite> into the media block.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>rule</strong> – <p>the parsable text representing the <cite>rule</cite> to be inserted. For rule
sets this contains both the selector and the style declaration.
For at-rules, this specifies both the at-identifier and the rule
content.</p>
<p>cssutils also allows rule to be a valid
<a class="reference internal" href="#cssutils.css.CSSRule" title="cssutils.css.CSSRule"><tt class="xref py py-class docutils literal"><span class="pre">CSSRule</span></tt></a> object.</p>
</li>
<li><strong>index</strong> – before the specified <cite>rule</cite> will be inserted.
If the specified <cite>index</cite> is
equal to the length of the media blocks’s rule collection, the
rule will be added to the end of the media block.
If index is not given or None rule will be appended to rule
list.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the index within the media block’s rule collection of the
newly inserted rule.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Exceptions :</th><td class="field-body"><ul class="first last simple">
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.HierarchyRequestErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">HierarchyRequestErr</span></tt></a>:
Raised if the <cite>rule</cite> cannot be inserted at the specified <cite>index</cite>,
e.g., if an @import rule is inserted after a standard rule set
or other at-rule.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.IndexSizeErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">IndexSizeErr</span></tt></a>:
Raised if the specified <cite>index</cite> is not a valid insertion point.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.NoModificationAllowedErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">NoModificationAllowedErr</span></tt></a>:
Raised if this media rule is readonly.</li>
<li><a class="reference external" href="http://docs.python.org/dev/library/xml.dom.html#xml.dom.SyntaxErr" title="(in Python v3.3)"><tt class="xref py py-exc docutils literal"><span class="pre">SyntaxErr</span></tt></a>:
Raised if the specified <cite>rule</cite> has a syntax error and is
unparsable.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.media">
<tt class="descname">media</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.media" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) A list of media types for this rule of type <a class="reference internal" href="stylesheets.html#cssutils.stylesheets.MediaList" title="cssutils.stylesheets.MediaList"><tt class="xref py py-class docutils literal"><span class="pre">MediaList</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.name">
<tt class="descname">name</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.name" title="Permalink to this definition">¶</a></dt>
<dd><p>An optional name for this media rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The Parent Node of this CSSRule or None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.parentRule">
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.parentRule" title="Permalink to this definition">¶</a></dt>
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.parentStyleSheet">
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>The style sheet that contains this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.seq">
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.type">
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSMediaRule.typeString">
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSMediaRule.typeString" title="Permalink to this definition">¶</a></dt>
<dd><p>Descriptive name of this rule’s type.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="cssnamespacerule">
<h3><tt class="docutils literal"><span class="pre">CSSNamespaceRule</span></tt><a class="headerlink" href="#cssnamespacerule" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSNamespaceRule">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSNamespaceRule</tt><big>(</big><em>namespaceURI=None</em>, <em>prefix=None</em>, <em>cssText=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSNamespaceRule" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents an @namespace rule within a CSS style sheet.</p>
<p>The @namespace at-rule declares a namespace prefix and associates
it with a given namespace (a string). This namespace prefix can then be
used in namespace-qualified names such as those described in the
Selectors Module [SELECT] or the Values and Units module [CSS3VAL].</p>
<p>Dealing with these rules directly is not needed anymore, easier is
the use of <a class="reference internal" href="#cssutils.css.CSSStyleSheet.namespaces" title="cssutils.css.CSSStyleSheet.namespaces"><tt class="xref py py-attr docutils literal"><span class="pre">cssutils.css.CSSStyleSheet.namespaces</span></tt></a>.</p>
<p>Format:</p>
<div class="highlight-python"><pre>namespace
: NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S*
;
namespace_prefix
: IDENT
;</pre>
</div>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.atkeyword">
<tt class="descname">atkeyword</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.atkeyword" title="Permalink to this definition">¶</a></dt>
<dd><p>Literal keyword of an @rule (e.g. <tt class="docutils literal"><span class="pre">@IMport</span></tt>).</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.cssText">
<tt class="descname">cssText</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.cssText" title="Permalink to this definition">¶</a></dt>
<dd><p>(DOM) The parsable textual representation of this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.namespaceURI">
<tt class="descname">namespaceURI</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.namespaceURI" title="Permalink to this definition">¶</a></dt>
<dd><p>URI (handled as simple string) of the defined namespace.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.parent">
<tt class="descname">parent</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.parent" title="Permalink to this definition">¶</a></dt>
<dd><p>The Parent Node of this CSSRule or None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.parentRule">
<tt class="descname">parentRule</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.parentRule" title="Permalink to this definition">¶</a></dt>
<dd><p>If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.parentStyleSheet">
<tt class="descname">parentStyleSheet</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.parentStyleSheet" title="Permalink to this definition">¶</a></dt>
<dd><p>The style sheet that contains this rule.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.prefix">
<tt class="descname">prefix</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.prefix" title="Permalink to this definition">¶</a></dt>
<dd><p>Prefix used for the defined namespace.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.seq">
<tt class="descname">seq</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.seq" title="Permalink to this definition">¶</a></dt>
<dd><p>Internal readonly attribute, <strong>DO NOT USE</strong>!</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.type">
<tt class="descname">type</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of this rule, as defined by a CSSRule type constant.</p>
</dd></dl>
<dl class="attribute">
<dt id="cssutils.css.CSSNamespaceRule.typeString">
<tt class="descname">typeString</tt><a class="headerlink" href="#cssutils.css.CSSNamespaceRule.typeString" title="Permalink to this definition">¶</a></dt>
<dd><p>Descriptive name of this rule’s type.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="csspagerule">
<h3><tt class="docutils literal"><span class="pre">CSSPageRule</span></tt><a class="headerlink" href="#csspagerule" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="cssutils.css.CSSPageRule">
<em class="property">class </em><tt class="descclassname">cssutils.css.</tt><tt class="descname">CSSPageRule</tt><big>(</big><em>selectorText=None</em>, <em>style=None</em>, <em>parentRule=None</em>, <em>parentStyleSheet=None</em>, <em>readonly=False</em><big>)</big><a class="headerlink" href="#cssutils.css.CSSPageRule" title="Permalink to this definition">¶</a></dt>
<dd><p>The CSSPageRule interface represents a @page rule within a CSS style
sheet. The @page rule is used to specify the dimensions, orientation,
margins, etc. of a page box for paged media.</p>
<p>Format:</p>
<div class="highlight-python"><pre>page
PAGE_SYM S* IDENT? pseudo_page? S*
'{' S* declaration [ ';' S* declaration ]* '}' S*
;
pseudo_page
':' [ "left" | "right" | "first" ]
;</pre>