From 59a5c4447761c7364b33ec6605fad18519929708 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sat, 26 Jul 2014 13:44:35 +0400 Subject: [PATCH 01/17] Add PostCSS logo --- logo.png | Bin 0 -> 2091 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 logo.png diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..082071a495ac78b7602e881955f6601507456d38 GIT binary patch literal 2091 zcmV+`2-Nq9P)005u}0{{R3yb+fl0000LP)t-s-8VJh zOG)W}e(V!g(Md!>RCodHoNICA%dgASP4xRsd!*t4M>bb!Cwd%7~heBF9BqQhdE~^;pu?1rENghPkxi$UqH>D3P{^IF2?^9^EG~V z5#m{ZVf)a>AKE|vRymJH0M@Airu6CHz!qROq(2^z`&g2L{qKKRPSN;aKwO1Um|RPR z;ZkmMACCeIyTB8D+yrB1mEywyd5M=$T!p;to!R0+fL^Q-%8Wp0HtfWUMIW&4P95$Y z>^A>gcga3rgU>JQ%VcIo$jR30)c+AM?9zO~K@xY!-U}Q26JS_1Ra=p}&1wnTXaCTtFHmC^;K=Ju?3s1M~J6ZA`;V5Uw>k%xeMWuFfpRfW% zaj`HmjGLj+ChP+C`P9S%*oFtYgg6ECicby>h3Ju!`-J22y2$GsvVdQWj5eX408;r; z^&H^!8o)Lo`+!l+N&udY>wAUuH^Y5EQ(RQtW_lC@qfKaCKs0inrG@1Owm0nF1FRER zMrLcv5+&hf7>>I2b_pyF3asm7*`xy~dzVu-pl2CxhaqY}O{O-DqdRVtgr=4ipd4I! z#G@TtRswS0a1Xz|}D02vK z<^#7S8%}`M3POAZw5t>enKv~|Mo|Em3G4dJ+E4<#^ss3l3Xs*1VIpi7M-*xsK-

z!*8=OV@`uhLWM@@Wch^?pni|-qzKH*g%uu~32y<1AFYI=eA3{5`H1<@3KL&R$Xmd{ zgCLv%V>1Xd)P7bpE2Tm$o$PBs-(F}k>t}LrAzyi>g28>L{+QpU~`D}7j(Ggof ztQs?u7Hh!BQ$ki7PYq!UKwkhx-j%wFTr8Z-&XJex05=AK=Nd520b7UHP}3REa;?ZU zAhN3&P)@c(z@Eo!=MN`fZ=`wXvaxBu-qxevUz*~B;!dI90IHhbQ&TTfc?QN59GIi zh_b9O9soE_muZoBS)7jh{h;(DK#p6$xGr9*J^m3e`ha5stn25#1;oK{Jd40$&707n z0qz0gVWqc)7d0w3ha;O+Mu3v@0FWNN$6~`L1+aYl9(jve5<)`-~F zfXrmHZd=rJt@9-hPy4*exSIn7ya%-QeKkHexqcOnVd4`Y_E8$kLd2q~(>|g#ehdsR z`2={C=e9k-lsuUSg$$05-pxEJzPwtT6bRcRV2R#b2a|hHiXYjAzlr`SYE2=FmQ?vRC=m4{p3$Rh| z^m!f`EY?exuNMVv?{7{p#YI_;6(Didt7PkXab!z>Eklb-L<0cMb|g#ODJBcRsgM#Y3pV&RCw0LOIm`)|4e35((%ISeSoh{ZDlPA1pBhK91Tz?! zB!dLtkWB5o0;CM_9_0=&-U=q!7BJroSGzdyMyw)>g=nu~P^u|Ks)c&a5!fFs`!fLi zkVAqkg*!Pvba8eI0CBKK4bnkIK3P$JhV{MDHD3W3gCcwvU-N}Hcsw6^d^KRC z>m==Q3e@@A1vEk(JxXCUp8!h@=p|*34nI8dtx;x(N4mF}eB;O=e5Cn$y^WJOo1qW# zoYz{_)Aq>ki#Ri1A5hf>1K{7qv+sO-^Z3yf$r`aZgpQ}aAQ2G`9@6>!*PIyVfbB?x z8+b}L7Z=SRZ@~!>&6k(bZSnFwN91z=Gkh-AIJYeseo-8IBw+C^R5LguBgqJo#JX4@ zuRa^_dx!1dYhPB(14e~wc?jt@BjGt-x& zr>JG}U9TK>H-l4!Sy?w!^?v(1(f?r4oiuX?hH2mP0|2G?;0%x7*WSNQzkt7h{{h33 V&YA4`!Xf|w002ovPDHLkV1lDu&1?Vw literal 0 HcmV?d00001 From 87e1ad37dace2f74753a87035cca9cad945d2521 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sat, 8 Nov 2014 02:28:23 +0300 Subject: [PATCH 02/17] Add logo with big left padding --- logo-leftp.png | Bin 0 -> 2151 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 logo-leftp.png diff --git a/logo-leftp.png b/logo-leftp.png new file mode 100644 index 0000000000000000000000000000000000000000..4a05f8ef01428902f623e763330ad9a823a8435e GIT binary patch literal 2151 zcmV-t2$=VYP)^0000LP)t-s-8VJh zOG)W}e(V!h4M{{nRCodHo$qerI1I!!!y(`Qkq=07+$d|C zaFE^ zq9nm-N8iBZk*tTYUZGVP=hSgk)-t5NmC>uYO$H0&@jPL@eiw{A3nNR*BFqchxeSR8 z#(K;mnr$T-w0t~e9gIauEnO{J`66G=4K*-U16E5TY$fKoKCR!xn1NHy1IV@MvgPz( zH{(2|^*k6?P50%Q_3vQJNG<2Vd^ypuydtBUu?U(}TC;4rmgC3T8GS577pG7B>u7Cf zWKkvRrLlSFZDjkZmQGvK~d+1bTtg&W1kN<-2l`HVh`rihTFOyfl(x)^cj#_ZnE zoH9D{BK>&+wPuAiF%~m@&qe3NsBtWNf`l&}7O{s>#Wo!8HcyN;D#7P4;hGs8jA^bP zj?H=JSbwG8O`00yG%*e>g_AlM(?3Uu@ML^Oq;|WFG%;c+A=$!+ql)8yocza9FIqlk z$n-21=emLMFjSGYDj8K-?MTSwrku=~K1S@%Er&hU$MAX+I3Y8}%V^E$Py?gydF0L| za$W;4IkAF#WE{4VG!2Z}96f&}ao&#NgjhoAk#T4_AsZNd$4-Ukkh6SoCo^fwXtg#* z+Z`L}-ih(#7Ali*ZKGi{Fmf;OH2?F=$dfJ1iK;Ro)x>Cyd+jEZ$(VyvQ7O^o8XxP#&q#-a(U*N+|%#$`rE zkg=@47~+1Y0K~PgtyT*;uTF6FqZ)21fsv*YjW+LMLSJ2)xD4AOs5vBO2u8KE{xN?_KGO}u7XL_}VaYUTygo19i(@Ml-tnVpl z+G9;wC{8rcXxt10%qzsma4dSf+xE&+vc&~*ZodM#-Cmc7e!w_IYsN_zqjPbA#B3g& zij=#IPwT$!jI3_c>FHfbDdGoC3V;?My~->A`1c>tFR)(*OPu{E!kPsoDEtedylTziO}(r@Y3e zLn7k_qX&`sSujowJl^C-dwCnrb(0Y$5*VrH0u-i|6BNY6*eWRt<&$vNI3)xXE{~Ap z5=mnUbEq~mD&297qLI;)?NXtWF|Oz9k5%V|Wc_tDDf@jnS1x`D#W6rb$sxY9X%a~4 zCL>eW6rW_e>0pPNB)yw)mP_@!%9VP64{`r-R zew%Q5(^XD*ya6M`!j|)L)QH`TlLqUT;=P!Pe6#l=0rY~?r;v0cw*m&)r(c^6y!)@*}GVOj+ZU^0EZ^l?W+!CP4!$WeH zByP8d)Zy9B*xMU%{X3vrU+A5w>*i`;Y?KTud`Lim*6+s#P9EY>aR($odh{^%i^iKw zB!GPW?1P*NwdG^K%mA9Q%QJoKPtOj2y@_l+R#H`3=<*?h_ePzl^_( dzl>legYN(U002ovPDHLkV1jXBJM#bl literal 0 HcmV?d00001 From bd2a899c6a07842629124fd2b4d2b86207c3b678 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Tue, 16 Dec 2014 12:29:59 +0300 Subject: [PATCH 03/17] Use new official logo --- logo-leftp.png | Bin 2151 -> 5370 bytes logo.png | Bin 2091 -> 0 bytes logo.svg | 1 + 3 files changed, 1 insertion(+) delete mode 100644 logo.png create mode 100644 logo.svg diff --git a/logo-leftp.png b/logo-leftp.png index 4a05f8ef01428902f623e763330ad9a823a8435e..3e9df9aa81e48f146c33d6c06d4cbc8b1e85d8b7 100644 GIT binary patch literal 5370 zcmV^0008?P)t-s-8VJe zI5yomH{Cio-8(tmJ38JyJKjD#-akFwKtJ9=Ki)w=-$Fp&LqXp}Lf=J0-$q2=Mn&I9 zM&CNk`yGNZ?9H;7m&3OiSQROW{vU;ZIKCP)^}cPvKEe;ZsuKR8rwrRN_%j z;#5=ORa4?tRN_}w;#gPWT36#*SmRq*<6BzeTwCK_TjO3_<6m9lUtZ&4VdPv}=y-PMczEb~c<6k3=zo9ddwJ=7ed&ID z>3@Ccf`RFSf$4;V>4t^sfPU(Nfa-&T>V<;phllEkhU$!q>xYHwh=}Woi0g`p>yC`; zj*aV)kn53=?2C%*jg0J%j_i<+?30u1l#%R~mF$<6?UIu1m6Yw7nC+XI?VOwKo}BKM zmF}3A?wOeGnwjpLo9>{W?xCUXqM`4eo$sHX@1URWqM`4kqwl4q@1~{isi*LyqwuGt z@TaHnsj2X*tMIL@@u{ittEus=tMRR^@vpA&u&(j4u<^9A@wBw^uded2u=299^0c(_ zwzTrMw(_~S^R~A0xVZDXy7Rrf^S{6I!NByqy!5@i^uNCJzrXat!1Tkz^v1;X!ou~# z!}Y|(^~c5a$jJ4{$@R+0_07!o$H(@_$o9#}_RP%o&CT}E(Du^O_sYrl&dvAE&iBvH z_tDY!)6@6W)%Vxe_u1L_($M(S)A-fY_}13=*Vp*i*ZA1j_}SU`+uQiu-1*wt`P|$2 z-ro7&-}&L;`rqIB;omV3=KAO5`s(WY;oHF*J`|j@i>*@UL?ELTU{O|Al@bLWd^8NAg{qpkt^Yi`m^!@eq{r2_!`T70){QmXz z{`dF(`1t<%`2PC({`>p?{r&&`{{R2~`VNPs000reNkl#pi_r_){Cjn&=g=LHupa$Q{C6n)oS|GE?K z*AKi^NT+w?&Yqf?mX?;9F>2C_+1ZQM@BX3k*U?y4yl3tFiH{{lz#Y@=i6h3(%KN_V z7usk&{_%`Qe`AC%O!rRMSosTUytMJeXM>J}cbB@jJH_GvQNozWU_vy~1rG4SdH1+DO(Rkw}G`el! zb-HokHrV{0HrKjCW;#Ik4vsOyN&7vwLSs=k*tPknp6*D)VKYRc>}V8Z?Jm%R^0{r` zWbE}&H%jk@K@~Qwg6_?RO{+30@*oVA=t<4Wu5jqMFSLyp(_lC9Bt1B2g3Th@y$0be zdM0h?3x}ySA#B_p3sr1BJ*n;jn^cK*mir+yd_gT=-h)Oxe+XIQQX^EuFVdrFu(_j> z4wu?N7GFv&QeJo1MST{UM(Gu(!WUWT(bon5hFx@47zSC2L`{}8cfxLhB?OK28Blf7 zx>Z+oh0SC(wHU(h=|%l)$A6WpL2tZ~3RRyA)G!)0U255sbvR_k1N3Ht0jhr2gWM=R z1l6c&YFGptQxRR2wSoFE^=2jP(yhU5oD9|LR%+N~g3WX`_a%g<=+!LPEeUGldZ-pr z%b8f%4BJ3AUWTxmUQL54yeNo`g=Pq08>yvM+{n9KmFPxo56H~L^u{_Cs`h0;Yb=R_ z5V4(_#y~d1Lbnc^AnQ^^Z=_79`qu=hv7!qE^G<5|6tX+Z=)qeMo~2g}4?^{X6qLq> zArM-8O-(1FVDrcsdeYDr!a90&?JlTtg3>q%f@u#m)%JqTJ=f`3aX4h=WAy4&JXD*4 z(6|AL71TBsHqoc4gb;IG_r`PKJ}o$6zty&k zemc_Aau4;2E8w1%PZ7U8V#G* z>5cVL@y@&z?`2QQ$jHc?^h&l(OE|ku4f#;)q6~Up#`)A@9SWNP4Rq2_`BTBRPggDw z-k3Z-WB9)JRO z!YXR{DH1w~q^3M5KG3tVswHHwaLLl!|Nbu-QI$ULRg&0Z9vsckqEhjeQk>~#iO(_I~b zOoPlshcn606fvWMjT%f)Y@w#9P<*Uc<24g(qHE~c%K*mF=64X-Xiq$x^#0e~7b?&F zRJ4ETlP1{3e<;x|5{lR|YFQ1%RJ|JWAsa)_zG$2@j)Y*LYM~K!akI)A)_+dBbFW9j z?vd+MMME`$TE2#2uwIQ5AlpZeuG|hppQP-*ru)qquuEK1M;GTt!LE-zvNh~hQ^OG` zV)Sb43Y!iRJ(1EKlk+Z3_M7vd8n&12?Ck*6;2H|;VHZ_G&rU&Au217x$R=q|SaPVi z!+Bj@0Y!)D^q_JSR1aAwyBjL)Q&`fSP<*RT<5tMF(vzBaAWfno0kRg9Z8ky}{Y)`E z+Il+_*^~{0!!qyB$yl#X;{w>2DzxtY-L6p4V1_J#HeZE7NI63-mCr&j7Sbja4lT>* z(Sh3_%+{yz6?Kd6-i=+6h&x499faSKJRAjKa235+Zh)*utxF@Gre_aAcvYW9@qM04 z57zWUaPJu9=K2g6TNfHM`c+Kmw zvl7BkeHv4g`;c3Emvq?Y=H8sK&j8tIiM}}$roPn~0-+?++p@C`Lb5)MX|SoLTNN2U z(%Bxhu@huZSm>+Sko9FMgtO&sA>7|U_dbKrS)axc>J87GZ@ys@pFl7vf1ah!syje- zG`D~b7A*-Y+3unVuE zKhzyk2gh^EKBLA=Afp!)HJ}bY0I+DdmG`GWaT(OX z4j`d|F24THi8t8Xmm{DGucm+AYBndA`ao!Nfz4DvbsE&cwHA?I(bbuLORuoG-KkKe z(N729(7NgQq{rBdwF?v{Ks_Y9NLNzcYk73zaO0V_>-5tJI3&27Puk#a9aa>BdPx5h zUFEM@Pj`+y2}S%-`sq(_xYOmtN9+Z<*g77HBcL7@OFU6eXWys&N0s}=G$_JLZ)%9E zO1S89J}HAPvY>BcUOBT$>EzE*nRIV&KPU##Uzu<)6uOqLXHz*)odWf6sq|n*F&#?G zspWL<(B0aDZVicWxN8Shmc9^Lm9mM7SSZRtJv6KyJ?sD-7Imug^2F2EyqEq8gTw#( zZ`vI(K^P{niHD%DfO@DO+3~Kebf_z#CyNpwn^#4DS>Pne%>w#1n@CWvFF{?r0>di$ zBr6HB1@v1Pob;zd-CYn&hv}qFz3e^oYMcm+rB9ZoK(>&6%ZHO*bW&)9@SE#&I1I%w zy&AUy9q5zoLm^vCzoo-T#6dcF&CQr@I~19EHJ(+69o`i@rH*0zRc3;dZgf`jTPVI@ zqde#}dsIoS)kjsYPRxdEIsG*ko*Q|<(Ck?0Iw+PA)W=K=ETB(vAzMU$y{*;A*P1=A zErntmL7gOq-=I&jA$!l_|I+QOMG2dz?FPYg)b)E(tY71-k-79qDr9pT{!YKt#lqRW z1#GIo2w||5idj%p>DRdDqt_++K#GEFIyc_j599TLFybGco}fRatfKaD2yxV}@#0@9 z_tFQKAmrrF{orN>9Rue=NLWV~lKK^`FVg0Cmb%mq(6N#Gm_r|2RvTxxGaaGt4neVF ze)B~~burHAoIt|}D8}j8_`j^B53Z<sjXoOwKgbxd! zhoUQWZ7j^^26|N<0a+^fV-#?NzW54?@lJogdlTLG9D@1Vjp}urq&5cE-ylmCyJq9c z!}PAa1BABaB)@|q^(5VS4MM-SjS%*Rr19^Nb)?Ob*6r`vL2oJtLNM;7&1ndU#dNFg zUI;B9BuJrXJeu#A<=12Z;rprWQ0FFZ#T$(3tiywoQE)Pmp=f+#3WQqPT)Y!7uaoGR zv^X4!=~T3XY=DIxtc8=mhNN-&1PJFT`|CIW$-6vX#QsptrfLvmLsn{@q*1lEhNLm) zIS4;cXc!2ad)GJ6jpNT7p=k3Z?H-5h|9?(Ts(Qd~3PaNP`WOfYsVM9TS-ZE(*u>eq zsXbuV>x}D+Ka-vvYXQ}Fp=q2p7Q!xjOO6qW&Z*quHE z|9Rr;jk&6K7uY31@jz%A?}K7DogIDJ1h>ptyLWEgyn5AwH?t>C8lCY-TC#H04aTS# zGrZau+{Wrko3ekjg<>a#s>;eMB_$=tinjDe0JOWTdt+(g^2wR^C)srE6w?xbF~%ke zZbZezL?iH0b#DB40D>zfp?m+d$0tl*xF&z6tf1(Jl9KN;p)z+I^u%&W*T(9^Fa&@h zrhVt6VIxOR$bNg}C!06_(biH}bfV;PrG;*tN`_)PRiJLJSM8g%YR<^^__-nzx+SNj z|8BF-VEVk+JU;OIFi3?UiM4lGDfDQ*gl!bX|e~B9PUpWo{{nNq)9Vo zE?Bj8^H)1}9xN*Qv83d@ZB3H+b8Wr{g7Ih|8$;^y7${!gueR|`D9q;r+gNvip^|5U zBAbD2EX~=#(2$;jqRrI+H*#_GDTc&qs6J$%8>OV=I);EW35xCw0dM3X({l`g112c` z%s@Amtzi~cGwA9%Ly^vaH}bO?7dnOSXRytMBC<3HjrCnJ_Mp`_46ZK>P%LB+8u=j} zz7vKQs~JScT0t>H3QD8&1Y{#?88m;3gQs7L3I;^&W03Vc!XVia0Y%t82EI`>46?ZG z42pFIsMa!Qjn;y;kPVU;1nUh@&1CQzx$6%QhW;3Yt7wF3oHdw@%z`3(PAvn23y1s8Q41IZ-*!Nw=gah1$`avZ zY&}EY$nuBKDEjU9{%+;ZQJx8B@6!t~D69)3;Uw`(-ZW{;ZEzC)(dVIWRGrU+v$WH^ zDJQa<6!!d=f2UVq&>TpD6Z7<|^w*8m1L5qBwf~hb-BOK|*0qI`m z=`%3czUqZ$3`sA%we6V8FIK;H?91g@PbIfNGsaQJ=?5_AtlRp)1M`5FKggB6`SgHz zxMgfNa>WJu1q_Ano{PdwX_Yl*Km7%UM(wsS?clHOAKc(g07K_Q?hCz)@Llh}@uq;G zRrST#ICv4$BQ_-h<{|6(%WG6g1&cB}!=2XsM^1ZX%+TKE$4|a@pq~7tHmWLiu9}xI z>4irJBqiO}qD|MXu@5{mZSr%AXFfS_$!8^X{8_+Tj%8+_u3d+{nvpSP=B6vu0r>0p Yf7@d~0Y!zEv;Y7A07*qoM6N<$f)r5uR{#J2 delta 2139 zcmV-h2&DJ=Dd!N7BYyxDP)t-s-8VJhOG)W}e(V!h4M{{n zRCodHo$qerI1I!!!y(`Qkq=07+$d|CaM3;hq0m3P?55` z2f52IyVKs1QTut7k!t_{kIGqs-j9(-Ddor*Ri@;o3`JUA$LKgL8ceWE%$21_@5HDh z!bG$P&#<+X34i1JFj`Ugv(Pv_CqyfO55Jr-EjqAiid4h=bN!XNo^eLB11~ES5$+kS zSo>1Dp3!mW#3W*fPt>*+|Gb*fQB62DoQ8!s)H>w&CPet5sp0;&Z?XQ}*D+RAK4}!3 zoMuZNVh!2Pn22`#2@6B4M{CL|$bLqa1>Wv4saz>eM1N}y+0V#g{3Hp7cC6LXsLh=Ges}M6%J=3+0)|VhhGve@~B*AG%-@xUOtcS5)p;Z~@)NxhTGNith z(W|*l1`FfyJYl_l7mPg%BTLI7%nRGO42cfLddwo4Z6zACd^}|xj73Q;T`gPrB45r8 zH855KR)0$)Y$fKoKCR!xn1NHy1IV@MvgPz(H{(2|^*k6?P50%Q_3vQJNG<2Vd^ypu zydtBUu?U(}TC;4rmgC3T8GS577pG7B>u7CfWKkvRrLlqlXct8yOlY zjPue;Iq*Klx(1rO#;6&q+_gSND=Q9(2FBtl(C7%&F2wcA%IaeD%8j;7h%?~6RN2|Z zXoVZa$4W!eB>9X!i>8Q>q)g*QBf1!I=*H~c(3~UIQ>Wv4VVL9JZ1)4UF0xJ%1%} z-j3pgSVHQNacDUq8yJ1ZPKD=?vwU$UGil3cwKhiE9UJN1iSgtXDwA<-qhT~Kaxd^S z|MSeqlP%1Nsxl$f#Aur%BEq@NsMAf%d01S{iZwC%mK)&_++jT3#%x)%sy|>4BY!sC z=n=-)WW?!4W-aWYdnY5e##4mg+l(G(Ayu8I<`C#%v<*g&r(Ut5Iu_BYmCYyd+jEZ$(VyvQ7O^o8XxP#&q#($y-tJjYn5yoXkMv$?rzvJ5u9LWyGyU@>A>{0bI z4m-nWuhyKhwze{AnGqqq(AJE)8={kOH6M}2daR0DjKRISgFZ$#JH?3ecf)Y=%+fbM z?j4MhH~DcSW8EZ|Lqreby1j@KvPVXG*+??pgYneBcx1G)S=JlQA5%??8h?+BUiKg= zeS0yZ$Fj!6ShoaQCnHZ-taI5|tc4RjbASd$|EKM5PvMw`Yj3w;9>H7heb5O;nXg@5 z1@9o_PPRUm)ka3bR~RiV)LIYT9^<@#BsAI>6`{g0oI~q)sdQ!{;{I3A-ZUtgTNx3h z_@}OlH;cG(mr*jZYGP-4wSR|kM4ah_f^N3cO2lNW?i>%Q)ctZvik>0L=F z=uwKZ4a(&Yw7;L>2|Z4YS7*_RoR}6yBXxRLz36GoC3V; z?My~->A`1c>tFR)(*OPu{E!kPsoDEtedylTziO}(r@Y3eLn7k_qX&`sSujowJl^C- zdwCnrb(0Y$5*VrH0u-i|6BNY6*eWRt<&$vNI3)xXE{~Ap5=mnUbEq~mD&297qLI;) z?NXtWF|Oz9k5%V|WPkm2H7WajIae-z3B@r$L&+h&v}qDZ>Lw#o*c6{+y6Iqtnk2oO zah6L)$=kaG z^vjd6pK<6r5iKrY^zj{#%6jwdjMQy-yBe{R(c$yXTQ4H~0)NIZzCran2LO}_aXuGe;cR6;sVAhvh**V2*m}A)yxCze=A5kV?Fui@w&v? ziI*{Eiwa2E>wn)-JMl8cY0o88Qx+Tk{_gL%q`Ofk0qyw_SMn#U@KdI>Ol1Yy_v zv7+SS8-Zomcj2y@_l+R#H`3=<*?h_ePzl^_(zl>le RgYN(U002ovPDHLkV1j_;KurJu diff --git a/logo.png b/logo.png deleted file mode 100644 index 082071a495ac78b7602e881955f6601507456d38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2091 zcmV+`2-Nq9P)005u}0{{R3yb+fl0000LP)t-s-8VJh zOG)W}e(V!g(Md!>RCodHoNICA%dgASP4xRsd!*t4M>bb!Cwd%7~heBF9BqQhdE~^;pu?1rENghPkxi$UqH>D3P{^IF2?^9^EG~V z5#m{ZVf)a>AKE|vRymJH0M@Airu6CHz!qROq(2^z`&g2L{qKKRPSN;aKwO1Um|RPR z;ZkmMACCeIyTB8D+yrB1mEywyd5M=$T!p;to!R0+fL^Q-%8Wp0HtfWUMIW&4P95$Y z>^A>gcga3rgU>JQ%VcIo$jR30)c+AM?9zO~K@xY!-U}Q26JS_1Ra=p}&1wnTXaCTtFHmC^;K=Ju?3s1M~J6ZA`;V5Uw>k%xeMWuFfpRfW% zaj`HmjGLj+ChP+C`P9S%*oFtYgg6ECicby>h3Ju!`-J22y2$GsvVdQWj5eX408;r; z^&H^!8o)Lo`+!l+N&udY>wAUuH^Y5EQ(RQtW_lC@qfKaCKs0inrG@1Owm0nF1FRER zMrLcv5+&hf7>>I2b_pyF3asm7*`xy~dzVu-pl2CxhaqY}O{O-DqdRVtgr=4ipd4I! z#G@TtRswS0a1Xz|}D02vK z<^#7S8%}`M3POAZw5t>enKv~|Mo|Em3G4dJ+E4<#^ss3l3Xs*1VIpi7M-*xsK-

z!*8=OV@`uhLWM@@Wch^?pni|-qzKH*g%uu~32y<1AFYI=eA3{5`H1<@3KL&R$Xmd{ zgCLv%V>1Xd)P7bpE2Tm$o$PBs-(F}k>t}LrAzyi>g28>L{+QpU~`D}7j(Ggof ztQs?u7Hh!BQ$ki7PYq!UKwkhx-j%wFTr8Z-&XJex05=AK=Nd520b7UHP}3REa;?ZU zAhN3&P)@c(z@Eo!=MN`fZ=`wXvaxBu-qxevUz*~B;!dI90IHhbQ&TTfc?QN59GIi zh_b9O9soE_muZoBS)7jh{h;(DK#p6$xGr9*J^m3e`ha5stn25#1;oK{Jd40$&707n z0qz0gVWqc)7d0w3ha;O+Mu3v@0FWNN$6~`L1+aYl9(jve5<)`-~F zfXrmHZd=rJt@9-hPy4*exSIn7ya%-QeKkHexqcOnVd4`Y_E8$kLd2q~(>|g#ehdsR z`2={C=e9k-lsuUSg$$05-pxEJzPwtT6bRcRV2R#b2a|hHiXYjAzlr`SYE2=FmQ?vRC=m4{p3$Rh| z^m!f`EY?exuNMVv?{7{p#YI_;6(Didt7PkXab!z>Eklb-L<0cMb|g#ODJBcRsgM#Y3pV&RCw0LOIm`)|4e35((%ISeSoh{ZDlPA1pBhK91Tz?! zB!dLtkWB5o0;CM_9_0=&-U=q!7BJroSGzdyMyw)>g=nu~P^u|Ks)c&a5!fFs`!fLi zkVAqkg*!Pvba8eI0CBKK4bnkIK3P$JhV{MDHD3W3gCcwvU-N}Hcsw6^d^KRC z>m==Q3e@@A1vEk(JxXCUp8!h@=p|*34nI8dtx;x(N4mF}eB;O=e5Cn$y^WJOo1qW# zoYz{_)Aq>ki#Ri1A5hf>1K{7qv+sO-^Z3yf$r`aZgpQ}aAQ2G`9@6>!*PIyVfbB?x z8+b}L7Z=SRZ@~!>&6k(bZSnFwN91z=Gkh-AIJYeseo-8IBw+C^R5LguBgqJo#JX4@ zuRa^_dx!1dYhPB(14e~wc?jt@BjGt-x& zr>JG}U9TK>H-l4!Sy?w!^?v(1(f?r4oiuX?hH2mP0|2G?;0%x7*WSNQzkt7h{{h33 V&YA4`!Xf|w002ovPDHLkV1lDu&1?Vw diff --git a/logo.svg b/logo.svg new file mode 100644 index 000000000..9675cde21 --- /dev/null +++ b/logo.svg @@ -0,0 +1 @@ + From fe15e09660e6f27cbad9e9471c85659c00ee7146 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Mon, 6 Apr 2015 01:46:41 +0300 Subject: [PATCH 04/17] Compress logo --- logo.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logo.svg b/logo.svg index 9675cde21..3a74c5561 100644 --- a/logo.svg +++ b/logo.svg @@ -1 +1 @@ - + \ No newline at end of file From 89f8d73debf00f03837cc33bd6d3ffc2ee8f7714 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Tue, 12 Jan 2016 14:51:48 +0300 Subject: [PATCH 05/17] Update logo to new color --- logo-leftp.png | Bin 5370 -> 7627 bytes logo.svg | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/logo-leftp.png b/logo-leftp.png index 3e9df9aa81e48f146c33d6c06d4cbc8b1e85d8b7..09ba43b0cd7af4328b9ad942f8f8e6c888f09e82 100644 GIT binary patch literal 7627 zcmV;+9W>&JP)IL5*e!u%zycv5 z7Q_Nk0D-U-VIm16WErHOg##l%SXc&WG#bs)Gd(>^PtQJ+{Cr+c(W-arb#-;U>QeQ4 z=N*oi>8Yx&`s%&AeD}M*_P=hpaU=|f)bx&tzWng+9Rts;EUZ}6edoXD=FL2G@hPq6 z9mi~+^HpZ&_1|LV=AGMp>m}XHyXNxA{C2h>(tnYLuyRJjme3z)^|!f zHubN2ym!TI`NdasTyyrJ^N(*nI2-D5;wJzwm*MtIrwO@Z{uRe}f{`jghx@=9kPpaN0*LAk4-> z`##>K;-()@jSM-YHpCeH<(obC-k5^rGqP#>!LFPCb#UuCAe%v?x-m6e>VM|p)^B|> zB1De=tplfi1k1JUveR<&&&%I+b>GS*#phP`K7F_0uZRhB-*H*zwf{^gpmpY_ezkrd ze^iX-Z2M)W4y=D-a&$NgNOfbPx2xyA>zhycP*oskyW|x7D!l&D<~$#sX z9H({0w8^2Oemx`m_6)uD5)rHXJ=bW6zDU&4uwWTZNbF1u#` ziN6=-d4m?o`-)h)^#Y#n^5fM&&!WS7(p$K z*rWQn27k7umLM7~APIu-cqI%>ICipBOes>`z#RrL6>UD!o~3Qi0fNXUVvjz|9=+fM zFR?V%wqMU+HJ|kRTZdjE@q`IZ_;MvERA08Y1@EhA} zJP|R3@?(O_v5o`fAK*36-xk)|Se$eYLTdNWtj~tTD_?n{yFD#Pb!I91IDsU?10zmE zBsG?BERlhVJA2`gh59w*Zn-$#HLn4kgg62YuGBh?MOhql=#8=ey}purcPjpbZK zf)1W@bos$ymIT?CEN1$}upGww^)V{C7kyW~Jmv|vhG0m2km?2wG7E+wX%5jYMv_O@ zZI}AiD#Np%DE76S^>_YDI`RD@`+jaC9!K=IVxXY;D}P#i>Aw?2svF?1>xY*Zo(iG+ zc!M=$0eq)msjh4)Xwlq*=Nx0nE1xP2LLJ0=GvgJvjJuZ*QXPxA?V>LPK8(-(cHxOT zYjEx51@gex|NO8_>D^a{TJ<+PC8Psxm}&Lqknb?t1Ff@;8*6WNNVPjgoA(;{B?qVf z{m9-oVm~RQki*lY$A({)$o>lk>$Cr1^)3-7rqICPWj3Gu2ka6KskX-O+f4>*jHHeY zh7q=%FRl(VU;JcvdH`0zXv^LN-fCjK2HMTQvyV8WT7c>6TZ4=+f;EN57TY)}u~Of= z0Uaa)V(_K>35c1WPJq%+{I%nXuX`sI!x3>J)eZJ^s*c2a&H99MV~HyWo_zVOXcln) zng<2vh8(Q@fu{xe#*lg)e&gkMkm|;GcV`eep9POJqlI${SyRGZW3BH-#mkf!VIAD| zd@??$fjIzg5Kc_3NOgmhdfV)iWR}U9e>K|jOH1b^fN;1~cNB4cxG9kj2wm&ISN}|p zaq=D}a2xTlxLt-E9;v>Xkm^R)!r8K$|1bYwFQbiL3?Z=mbRHArNTAv2Ue^gVr#Lu!;! zeDN8PfpO@<6WN9Bv9Kw(_xT(YPQ`ZoQc-91vwl;rl2}o0P+ow`K<>aHwYq^M4v`&^ zU23&v2#UTh{za4?_{K?t+OcZm(O_jzF%|$;Zt^Dx&pD)qD#<{qNxy?Q&Wf{aY2csvg8URf+Y88(_|?B7 zMBAi7DpSx~1M9yR&2dPrJkTl=E1NN}tkSWuE6UG^I6%+6%Xp%ePDmJ7&&%@@Ar5aZ zBcSpc(qwyaNHqv|Q%NC3)0B*ZOYAAA@n&eTf zt})}??O4FREttrELVL)bSH(S~fAs_Ww(g+-q>LR>{ewuJc(Vq#uC;2OQXSxr!$ZVQ za8S-K+vU`;BsB^TEeN8q9wv$4kV?WyO!T2jlCXJ7x5F2{Jeg5NWR-k*l^^wOTOf*6C{6I-)dVi7eJ*U zArbrMmla~XiGXIKBNe?|sl?|ftNuj)kM8xI5oG}RqbaZf2#F+l85pKwX#gv3<02K? zNDQFj4%<5^B4@rbd{kJXdr|h&@v^3nO}j{}SA(zExJX6iRKFu&*P_omHPwFc$v*CB z9nDjrkX6#PZ2s~e3$$@-gJ`a}tODXjL@Ie_y;_4wQyZK6{{6BPN}76RU^MHug@vC& zoy15&Eoc3$WUXG;h)C^y><;~2P@is(6oPOFzO76eO4Gn-4xl)F*Z#@nGBQsHmLNc5 zAr&?>JDPqkXhv#ponYVhv8B@3-boR=&i|YUR(LbmDx{aa33M!xSL6zoH4n*1ZKws6 zG>N@4QY56w?(Iq7n}Q??XeqAL-LwpTS_hlJGf z&E5JPOII%HuRs)RAf&RO!dccMQ^Y}R?fWh70L=(#1?o~*w_tE1G=$hRdgS~eb%?xa z-UNAIi&`r{1MKKoMWq)DHm)HpB5e0kL-)$kP2;5!&p7h)R|KRsPQ@urKkRL$dJ!Lx zDxV$SJCouN5JuZ`BJhZ`5fe}yep5bC9kgfGn^*CSBb7jm?(*a4km9$xHe_`Yg0=Us z(0&v77-ZBkk5pMw6!yC{y}LbX3(o39-8bP%Ar;!oK2q6d^?qL{;n*tPr_D$i+fs20 zvox(13F35$C&dNKI8sSI!4Xc(du6>TXYvp2+=L~1WC0Pi2zJ|~JSrijCl*@q&a(<+ z8L7C>`qyTIwz3|)b6BzmT}XZ?G+Ie~a#gsGyfy@nA#kY)8$nGkT#7+ouF@0K05&&| z(4NJC*1LFK+6-kGsrkiM`o1uV{gy~{Xq@W{53aqa&dj=n2oIqpD2N0Bhz6i=O$Lkb z6AN?i%B2LSikp4}EaJi|S5n;cV+@p9l19w7OTTROkrC<_&r3l|mXS*55Z@Q3yRL1K z64p^~tD^HxG>yBl=C|pmAN%@BIIM5=a^9;jHaG8{_?i*mw5qWjC}f#cq!K^ZgHtv{ zrb@5A=oJwlP+HDHB1#$|nGR`2ZN8Q!%lY8u)s@Zer|%a3ocG^eT9^kUo|I&GR*@?3 z$-8d4AojCh;dvc-z$@lpdFr2^ROQcMEMfzMK^xj*)am#C@CGK=h_AiY6Db8Gx}ibe=8L{m19h0JAH3i;cK40KBs zSG@dk(qYBz8AK{U4d3^q6 ziyhTGqlNM^u}`ddf$y9@OFo|k9c?DU_Sr+Kz)BfzdMVyD8^7Kopin(0Zoc~MhHIz8 zC@4X|&z0dD%iwx=qk`I+k+Bp63M!e)pxHtKe3f`E)Dbg?RJ;wJ|3R&VjZS<9Mjy5F z6`MkFRqdCb9>iLL12t9EA{D9tGQzRfA&TdsnO3%t zIyL1BWa5U$r5J!+K?XsYP5iIn!&J?yvy1Nxo~-^`s91?Z*SN9OI0H^I#flgPG+IS1<_lzuuj`-fMIqG zW$}1wx%6M5|0));f_N3Di))B#H%KC91F3RJE`7XX(#E;J=iVDQT1anK3}F&=%FRDd z-*bg%R8m8a2Jj*gI~#p>w-7^}dlqS1-YYrY8Q*C6=F$2opo3)#sfDh?1>~p4)mxE6 zVFcHbYeB_Mj%C(wKsSN2qLa=mPyt)TN3nT+?0Yr+mjTrHCxuq;ijhX zLZKEVK(;EjFav`LLoiLH;o8XG-V2kRYX3(@EhA>EPq!_qii8n zwO+=1eSK@BcK`YO-AnV!@0%DHs8N_waaiRVmGli*-W8Dw!$#Emrs`Fy4Lq6*ezXN% z3@lK%k~O4KlSJfito=X)m=3I6+rMVb$evmSEU5nsQv1OXQ65`bh7bUjC;q;?3N~#C z>emy&m+gIODYBkoP%ncOe|%dnxmt}2ygI++&e4{Z+An|F=FHi_(1f?ROpJiprf^8Xc45N0ifs1a z4`Eq_FM^lt`%EGg9kM#wg;Xi|T2M2oUP|Y^g3KQVsg&GAsABgfHMe2@JgDms8G&pf zmHQ{pqq$XxXKad)|3a%!tbCVu(mE8@=15dJ+x^4DJHjv5^ zh+8QZv0!hQ3R6$}sF*>>a+e=fv`(Lcl;kG~;;{FnO&&p{gT&I2f~b~w9CMIc#5bl? zmXXR*$_olp9mpnM%q{BGpiGwh0v}#M!#rW#S8Kp@TywT~D5M60gEsG%1+X%VRMj4m zvQiBEx)*#hk)L2sR0T6B8R)_2*GbZ3{}(?f!0WkHlS8Fyi`sQ14kpC{*h2b;F$_dx z)6OO1NLBA{Y3tUh;Y5=|qJ|0zSqP+|8xWUNmL;t+UNdA-q}_kk$SU{UXU(aBZqHvOeL6MXM?k zkA|Lbxv2*IAgJ9OFIBdYs+6iI`a?l(wC+gdwegx&Q!89|rk}{KQ4+f2FRc(yMQyp&$T`r`u z(od+x9t_DyeekAer^A~R$tzw}CS8hxP6`1nqy4C4nomCkQgv*I#Z>B~c+mBh`XMc{ zR(8o>d`44-(u)43rlPZ8C4-e5jS6W65eBF=Y9yqNj&?6yGSOSGbpomLnAjKteJgrF zc|WPkzE9UY{ql$dcqj~Nj@5bNxwS;u5MR=dNx>OgKQLvPH@70nK2rPFK0C5^?^t{L z@b2BooRO%CxMKNI?EoVA@TwT&B$)?&q+%`<+D$FKAb(2}RI!OayHHSLLDG%3km?3x z6z;w#qN@spRS#c8^GH!r?-kQ&qw|#M*5cFE3Q?XK(O?xlCpxtv#4Z@AGe5;&SwyNE zv_Kad)p@S2(sg2up=&@ggg~M~7#?Da0bk8b{;sR_kHMde<)s?j_Pp2(RwN&C(<~y@ z4P>Tutp^^zujiAe2n1LGfz`w^BqqW=qM4{uMnow;S{JE9)o!uSnk!@q7fm&bNOgm7 z4`gcJO~+#}I9~8Fl~Qi(gMOA`1tOCMvy?`LEHWu>e9FUp&7!R%>Mb?T)(cMH!xoY1 z29o4Bvw}OK=@PTlQ6A_?I>M)s^$DYTFo>N8siP6#6dDHy_xS5s@`K4@F&3n%0IF&k zV3<@?+eNAyY^l2YOsY`)Fk)k*i^^HU$Q1A(Yg)9%$H+F}ju=W!4E3V?N+Ll&JXtEm zg;XWT5Ps`-NVP>y)$@n!cjAZft|+|p`4jvv>UKCE;VG>Eh+=ty2^7tlRVJ~RS#GP< zGEve!@eVH!!W3U@yGV6|k~h6J74^SB5A2oAIN;&~qsW$+Jb4;4St$-fMUc=VjYIZ*c{bP8o2{p%hN^A&UjKVAbHt{w?hLr;IZNOgk+NskUvv1Hz_N#Q8> z+|q=`g=A-B^*_}gKK4P-14gVYgXNHFyBi5Nnq^fW)P>-TV&LME$BR*H38H4_L5I(7LjSR5xeSb5%TGrP0Z)tedF(R; zVliIH7kCIm_tZleaKRv9Q^GzW7iy`1M=|_`EM0>jl{<@A2&@q}7Eqi}SilWuRmcGN zuwtos!uP^}@fJ3mB=V3D{74)CG6k=+wYMdwAIjf%zCR`b+fZryMq(?yD{f<5LFXF~ zQ{}9jUp6&}CageALZSRGAyR(j{gw&h)d!eVbnuh%snEkD@Pu2<1V(t-6cBSdYLalh z;bpRtkym65!!cKD7(pL)N#;sXw;ZlnUK z#EgR+Q(n$gAk_^w$Vefe5?G`aG#pZ~m;~068`c8PK@k|z3Ya$zsV0$?+`O6Ce+it+ z4K{c3TZYys4ymTWrbFMo1ZqUx2-^3FomGxbIHZ#QgnW(2Q1SxVNrD$+B|GNLGhsr*?VYSsIsshy=%Xw5tLhye3xTId2P&Xp4rb>-ES~qovRCx^V z-hpJekHbrePqZfIZs5+N8DkJf!5?r)joxexDxls8DFS8ANgaC4I7QL)@G%yLR9PWH zbzAjKSb0?)$8k`UDu+1fALL04IiyB+tq|iS0-&oofZ#CEX*cLH1$j5PlI$qeFQrzb zxX2%sqLpX>wZ#vAOu>p9^hFX#PZNYGQ$)xSJl%nX{5S=ut$&>FO%*$L<|rb z$vi4TzN$pBw@~sNSLBgK+Z^Of!FThn%#NU^?`g z@}JU#R5xhWuPfmPxm?{#uR7u+1tyFASTZ5?Vkti9U;C5sLLsF{bxdKp(xcoP;#pFO z@gcf@(>*8sUy4Tj$RJA{R)vX!)pO_f<)ocMYT6WRXzvtq?V(=}qSz@7Zsb~N-a-yp zx^g*DhbCcZ%a)P1IS9Q z=q!Ykug7elyBh5)h>%lOkUZ-J;yomB^r?-PD!_DT`_}Q!PKVSZK8yvu&A@*%q{wLj zMV1`NJ9}&rY*54vkT^i3ysFE?&PHl(tod#4Xjwq28+iK2E=O+IhnfqhrLeQOVHJ5V zlpRzr)9__XK#D?emQ4J2+#~E`MJ0(aQRl;c#T-`$&n8kG2R^^}3fYN{)Fgs>FAOu0|mS2HLp&?16$)R!!F2o)c%o2yxtgf$U*{R(&{gc8`(xLQJ5xz-- zAk_`pOVIj)N~3hPZGqXy+WcM;*df&o@~gNtL}6*StlH?;eG+1;AQ9z|>M9G!1t8v} zI)~ey$ZsJG4SCdyPVjGFihx`d7wwShdRHz*c%QghZCCA(>ekvluhLS#uzWt)rKK2N4vQb)Q=N!Odt&c0;X2V` zl*tc~)c}+|58R9{DWRpopRM6<`8j_}ze$2tM6Z(O$~dIDK?xU@F1ap@T}ZKTyQu3@ tEd_~K6;>>w8ztI1Nz1`Hq`Kk8{{h26^{>_^7W4oB002ovPDHLkV1gxck9Pn7 literal 5370 zcmV^0008?P)t-s-8VJe zI5yomH{Cio-8(tmJ38JyJKjD#-akFwKtJ9=Ki)w=-$Fp&LqXp}Lf=J0-$q2=Mn&I9 zM&CNk`yGNZ?9H;7m&3OiSQROW{vU;ZIKCP)^}cPvKEe;ZsuKR8rwrRN_%j z;#5=ORa4?tRN_}w;#gPWT36#*SmRq*<6BzeTwCK_TjO3_<6m9lUtZ&4VdPv}=y-PMczEb~c<6k3=zo9ddwJ=7ed&ID z>3@Ccf`RFSf$4;V>4t^sfPU(Nfa-&T>V<;phllEkhU$!q>xYHwh=}Woi0g`p>yC`; zj*aV)kn53=?2C%*jg0J%j_i<+?30u1l#%R~mF$<6?UIu1m6Yw7nC+XI?VOwKo}BKM zmF}3A?wOeGnwjpLo9>{W?xCUXqM`4eo$sHX@1URWqM`4kqwl4q@1~{isi*LyqwuGt z@TaHnsj2X*tMIL@@u{ittEus=tMRR^@vpA&u&(j4u<^9A@wBw^uded2u=299^0c(_ zwzTrMw(_~S^R~A0xVZDXy7Rrf^S{6I!NByqy!5@i^uNCJzrXat!1Tkz^v1;X!ou~# z!}Y|(^~c5a$jJ4{$@R+0_07!o$H(@_$o9#}_RP%o&CT}E(Du^O_sYrl&dvAE&iBvH z_tDY!)6@6W)%Vxe_u1L_($M(S)A-fY_}13=*Vp*i*ZA1j_}SU`+uQiu-1*wt`P|$2 z-ro7&-}&L;`rqIB;omV3=KAO5`s(WY;oHF*J`|j@i>*@UL?ELTU{O|Al@bLWd^8NAg{qpkt^Yi`m^!@eq{r2_!`T70){QmXz z{`dF(`1t<%`2PC({`>p?{r&&`{{R2~`VNPs000reNkl#pi_r_){Cjn&=g=LHupa$Q{C6n)oS|GE?K z*AKi^NT+w?&Yqf?mX?;9F>2C_+1ZQM@BX3k*U?y4yl3tFiH{{lz#Y@=i6h3(%KN_V z7usk&{_%`Qe`AC%O!rRMSosTUytMJeXM>J}cbB@jJH_GvQNozWU_vy~1rG4SdH1+DO(Rkw}G`el! zb-HokHrV{0HrKjCW;#Ik4vsOyN&7vwLSs=k*tPknp6*D)VKYRc>}V8Z?Jm%R^0{r` zWbE}&H%jk@K@~Qwg6_?RO{+30@*oVA=t<4Wu5jqMFSLyp(_lC9Bt1B2g3Th@y$0be zdM0h?3x}ySA#B_p3sr1BJ*n;jn^cK*mir+yd_gT=-h)Oxe+XIQQX^EuFVdrFu(_j> z4wu?N7GFv&QeJo1MST{UM(Gu(!WUWT(bon5hFx@47zSC2L`{}8cfxLhB?OK28Blf7 zx>Z+oh0SC(wHU(h=|%l)$A6WpL2tZ~3RRyA)G!)0U255sbvR_k1N3Ht0jhr2gWM=R z1l6c&YFGptQxRR2wSoFE^=2jP(yhU5oD9|LR%+N~g3WX`_a%g<=+!LPEeUGldZ-pr z%b8f%4BJ3AUWTxmUQL54yeNo`g=Pq08>yvM+{n9KmFPxo56H~L^u{_Cs`h0;Yb=R_ z5V4(_#y~d1Lbnc^AnQ^^Z=_79`qu=hv7!qE^G<5|6tX+Z=)qeMo~2g}4?^{X6qLq> zArM-8O-(1FVDrcsdeYDr!a90&?JlTtg3>q%f@u#m)%JqTJ=f`3aX4h=WAy4&JXD*4 z(6|AL71TBsHqoc4gb;IG_r`PKJ}o$6zty&k zemc_Aau4;2E8w1%PZ7U8V#G* z>5cVL@y@&z?`2QQ$jHc?^h&l(OE|ku4f#;)q6~Up#`)A@9SWNP4Rq2_`BTBRPggDw z-k3Z-WB9)JRO z!YXR{DH1w~q^3M5KG3tVswHHwaLLl!|Nbu-QI$ULRg&0Z9vsckqEhjeQk>~#iO(_I~b zOoPlshcn606fvWMjT%f)Y@w#9P<*Uc<24g(qHE~c%K*mF=64X-Xiq$x^#0e~7b?&F zRJ4ETlP1{3e<;x|5{lR|YFQ1%RJ|JWAsa)_zG$2@j)Y*LYM~K!akI)A)_+dBbFW9j z?vd+MMME`$TE2#2uwIQ5AlpZeuG|hppQP-*ru)qquuEK1M;GTt!LE-zvNh~hQ^OG` zV)Sb43Y!iRJ(1EKlk+Z3_M7vd8n&12?Ck*6;2H|;VHZ_G&rU&Au217x$R=q|SaPVi z!+Bj@0Y!)D^q_JSR1aAwyBjL)Q&`fSP<*RT<5tMF(vzBaAWfno0kRg9Z8ky}{Y)`E z+Il+_*^~{0!!qyB$yl#X;{w>2DzxtY-L6p4V1_J#HeZE7NI63-mCr&j7Sbja4lT>* z(Sh3_%+{yz6?Kd6-i=+6h&x499faSKJRAjKa235+Zh)*utxF@Gre_aAcvYW9@qM04 z57zWUaPJu9=K2g6TNfHM`c+Kmw zvl7BkeHv4g`;c3Emvq?Y=H8sK&j8tIiM}}$roPn~0-+?++p@C`Lb5)MX|SoLTNN2U z(%Bxhu@huZSm>+Sko9FMgtO&sA>7|U_dbKrS)axc>J87GZ@ys@pFl7vf1ah!syje- zG`D~b7A*-Y+3unVuE zKhzyk2gh^EKBLA=Afp!)HJ}bY0I+DdmG`GWaT(OX z4j`d|F24THi8t8Xmm{DGucm+AYBndA`ao!Nfz4DvbsE&cwHA?I(bbuLORuoG-KkKe z(N729(7NgQq{rBdwF?v{Ks_Y9NLNzcYk73zaO0V_>-5tJI3&27Puk#a9aa>BdPx5h zUFEM@Pj`+y2}S%-`sq(_xYOmtN9+Z<*g77HBcL7@OFU6eXWys&N0s}=G$_JLZ)%9E zO1S89J}HAPvY>BcUOBT$>EzE*nRIV&KPU##Uzu<)6uOqLXHz*)odWf6sq|n*F&#?G zspWL<(B0aDZVicWxN8Shmc9^Lm9mM7SSZRtJv6KyJ?sD-7Imug^2F2EyqEq8gTw#( zZ`vI(K^P{niHD%DfO@DO+3~Kebf_z#CyNpwn^#4DS>Pne%>w#1n@CWvFF{?r0>di$ zBr6HB1@v1Pob;zd-CYn&hv}qFz3e^oYMcm+rB9ZoK(>&6%ZHO*bW&)9@SE#&I1I%w zy&AUy9q5zoLm^vCzoo-T#6dcF&CQr@I~19EHJ(+69o`i@rH*0zRc3;dZgf`jTPVI@ zqde#}dsIoS)kjsYPRxdEIsG*ko*Q|<(Ck?0Iw+PA)W=K=ETB(vAzMU$y{*;A*P1=A zErntmL7gOq-=I&jA$!l_|I+QOMG2dz?FPYg)b)E(tY71-k-79qDr9pT{!YKt#lqRW z1#GIo2w||5idj%p>DRdDqt_++K#GEFIyc_j599TLFybGco}fRatfKaD2yxV}@#0@9 z_tFQKAmrrF{orN>9Rue=NLWV~lKK^`FVg0Cmb%mq(6N#Gm_r|2RvTxxGaaGt4neVF ze)B~~burHAoIt|}D8}j8_`j^B53Z<sjXoOwKgbxd! zhoUQWZ7j^^26|N<0a+^fV-#?NzW54?@lJogdlTLG9D@1Vjp}urq&5cE-ylmCyJq9c z!}PAa1BABaB)@|q^(5VS4MM-SjS%*Rr19^Nb)?Ob*6r`vL2oJtLNM;7&1ndU#dNFg zUI;B9BuJrXJeu#A<=12Z;rprWQ0FFZ#T$(3tiywoQE)Pmp=f+#3WQqPT)Y!7uaoGR zv^X4!=~T3XY=DIxtc8=mhNN-&1PJFT`|CIW$-6vX#QsptrfLvmLsn{@q*1lEhNLm) zIS4;cXc!2ad)GJ6jpNT7p=k3Z?H-5h|9?(Ts(Qd~3PaNP`WOfYsVM9TS-ZE(*u>eq zsXbuV>x}D+Ka-vvYXQ}Fp=q2p7Q!xjOO6qW&Z*quHE z|9Rr;jk&6K7uY31@jz%A?}K7DogIDJ1h>ptyLWEgyn5AwH?t>C8lCY-TC#H04aTS# zGrZau+{Wrko3ekjg<>a#s>;eMB_$=tinjDe0JOWTdt+(g^2wR^C)srE6w?xbF~%ke zZbZezL?iH0b#DB40D>zfp?m+d$0tl*xF&z6tf1(Jl9KN;p)z+I^u%&W*T(9^Fa&@h zrhVt6VIxOR$bNg}C!06_(biH}bfV;PrG;*tN`_)PRiJLJSM8g%YR<^^__-nzx+SNj z|8BF-VEVk+JU;OIFi3?UiM4lGDfDQ*gl!bX|e~B9PUpWo{{nNq)9Vo zE?Bj8^H)1}9xN*Qv83d@ZB3H+b8Wr{g7Ih|8$;^y7${!gueR|`D9q;r+gNvip^|5U zBAbD2EX~=#(2$;jqRrI+H*#_GDTc&qs6J$%8>OV=I);EW35xCw0dM3X({l`g112c` z%s@Amtzi~cGwA9%Ly^vaH}bO?7dnOSXRytMBC<3HjrCnJ_Mp`_46ZK>P%LB+8u=j} zz7vKQs~JScT0t>H3QD8&1Y{#?88m;3gQs7L3I;^&W03Vc!XVia0Y%t82EI`>46?ZG z42pFIsMa!Qjn;y;kPVU;1nUh@&1CQzx$6%QhW;3Yt7wF3oHdw@%z`3(PAvn23y1s8Q41IZ-*!Nw=gah1$`avZ zY&}EY$nuBKDEjU9{%+;ZQJx8B@6!t~D69)3;Uw`(-ZW{;ZEzC)(dVIWRGrU+v$WH^ zDJQa<6!!d=f2UVq&>TpD6Z7<|^w*8m1L5qBwf~hb-BOK|*0qI`m z=`%3czUqZ$3`sA%we6V8FIK;H?91g@PbIfNGsaQJ=?5_AtlRp)1M`5FKggB6`SgHz zxMgfNa>WJu1q_Ano{PdwX_Yl*Km7%UM(wsS?clHOAKc(g07K_Q?hCz)@Llh}@uq;G zRrST#ICv4$BQ_-h<{|6(%WG6g1&cB}!=2XsM^1ZX%+TKE$4|a@pq~7tHmWLiu9}xI z>4irJBqiO}qD|MXu@5{mZSr%AXFfS_$!8^X{8_+Tj%8+_u3d+{nvpSP=B6vu0r>0p Yf7@d~0Y!zEv;Y7A07*qoM6N<$f)r5uR{#J2 diff --git a/logo.svg b/logo.svg index 3a74c5561..d913c2a5e 100644 --- a/logo.svg +++ b/logo.svg @@ -1 +1 @@ - \ No newline at end of file +postcss-logo-symbol From 57052448b67ca10647a824d794626cfb37261ba0 Mon Sep 17 00:00:00 2001 From: Soul-wish Date: Thu, 21 Jan 2016 14:45:25 +0200 Subject: [PATCH 06/17] add new svg logo with left padding --- logo-leftp.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 logo-leftp.svg diff --git a/logo-leftp.svg b/logo-leftp.svg new file mode 100644 index 000000000..fc337468b --- /dev/null +++ b/logo-leftp.svg @@ -0,0 +1 @@ +PostCSS-logo From dec3b062c4e013639ebf5df9aa359cafe0179128 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 21 Jan 2016 16:03:13 +0300 Subject: [PATCH 07/17] Compress images --- logo-leftp.svg | 2 +- logo.svg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/logo-leftp.svg b/logo-leftp.svg index fc337468b..08df32374 100644 --- a/logo-leftp.svg +++ b/logo-leftp.svg @@ -1 +1 @@ -PostCSS-logo +PostCSS-logo \ No newline at end of file diff --git a/logo.svg b/logo.svg index d913c2a5e..4d146705e 100644 --- a/logo.svg +++ b/logo.svg @@ -1 +1 @@ -postcss-logo-symbol +postcss-logo-symbol \ No newline at end of file From 0c07228b8e5a139772a991448a7e561cf30bab36 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Tue, 28 Jun 2016 12:04:49 +0300 Subject: [PATCH 08/17] Add JSDoc while we waiting postcss.org/api --- AtRule.html | 3818 +++++++++++++ Comment.html | 3379 +++++++++++ CssSyntaxError.html | 1438 +++++ Declaration.html | 3567 ++++++++++++ Input.html | 868 +++ LazyResult.html | 1332 +++++ PreviousMap.html | 570 ++ Processor.html | 805 +++ Result.html | 1406 +++++ Root.html | 6840 ++++++++++++++++++++++ Rule.html | 6844 +++++++++++++++++++++++ Warning.html | 986 ++++ at-rule.es6.html | 172 + comment.es6.html | 116 + container.es6.html | 802 +++ css-syntax-error.es6.html | 271 + declaration.es6.html | 159 + global.html | 2907 ++++++++++ index.html | 64 + input.es6.html | 223 + lazy-result.es6.html | 418 ++ list.es6.html | 148 + list.html | 473 ++ node.es6.html | 633 +++ postcss.es6.html | 299 + postcss.html | 1778 ++++++ previous-map.es6.html | 202 + processor.es6.html | 257 + result.es6.html | 231 + root.es6.html | 159 + rule.es6.html | 159 + scripts/linenumber.js | 25 + scripts/prettify/Apache-License-2.0.txt | 202 + scripts/prettify/lang-css.js | 2 + scripts/prettify/prettify.js | 28 + styles/jsdoc.css | 645 +++ styles/prettify.css | 79 + vendor.es6.html | 110 + vendor.html | 470 ++ warning.es6.html | 163 + 40 files changed, 43048 insertions(+) create mode 100644 AtRule.html create mode 100644 Comment.html create mode 100644 CssSyntaxError.html create mode 100644 Declaration.html create mode 100644 Input.html create mode 100644 LazyResult.html create mode 100644 PreviousMap.html create mode 100644 Processor.html create mode 100644 Result.html create mode 100644 Root.html create mode 100644 Rule.html create mode 100644 Warning.html create mode 100644 at-rule.es6.html create mode 100644 comment.es6.html create mode 100644 container.es6.html create mode 100644 css-syntax-error.es6.html create mode 100644 declaration.es6.html create mode 100644 global.html create mode 100644 index.html create mode 100644 input.es6.html create mode 100644 lazy-result.es6.html create mode 100644 list.es6.html create mode 100644 list.html create mode 100644 node.es6.html create mode 100644 postcss.es6.html create mode 100644 postcss.html create mode 100644 previous-map.es6.html create mode 100644 processor.es6.html create mode 100644 result.es6.html create mode 100644 root.es6.html create mode 100644 rule.es6.html create mode 100644 scripts/linenumber.js create mode 100644 scripts/prettify/Apache-License-2.0.txt create mode 100644 scripts/prettify/lang-css.js create mode 100644 scripts/prettify/prettify.js create mode 100644 styles/jsdoc.css create mode 100644 styles/prettify.css create mode 100644 vendor.es6.html create mode 100644 vendor.html create mode 100644 warning.es6.html diff --git a/AtRule.html b/AtRule.html new file mode 100644 index 000000000..729ecffde --- /dev/null +++ b/AtRule.html @@ -0,0 +1,3818 @@ + + + + + AtRule - Documentation + + + + + + + + + + +

+ + + + + + +
+ +

AtRule

+ + + + + + + +
+ +
+ +

+ AtRule +

+ +

Represents an at-rule.

+

If it’s followed in the CSS by a {} block, this node will have +a nodes property representing its children.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new AtRule()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const root = postcss.parse('@charset "UTF-8"; @media print {}');
+
+const charset = root.first;
+charset.type  //=> 'atrule'
+charset.nodes //=> undefined
+
+const media = root.last;
+media.nodes   //=> []
+ + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

first :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s first child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.first == rules.nodes[0];
+ + + + + +

last :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s last child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.last == rule.nodes[rule.nodes.length - 1];
+ + + + + +

name :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the at-rule’s name immediately follows the @

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root  = postcss.parse('@media print {}');
+media.name //=> 'media'
+const media = root.first;
+ + + + + +

nodes :Array.<Node>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

an array containing the container’s children

+
+ + + +
Type:
+
    +
  • + +Array.<Node> + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a { color: black }');
+root.nodes.length           //=> 1
+root.nodes[0].selector      //=> 'a'
+root.nodes[0].nodes[0].prop //=> 'color'
+ + + + + +

params :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the at-rule’s parameters, the values + that follow the at-rule’s name but precede + any {} block

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root  = postcss.parse('@media print, screen {}');
+const media = root.first;
+media.params //=> 'print, screen'
+ + + + + +

raws :object

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Information to generate byte-to-byte equal + node string as it was in the origin input.

+

Every parser saves its own properties, +but the default CSS parser uses:

+
    +
  • before: the space symbols before the node. It also stores * +and _ symbols before the declaration (IE hack).
  • +
  • after: the space symbols after the last child of the node +to the end of the node.
  • +
  • between: the symbols between the property and value +for declarations, selector and { for rules, or last parameter +and { for at-rules.
  • +
  • semicolon: contains true if the last child has +an (optional) semicolon.
  • +
  • afterName: the space between the at-rule name and its parameters.
  • +
+

PostCSS cleans at-rule parameters from comments and extra spaces, +but it stores origin content in raws properties. +As such, if you don’t change a declaration’s value, +PostCSS will use the raw value with comments.

+
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('  @media\nprint {\n}')
+root.first.first.raws //=> { before: '  ',
+                      //     between: ' ',
+                      //     afterName: '\n',
+                      //     after: '\n' }
+ + + + + + + +

Methods

+ + + + + + +

append(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the start of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.append(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

each(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Iterates through the container’s immediate children, +calling callback for each child.

+

Returning false in the callback will break iteration.

+

This method only iterates through the container’s immediate children. +If you need to recursively iterate through all the container’s descendant +nodes, use Container#walk.

+

Unlike the for {}-cycle or Array#forEach this iterator is safe +if you are mutating the array of child nodes during iteration. +PostCSS will adjust the current index to match the mutations.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { color: black; z-index: 1 }');
+const rule = root.first;
+
+for ( let decl of rule.nodes ) {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Cycle will be infinite, because cloneBefore moves the current node
+    // to the next index
+}
+
+rule.each(decl => {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Will be executed only for color and z-index
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

every(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true +for all of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const noPrefixes = rule.every(i => i.prop[0] !== '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

index(child) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a child’s index within the Container#nodes array.

+
+ + + + + + + + + +
Example
+ +
rule.index( rule.nodes[2] ) //=> 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node + + + +

child of the current container.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

child index

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + +

insertAfter(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node after old node within the container.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

insertBefore(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node before old node within the container.

+
+ + + + + + + + + +
Example
+ +
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index.

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

prepend(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the end of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.prepend(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeAll() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes all children from the container +and cleans their parent properties.

+
+ + + + + + + + + +
Example
+ +
rule.removeAll();
+rule.nodes.length //=> 0
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeChild(child) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes node from the container and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
rule.nodes.length  //=> 5
+rule.removeChild(decl);
+rule.nodes.length  //=> 4
+decl.parent        //=> undefined
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node +| + +number + + + +

child or child’s index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceValues(pattern, opts, callback) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Passes all declaration values within the container that match pattern +through callback, replacing those values with the returned result +of callback.

+

This method is useful if you are using a custom unit or function +and need to iterate through all values.

+
+ + + + + + + + + +
Example
+ +
root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
+  return 15 * parseInt(string) + 'px';
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pattern + + +string +| + +RegExp + + + +

replace pattern

opts + + +object + + + +

options to speed up the search

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string + + + +

an array of property names

fast + + +string + + + +

string that’s used + to narrow down values and speed up + the regexp search

+ +
callback + + +function +| + +string + + + +

string to replace pattern + or callback that returns a new value. + The callback will receive + the same arguments as those passed + to a function parameter + of String#replace.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

some(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true for (at least) one +of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const hasPrefix = rule.every(i => i.prop[0] === '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

walk(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each node.

+

Like container.each(), this method is safe to use +if you are mutating arrays during iteration.

+

If you only need to iterate through the container’s immediate children, +use Container#each.

+
+ + + + + + + + + +
Example
+ +
root.walk(node => {
+  // Traverses all descendant nodes.
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkAtRules(nameopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each at-rule node.

+

If you pass a filter, iteration will only happen over at-rules +that have matching names.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkAtRules(rule => {
+  if ( isOld(rule.name) ) rule.remove();
+});
+
+let first = false;
+root.walkAtRules('charset', rule => {
+  if ( !first ) {
+    first = true;
+  } else {
+    rule.remove();
+  }
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter at-rules by name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkComments(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each comment node.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkComments(comment => {
+  comment.remove();
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkDecls(propopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each declaration node.

+

If you pass a filter, iteration will only happen over declarations +with matching properties.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkDecls(decl => {
+  checkPropertySupport(decl.prop);
+});
+
+root.walkDecls('border-radius', decl => {
+  decl.remove();
+});
+
+root.walkDecls(/^background/, decl => {
+  decl.value = takeFirstColorFromGradient(decl.value);
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter declarations by property name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkRules(selectoropt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each rule node.

+

If you pass a filter, iteration will only happen over rules +with matching selectors.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
const selectors = [];
+root.walkRules(rule => {
+  selectors.push(rule.selector);
+});
+console.log(`Your CSS uses ${selectors.length} selectors');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
selector + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter rules by selector

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Comment.html b/Comment.html new file mode 100644 index 000000000..58ec29254 --- /dev/null +++ b/Comment.html @@ -0,0 +1,3379 @@ + + + + + Comment - Documentation + + + + + + + + + + + + + + + + +
+ +

Comment

+ + + + + + + +
+ +
+ +

+ Comment +

+ +

Represents a comment between declarations or statements (rule and at-rules).

+

Comments inside selectors, at-rule parameters, or declaration values +will be stored in the raws properties explained above.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Comment()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

parent :Container

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the node’s parent node.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.nodes[0].parent == root;
+ + + + + +

raws :object

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Information to generate byte-to-byte equal + node string as it was in the origin input.

+

Every parser saves its own properties, +but the default CSS parser uses:

+
    +
  • before: the space symbols before the node.
  • +
  • left: the space symbols between /* and the comment’s text.
  • +
  • right: the space symbols between the comment’s text.
  • +
+
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + +

source :source

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the input source of the node

+

The property is used in source map generation.

+

If you create a node manually (e.g., with postcss.decl()), +that node will not have a source property and will be absent +from the source map. For this reason, the plugin developer should +consider cloning nodes to create new ones (in which case the new node’s +source will reference the original, cloned node) or setting +the source property manually.

+
// Bad
+const prefixed = postcss.decl({
+  prop: '-moz-' + decl.prop,
+  value: decl.value
+});
+
+// Good
+const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
if ( atrule.name == 'add-link' ) {
+  const rule = postcss.rule({ selector: 'a', source: atrule.source });
+  atrule.parent.insertBefore(atrule, rule);
+}
+
+ + + +
Type:
+ + + + + + +
Example
+ +
decl.source.input.from //=> '/home/ai/a.sass'
+decl.source.start      //=> { line: 10, column: 2 }
+decl.source.end        //=> { line: 10, column: 12 }
+ + + + + +

text :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the comment’s text

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + + + + +

type :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

String representing the node’s type. + Possible values are root, atrule, rule, + decl, or comment.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
+ + + + + + + +

Methods

+ + + + + + +

clone(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

+
+ + + + + + + + + +
Example
+ +
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

clone of the node

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneAfter(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +after the current node.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneBefore(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +before the current node.

+
+ + + + + + + + + +
Example
+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

error(message, optsopt) → {CssSyntaxError}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

+
+ + + + + + + + + +
Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

error description

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the error

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

error object to throw it

+
+ + + +
+
+ Type +
+
+ +CssSyntaxError + + +
+
+ + + + + + + + + +

moveAfter(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent after otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be after current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveBefore(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent before otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be before current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveTo(newParent) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it +at the end of newParent.

+

This will clean the before and after code Node#raws data +from the node and replace them with the indentation style of newParent. +It will also clean the between property +if newParent is in another Root.

+
+ + + + + + + + + +
Example
+ +
atrule.moveTo(atrule.root());
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
newParent + + +Container + + + +

container node where the current node + will be moved

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

next() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the next child of the node’s parent. +Returns undefined if the current node is the last child.

+
+ + + + + + + + + +
Example
+ +
if ( comment.text === 'delete next' ) {
+  const next = comment.next();
+  if ( next ) {
+    next.remove();
+  }
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

next node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

prev() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the previous child of the node’s parent. +Returns undefined if the current node is the first child.

+
+ + + + + + + + + +
Example
+ +
const annotation = decl.prev();
+if ( annotation.type == 'comment' ) {
+ readAnnotation(annotation.text);
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

previous node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

raw(prop, defaultTypeopt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Node#raws value. If the node is missing +the code style property (because the node was manually built or cloned), +PostCSS will try to autodetect the code style property by looking +at other nodes in the tree.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { background: white }');
+root.nodes[0].append({ prop: 'color', value: 'black' });
+root.nodes[0].nodes[1].raws.before   //=> undefined
+root.nodes[0].nodes[1].raw('before') //=> ' '
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string + + + + + + + + + +

name of code style property

defaultType + + +string + + + + + + <optional>
+ + + + + +

name of default value, it can be missed + if the value is the same as prop

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

code style value

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

remove() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its parent and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
if ( decl.prop.match(/^-webkit-/) ) {
+  decl.remove();
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

node to make calls chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceWith(…nodes) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts node(s) before the current node and removes the current node.

+
+ + + + + + + + + +
Example
+ +
if ( atrule.name == 'mixin' ) {
+  atrule.replaceWith(mixinRules[atrule.params]);
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nodes + + +Node + + + + + + + + + + <repeatable>
+ +

node(s) to replace current one

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

root() → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Finds the Root instance of the node’s tree.

+
+ + + + + + + + + +
Example
+ +
root.nodes[0].nodes[0].root() === root
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

root parent

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

toString(stringifieropt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CSS string representing the node.

+
+ + + + + + + + + +
Example
+ +
postcss.rule({ selector: 'a' }).toString() //=> "a {}"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
stringifier + + +stringifier +| + +syntax + + + + + + <optional>
+ + + + + +

a syntax to use + in string generation

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

CSS string of this node

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

warn(result, text, optsopt) → {Warning}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

This method is provided as a convenience wrapper for Result#warn.

+
+ + + + + + + + + +
Example
+ +
const plugin = postcss.plugin('postcss-deprecated', () => {
+  return (css, result) => {
+    css.walkDecls('bad', decl => {
+      decl.warn(result, 'Deprecated property bad');
+    });
+  };
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
result + + +Result + + + + + + + + + +

the Result instance + that will receive the warning

text + + +string + + + + + + + + + +

warning message

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this warning. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the warning

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the warning

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

created warning object

+
+ + + +
+
+ Type +
+
+ +Warning + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/CssSyntaxError.html b/CssSyntaxError.html new file mode 100644 index 000000000..621f7164a --- /dev/null +++ b/CssSyntaxError.html @@ -0,0 +1,1438 @@ + + + + + CssSyntaxError - Documentation + + + + + + + + + + + + + + + + +
+ +

CssSyntaxError

+ + + + + + + +
+ +
+ +

+ CssSyntaxError +

+ +

The CSS parser throws this error for broken CSS.

+

Custom parsers can throw this error for broken custom syntax using +the Node#error method.

+

PostCSS will use the input source map to detect the original error location. +If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS, +PostCSS will show the original position in the Sass file.

+

If you need the position in the PostCSS input +(e.g., to debug the previous compiler), use error.input.file.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new CssSyntaxError(message, lineopt, columnopt, sourceopt, fileopt, pluginopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Examples
+ +
// Catching and checking syntax error
+try {
+  postcss.parse('a{')
+} catch (error) {
+  if ( error.name === 'CssSyntaxError' ) {
+    error //=> CssSyntaxError
+  }
+}
+ +
// Raising error from plugin
+throw node.error('Unknown variable', { plugin: 'postcss-vars' });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

error message

line + + +number + + + + + + <optional>
+ + + + + +

source line of the error

column + + +number + + + + + + <optional>
+ + + + + +

source column of the error

source + + +string + + + + + + <optional>
+ + + + + +

source code of the broken file

file + + +string + + + + + + <optional>
+ + + + + +

absolute path to the broken file

plugin + + +string + + + + + + <optional>
+ + + + + +

PostCSS plugin name, if error came from plugin

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

column :number

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Source column of the error.

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Example
+ +
error.column       //=> 1
+error.input.column //=> 4
+ + + + + +

file :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Absolute path to the broken file.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
error.file       //=> 'a.sass'
+error.input.file //=> 'a.css'
+ + + + + +

input :Input

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Input object with PostCSS internal information + about input file. If input has source map + from previous tool, PostCSS will use origin + (for example, Sass) source. You can use this + object to get PostCSS input source.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
error.input.file //=> 'a.css'
+error.file       //=> 'a.sass'
+ + + + + +

line :number

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Source line of the error.

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Example
+ +
error.line       //=> 2
+error.input.line //=> 4
+ + + + + +

message :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Full error text in the GNU error format + with plugin, file, line and column.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
error.message //=> 'a.css:1:1: Unclosed block'
+ + + + + +

name :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Always equal to 'CssSyntaxError'. You should + always check error type + by error.name === 'CssSyntaxError' instead of + error instanceof CssSyntaxError, because + npm could have several PostCSS versions.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
if ( error.name === 'CssSyntaxError' ) {
+  error //=> CssSyntaxError
+}
+ + + + + +

plugin :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Plugin name, if error came from plugin.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
error.plugin //=> 'postcss-vars'
+ + + + + +

reason :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Error message.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
error.message //=> 'Unclosed block'
+ + + + + +

source :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Source code of the broken file.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
error.source       //=> 'a { b {} }'
+error.input.column //=> 'a b { }'
+ + + + + + + +

Methods

+ + + + + + +

showSourceCode(coloropt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a few lines of CSS source that caused the error.

+

If the CSS has an input source map without sourceContent, +this method will return an empty string.

+
+ + + + + + + + + +
Example
+ +
error.showSourceCode() //=> "a {
+                       //      bad
+                       //      ^
+                       //    }"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
color + + +boolean + + + + + + <optional>
+ + + + + +

whether arrow will be colored red by terminal + color codes. By default, PostCSS will detect + color support by process.stdout.isTTY + and process.env.NODE_DISABLE_COLORS.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

few lines of CSS source that caused the error

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

toString() → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns error position, message and source code of the broken part.

+
+ + + + + + + + + +
Example
+ +
error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
+                 //    a {
+                 //    ^"
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

error position, message and source code

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Declaration.html b/Declaration.html new file mode 100644 index 000000000..99820b158 --- /dev/null +++ b/Declaration.html @@ -0,0 +1,3567 @@ + + + + + Declaration - Documentation + + + + + + + + + + + + + + + + +
+ +

Declaration

+ + + + + + + +
+ +
+ +

+ Declaration +

+ +

Represents a CSS declaration.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Declaration()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const root = postcss.parse('a { color: black }');
+const decl = root.first.first;
+decl.type       //=> 'decl'
+decl.toString() //=> ' color: black'
+ + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

important :boolean

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

true if the declaration + has an !important annotation.

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a { color: black !important; color: red }');
+root.first.first.important //=> true
+root.first.last.important  //=> undefined
+ + + + + +

parent :Container

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the node’s parent node.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.nodes[0].parent == root;
+ + + + + +

prop :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the declaration’s property name

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a { color: black }');
+const decl = root.first.first;
+decl.prop //=> 'color'
+ + + + + +

raws :object

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Information to generate byte-to-byte equal + node string as it was in the origin input.

+

Every parser saves its own properties, +but the default CSS parser uses:

+
    +
  • before: the space symbols before the node. It also stores * +and _ symbols before the declaration (IE hack).
  • +
  • between: the symbols between the property and value +for declarations, selector and { for rules, or last parameter +and { for at-rules.
  • +
  • important: the content of the important statement, +if it is not just !important.
  • +
+

PostCSS cleans declaration from comments and extra spaces, +but it stores origin content in raws properties. +As such, if you don’t change a declaration’s value, +PostCSS will use the raw value with comments.

+
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a {\n  color:black\n}')
+root.first.first.raws //=> { before: '\n  ', between: ':' }
+ + + + + +

source :source

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the input source of the node

+

The property is used in source map generation.

+

If you create a node manually (e.g., with postcss.decl()), +that node will not have a source property and will be absent +from the source map. For this reason, the plugin developer should +consider cloning nodes to create new ones (in which case the new node’s +source will reference the original, cloned node) or setting +the source property manually.

+
// Bad
+const prefixed = postcss.decl({
+  prop: '-moz-' + decl.prop,
+  value: decl.value
+});
+
+// Good
+const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
if ( atrule.name == 'add-link' ) {
+  const rule = postcss.rule({ selector: 'a', source: atrule.source });
+  atrule.parent.insertBefore(atrule, rule);
+}
+
+ + + +
Type:
+ + + + + + +
Example
+ +
decl.source.input.from //=> '/home/ai/a.sass'
+decl.source.start      //=> { line: 10, column: 2 }
+decl.source.end        //=> { line: 10, column: 12 }
+ + + + + +

type :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

String representing the node’s type. + Possible values are root, atrule, rule, + decl, or comment.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
+ + + + + +

value :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the declaration’s value

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a { color: black }');
+const decl = root.first.first;
+decl.value //=> 'black'
+ + + + + + + +

Methods

+ + + + + + +

clone(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

+
+ + + + + + + + + +
Example
+ +
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

clone of the node

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneAfter(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +after the current node.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneBefore(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +before the current node.

+
+ + + + + + + + + +
Example
+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

error(message, optsopt) → {CssSyntaxError}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

+
+ + + + + + + + + +
Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

error description

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the error

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

error object to throw it

+
+ + + +
+
+ Type +
+
+ +CssSyntaxError + + +
+
+ + + + + + + + + +

moveAfter(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent after otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be after current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveBefore(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent before otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be before current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveTo(newParent) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it +at the end of newParent.

+

This will clean the before and after code Node#raws data +from the node and replace them with the indentation style of newParent. +It will also clean the between property +if newParent is in another Root.

+
+ + + + + + + + + +
Example
+ +
atrule.moveTo(atrule.root());
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
newParent + + +Container + + + +

container node where the current node + will be moved

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

next() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the next child of the node’s parent. +Returns undefined if the current node is the last child.

+
+ + + + + + + + + +
Example
+ +
if ( comment.text === 'delete next' ) {
+  const next = comment.next();
+  if ( next ) {
+    next.remove();
+  }
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

next node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

prev() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the previous child of the node’s parent. +Returns undefined if the current node is the first child.

+
+ + + + + + + + + +
Example
+ +
const annotation = decl.prev();
+if ( annotation.type == 'comment' ) {
+ readAnnotation(annotation.text);
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

previous node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

raw(prop, defaultTypeopt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Node#raws value. If the node is missing +the code style property (because the node was manually built or cloned), +PostCSS will try to autodetect the code style property by looking +at other nodes in the tree.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { background: white }');
+root.nodes[0].append({ prop: 'color', value: 'black' });
+root.nodes[0].nodes[1].raws.before   //=> undefined
+root.nodes[0].nodes[1].raw('before') //=> ' '
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string + + + + + + + + + +

name of code style property

defaultType + + +string + + + + + + <optional>
+ + + + + +

name of default value, it can be missed + if the value is the same as prop

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

code style value

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

remove() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its parent and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
if ( decl.prop.match(/^-webkit-/) ) {
+  decl.remove();
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

node to make calls chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceWith(…nodes) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts node(s) before the current node and removes the current node.

+
+ + + + + + + + + +
Example
+ +
if ( atrule.name == 'mixin' ) {
+  atrule.replaceWith(mixinRules[atrule.params]);
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nodes + + +Node + + + + + + + + + + <repeatable>
+ +

node(s) to replace current one

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

root() → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Finds the Root instance of the node’s tree.

+
+ + + + + + + + + +
Example
+ +
root.nodes[0].nodes[0].root() === root
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

root parent

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

toString(stringifieropt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CSS string representing the node.

+
+ + + + + + + + + +
Example
+ +
postcss.rule({ selector: 'a' }).toString() //=> "a {}"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
stringifier + + +stringifier +| + +syntax + + + + + + <optional>
+ + + + + +

a syntax to use + in string generation

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

CSS string of this node

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

warn(result, text, optsopt) → {Warning}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

This method is provided as a convenience wrapper for Result#warn.

+
+ + + + + + + + + +
Example
+ +
const plugin = postcss.plugin('postcss-deprecated', () => {
+  return (css, result) => {
+    css.walkDecls('bad', decl => {
+      decl.warn(result, 'Deprecated property bad');
+    });
+  };
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
result + + +Result + + + + + + + + + +

the Result instance + that will receive the warning

text + + +string + + + + + + + + + +

warning message

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this warning. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the warning

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the warning

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

created warning object

+
+ + + +
+
+ Type +
+
+ +Warning + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Input.html b/Input.html new file mode 100644 index 000000000..878869554 --- /dev/null +++ b/Input.html @@ -0,0 +1,868 @@ + + + + + Input - Documentation + + + + + + + + + + + + + + + + +
+ +

Input

+ + + + + + + +
+ +
+ +

+ Input +

+ +

Represents the source CSS.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Input(css, optsopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const root  = postcss.parse(css, { from: file });
+const input = root.source.input;
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
css + + +string + + + + + + + + + +

input CSS source

opts + + +object + + + + + + <optional>
+ + + + + +

Processor#process options

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

css :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

input CSS source

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const input = postcss.parse('a{}', { from: file }).input;
+input.css //=> "a{}";
+ + + + + +

file :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The absolute path to the CSS source file + defined with the from option.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse(css, { from: 'a.css' });
+root.source.input.file //=> '/home/ai/a.css'
+ + + + + +

from :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The CSS source identifier. Contains Input#file if the user +set the from option, or Input#id if they did not.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse(css, { from: 'a.css' });
+root.source.input.from //=> "/home/ai/a.css"
+
+const root = postcss.parse(css);
+root.source.input.from //=> "<input css 1>"
+ + + + + +

id :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The unique ID of the CSS source. It will be + created if from option is not provided + (because PostCSS does not know the file path).

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse(css);
+root.source.input.file //=> undefined
+root.source.input.id   //=> "<input css 1>"
+ + + + + +

map :PreviousMap

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The input source map passed from + a compilation step before PostCSS + (for example, from Sass compiler).

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.source.input.map.consumer().sources //=> ['a.sass']
+ + + + + + + +

Methods

+ + + + + + +

origin(line, column) → {filePosition}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Reads the input source map and returns a symbol position +in the input source (e.g., in a Sass file that was compiled +to CSS before being passed to PostCSS).

+
+ + + + + + + + + +
Example
+ +
root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
line + + +number + + + +

line in input CSS

column + + +number + + + +

column in input CSS

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

position in input source

+
+ + + +
+
+ Type +
+
+ +filePosition + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/LazyResult.html b/LazyResult.html new file mode 100644 index 000000000..c5e5590ad --- /dev/null +++ b/LazyResult.html @@ -0,0 +1,1332 @@ + + + + + LazyResult - Documentation + + + + + + + + + + + + + + + + +
+ +

LazyResult

+ + + + + + + +
+ +
+ +

+ LazyResult +

+ +

A Promise proxy for the result of PostCSS transformations.

+

A LazyResult instance is returned by Processor#process.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new LazyResult()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const lazy = postcss([cssnext]).process(css);
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

content :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+

An alias for the css property. Use it with syntaxes +that generate non-CSS output.

+

This property will only work with synchronous plugins. +If the processor contains any asynchronous plugins +it will throw an error. This is why this method is only +for debug purpose, you should always use LazyResult#then.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + + + + +

css :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+

Processes input CSS through synchronous plugins, converts Root +to a CSS string and returns Result#css.

+

This property will only work with synchronous plugins. +If the processor contains any asynchronous plugins +it will throw an error. This is why this method is only +for debug purpose, you should always use LazyResult#then.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + + + + +

map :SourceMapGenerator

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+

Processes input CSS through synchronous plugins +and returns Result#map.

+

This property will only work with synchronous plugins. +If the processor contains any asynchronous plugins +it will throw an error. This is why this method is only +for debug purpose, you should always use LazyResult#then.

+
+ + + +
Type:
+
    +
  • + +SourceMapGenerator + + +
  • +
+ + + + + + + + +

messages :Array.<Message>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+

Processes input CSS through synchronous plugins +and returns Result#messages.

+

This property will only work with synchronous plugins. If the processor +contains any asynchronous plugins it will throw an error.

+

This is why this method is only for debug purpose, +you should always use LazyResult#then.

+
+ + + +
Type:
+ + + + + + + + + +

opts :processOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Options from the Processor#process call.

+
+ + + +
Type:
+ + + + + + + + + +

processor :Processor

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Processor instance, which will be used +for CSS transformations.

+
+ + + +
Type:
+ + + + + + + + + +

root :Root

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + + + +
+

Processes input CSS through synchronous plugins +and returns Result#root.

+

This property will only work with synchronous plugins. If the processor +contains any asynchronous plugins it will throw an error.

+

This is why this method is only for debug purpose, +you should always use LazyResult#then.

+
+ + + +
Type:
+ + + + + + + + + + + +

Methods

+ + + + + + +

catch(onRejected) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Processes input CSS through synchronous and asynchronous plugins +and calls onRejected for each error thrown in any plugin.

+

It implements standard Promise API.

+
+ + + + + + + + + +
Example
+ +
postcss([cssnext]).process(css).then(result => {
+  console.log(result.css);
+}).catch(error => {
+  console.error(error);
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
onRejected + + +onRejected + + + +

callback will be execited on any error

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Promise API to make queue

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + +

then(onFulfilled, onRejected) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Processes input CSS through synchronous and asynchronous plugins +and calls onFulfilled with a Result instance. If a plugin throws +an error, the onRejected callback will be executed.

+

It implements standard Promise API.

+
+ + + + + + + + + +
Example
+ +
postcss([cssnext]).process(css).then(result => {
+  console.log(result.css);
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
onFulfilled + + +onFulfilled + + + +

callback will be executed + when all plugins will finish work

onRejected + + +onRejected + + + +

callback will be execited on any error

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Promise API to make queue

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + +

toString() → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Alias for the LazyResult#css property.

+
+ + + + + + + + + +
Example
+ +
lazy + '' === lazy.css;
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

output CSS

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

warnings() → {Array.<Warning>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Processes input CSS through synchronous plugins +and calls Result#warnings().

+
+ + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + +
+

warnings from plugins

+
+ + + +
+
+ Type +
+
+ +Array.<Warning> + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/PreviousMap.html b/PreviousMap.html new file mode 100644 index 000000000..01460cb2c --- /dev/null +++ b/PreviousMap.html @@ -0,0 +1,570 @@ + + + + + PreviousMap - Documentation + + + + + + + + + + + + + + + + +
+ +

PreviousMap

+ + + + + + + +
+ +
+ +

+ PreviousMap +

+ +

Source map information from input CSS. +For example, source map after Sass compiler.

+

This class will automatically find source map in input CSS or in file system +near input file (according from option).

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new PreviousMap(css, optsopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const root = postcss.parse(css, { from: 'a.sass.css' });
+root.input.map //=> PreviousMap
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
css + + +string + + + + + + + + + +

input CSS source

opts + + +processOptions + + + + + + <optional>
+ + + + + +

Processor#process options

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

inline :boolean

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Was source map inlined by data-uri to input CSS.

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + + + + + + +

Methods

+ + + + + + +

consumer() → {SourceMapGenerator}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Create a instance of SourceMapGenerator class +from the source-map library to work with source map information.

+

It is lazy method, so it will create object only on first call +and then it will use cache.

+
+ + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + +
+

object woth source map information

+
+ + + +
+
+ Type +
+
+ +SourceMapGenerator + + +
+
+ + + + + + + + + +

withContent() → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Does source map contains sourcesContent with input source text.

+
+ + + + + + + + + + + + + + + + + + + + + + + +
Returns:
+ + +
+

Is sourcesContent present

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Processor.html b/Processor.html new file mode 100644 index 000000000..df7b39905 --- /dev/null +++ b/Processor.html @@ -0,0 +1,805 @@ + + + + + Processor - Documentation + + + + + + + + + + + + + + + + +
+ +

Processor

+ + + + + + + +
+ +
+ +

+ Processor +

+ +

Contains plugins to process CSS. Create one Processor instance, +initialize its plugins, and then use that instance on numerous CSS files.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Processor(plugins)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const processor = postcss([autoprefixer, precss]);
+processor.process(css1).then(result => console.log(result.css));
+processor.process(css2).then(result => console.log(result.css));
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugins + + +Array.<(Plugin|pluginFunction)> +| + +Processor + + + +

PostCSS + plugins. See Processor#use for plugin format.

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

plugins :Array.<pluginFunction>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Plugins added to this processor.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
const processor = postcss([autoprefixer, precss]);
+processor.plugins.length //=> 2
+ + + + + +

version :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Current PostCSS version.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
if ( result.processor.version.split('.')[0] !== '5' ) {
+  throw new Error('This plugin works only with PostCSS 5');
+}
+ + + + + + + +

Methods

+ + + + + + +

process(css, optsopt) → {LazyResult}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Parses source CSS and returns a LazyResult Promise proxy. +Because some plugins can be asynchronous it doesn’t make +any transformations. Transformations will be applied +in the LazyResult methods.

+
+ + + + + + + + + +
Example
+ +
processor.process(css, { from: 'a.css', to: 'a.out.css' })
+  .then(result => {
+     console.log(result.css);
+  });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
css + + +string +| + +toString +| + +Result + + + + + + + + + +

String with input CSS or + any object with a toString() + method, like a Buffer. + Optionally, send a Result + instance and the processor will + take the Root from it.

opts + + +processOptions + + + + + + <optional>
+ + + + + +

options

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Promise proxy

+
+ + + +
+
+ Type +
+
+ +LazyResult + + +
+
+ + + + + + + + + +

use(plugin) → {Processes}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Adds a plugin to be used as a CSS processor.

+

PostCSS plugin can be in 4 formats:

+
    +
  • A plugin created by postcss.plugin method.
  • +
  • A function. PostCSS will pass the function a @{link Root} +as the first argument and current Result instance +as the second.
  • +
  • An object with a postcss method. PostCSS will use that method +as described in #2.
  • +
  • Another Processor instance. PostCSS will copy plugins +from that instance into this one.
  • +
+

Plugins can also be added by passing them as arguments when creating +a postcss instance (see [postcss(plugins)]).

+

Asynchronous plugins should return a Promise instance.

+
+ + + + + + + + + +
Example
+ +
const processor = postcss()
+  .use(autoprefixer)
+  .use(precss);
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +Plugin +| + +pluginFunction +| + +Processor + + + +

PostCSS plugin + or Processor + with plugins

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current processor to make methods chain

+
+ + + +
+
+ Type +
+
+ +Processes + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Result.html b/Result.html new file mode 100644 index 000000000..ce1bda8b6 --- /dev/null +++ b/Result.html @@ -0,0 +1,1406 @@ + + + + + Result - Documentation + + + + + + + + + + + + + + + + +
+ +

Result

+ + + + + + + +
+ +
+ +

+ Result +

+ +

Provides the result of the PostCSS transformations.

+

A Result instance is returned by LazyResult#then +or Root#toResult methods.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Result(processor, root, opts)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Examples
+ +
postcss([cssnext]).process(css).then(function (result) {
+   console.log(result.css);
+});
+ +
var result2 = postcss.parse(css).toResult();
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
processor + + +Processor + + + +

processor used for this transformation.

root + + +Root + + + +

Root node after all transformations.

opts + + +processOptions + + + +

options from the Processor#process + or Root#toResult

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

content :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

An alias for the Result#css property. +Use it with syntaxes that generate non-CSS output.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
result.css === result.content;
+ + + + + +

css :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

A CSS string representing of Result#root.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
postcss.parse('a{}').toResult().css //=> "a{}"
+ + + + + +

map :SourceMapGenerator

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

An instance of SourceMapGenerator + class from the source-map library, + representing changes + to the Result#root instance.

+
+ + + +
Type:
+
    +
  • + +SourceMapGenerator + + +
  • +
+ + + + + +
Examples
+ +
result.map.toJSON() //=> { version: 3, file: 'a.css', … }
+ +
if ( result.map ) {
+  fs.writeFileSync(result.opts.to + '.map', result.map.toString());
+}
+ + + + + +

messages :Array.<Message>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Contains messages from plugins + (e.g., warnings or custom messages). + Each message should have type + and plugin properties.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
postcss.plugin('postcss-min-browser', () => {
+  return (css, result) => {
+    var browsers = detectMinBrowsersByCanIUse(css);
+    result.messages.push({
+      type:    'min-browser',
+      plugin:  'postcss-min-browser',
+      browsers: browsers
+    });
+  };
+});
+ + + + + +

opts :processOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Options from the Processor#process + or Root#toResult call + that produced this Result instance.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.toResult(opts).opts == opts;
+ + + + + +

processor :Processor

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The Processor instance used + for this transformation.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
for ( let plugin of result.processor.plugins) {
+  if ( plugin.postcssPlugin === 'postcss-bad' ) {
+    throw 'postcss-good is incompatible with postcss-bad';
+  }
+});
+ + + + + +

root :Root

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Root node after all transformations.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.toResult().root == root;
+ + + + + + + +

Methods

+ + + + + + +

toString() → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns for @{link Result#css} content.

+
+ + + + + + + + + +
Example
+ +
result + '' === result.css
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

string representing of Result#root

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

warn(text, optsopt) → {Warning}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Creates an instance of Warning and adds it +to Result#messages.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
text + + +string + + + + + + + + + +

warning message

opts + + +Object + + + + + + <optional>
+ + + + + +

warning options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
node + + +Node + + + +

CSS node that caused the warning

word + + +string + + + +

word in CSS source that caused the warning

index + + +number + + + +

index in CSS node string that caused + the warning

plugin + + +string + + + +

name of the plugin that created + this warning. Result#warn fills + this property automatically.

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

created warning

+
+ + + +
+
+ Type +
+
+ +Warning + + +
+
+ + + + + + + + + +

warnings() → {Array.<Warning>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns warnings from plugins. Filters Warning instances +from Result#messages.

+
+ + + + + + + + + +
Example
+ +
result.warnings().forEach(warn => {
+  console.warn(warn.toString());
+});
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

warnings from plugins

+
+ + + +
+
+ Type +
+
+ +Array.<Warning> + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Root.html b/Root.html new file mode 100644 index 000000000..a701a33fe --- /dev/null +++ b/Root.html @@ -0,0 +1,6840 @@ + + + + + Root - Documentation + + + + + + + + + + + + + + + + +
+ +

Root

+ + + + + + + +
+ +
+ +

+ Root +

+ +

Represents a CSS file and contains all its parsed nodes.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Root()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const root = postcss.parse('a{color:black} b{z-index:2}');
+root.type         //=> 'root'
+root.nodes.length //=> 2
+ + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

first :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s first child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.first == rules.nodes[0];
+ + + + + +

last :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s last child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.last == rule.nodes[rule.nodes.length - 1];
+ + + + + +

nodes :Array.<Node>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

an array containing the container’s children

+
+ + + +
Type:
+
    +
  • + +Array.<Node> + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a { color: black }');
+root.nodes.length           //=> 1
+root.nodes[0].selector      //=> 'a'
+root.nodes[0].nodes[0].prop //=> 'color'
+ + + + + +

parent :Container

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the node’s parent node.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.nodes[0].parent == root;
+ + + + + +

raws :object

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Information to generate byte-to-byte equal + node string as it was in the origin input.

+

Every parser saves its own properties, +but the default CSS parser uses:

+
    +
  • after: the space symbols after the last child to the end of file.
  • +
  • semicolon: is the last child has an (optional) semicolon.
  • +
+
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Example
+ +
postcss.parse('a {}\n').raws //=> { after: '\n' }
+postcss.parse('a {}').raws   //=> { after: '' }
+ + + + + +

source :source

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the input source of the node

+

The property is used in source map generation.

+

If you create a node manually (e.g., with postcss.decl()), +that node will not have a source property and will be absent +from the source map. For this reason, the plugin developer should +consider cloning nodes to create new ones (in which case the new node’s +source will reference the original, cloned node) or setting +the source property manually.

+
// Bad
+const prefixed = postcss.decl({
+  prop: '-moz-' + decl.prop,
+  value: decl.value
+});
+
+// Good
+const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
if ( atrule.name == 'add-link' ) {
+  const rule = postcss.rule({ selector: 'a', source: atrule.source });
+  atrule.parent.insertBefore(atrule, rule);
+}
+
+ + + +
Type:
+ + + + + + +
Example
+ +
decl.source.input.from //=> '/home/ai/a.sass'
+decl.source.start      //=> { line: 10, column: 2 }
+decl.source.end        //=> { line: 10, column: 12 }
+ + + + + +

type :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

String representing the node’s type. + Possible values are root, atrule, rule, + decl, or comment.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
+ + + + + + + +

Methods

+ + + + + + +

append(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the start of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.append(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

clone(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

+
+ + + + + + + + + +
Example
+ +
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

clone of the node

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneAfter(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +after the current node.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneBefore(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +before the current node.

+
+ + + + + + + + + +
Example
+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

each(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Iterates through the container’s immediate children, +calling callback for each child.

+

Returning false in the callback will break iteration.

+

This method only iterates through the container’s immediate children. +If you need to recursively iterate through all the container’s descendant +nodes, use Container#walk.

+

Unlike the for {}-cycle or Array#forEach this iterator is safe +if you are mutating the array of child nodes during iteration. +PostCSS will adjust the current index to match the mutations.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { color: black; z-index: 1 }');
+const rule = root.first;
+
+for ( let decl of rule.nodes ) {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Cycle will be infinite, because cloneBefore moves the current node
+    // to the next index
+}
+
+rule.each(decl => {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Will be executed only for color and z-index
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

error(message, optsopt) → {CssSyntaxError}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

+
+ + + + + + + + + +
Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

error description

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the error

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

error object to throw it

+
+ + + +
+
+ Type +
+
+ +CssSyntaxError + + +
+
+ + + + + + + + + +

every(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true +for all of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const noPrefixes = rule.every(i => i.prop[0] !== '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

index(child) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a child’s index within the Container#nodes array.

+
+ + + + + + + + + +
Example
+ +
rule.index( rule.nodes[2] ) //=> 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node + + + +

child of the current container.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

child index

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + +

insertAfter(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node after old node within the container.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

insertBefore(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node before old node within the container.

+
+ + + + + + + + + +
Example
+ +
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index.

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveAfter(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent after otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be after current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveBefore(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent before otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be before current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveTo(newParent) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it +at the end of newParent.

+

This will clean the before and after code Node#raws data +from the node and replace them with the indentation style of newParent. +It will also clean the between property +if newParent is in another Root.

+
+ + + + + + + + + +
Example
+ +
atrule.moveTo(atrule.root());
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
newParent + + +Container + + + +

container node where the current node + will be moved

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

next() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the next child of the node’s parent. +Returns undefined if the current node is the last child.

+
+ + + + + + + + + +
Example
+ +
if ( comment.text === 'delete next' ) {
+  const next = comment.next();
+  if ( next ) {
+    next.remove();
+  }
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

next node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

prepend(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the end of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.prepend(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

prev() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the previous child of the node’s parent. +Returns undefined if the current node is the first child.

+
+ + + + + + + + + +
Example
+ +
const annotation = decl.prev();
+if ( annotation.type == 'comment' ) {
+ readAnnotation(annotation.text);
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

previous node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

raw(prop, defaultTypeopt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Node#raws value. If the node is missing +the code style property (because the node was manually built or cloned), +PostCSS will try to autodetect the code style property by looking +at other nodes in the tree.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { background: white }');
+root.nodes[0].append({ prop: 'color', value: 'black' });
+root.nodes[0].nodes[1].raws.before   //=> undefined
+root.nodes[0].nodes[1].raw('before') //=> ' '
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string + + + + + + + + + +

name of code style property

defaultType + + +string + + + + + + <optional>
+ + + + + +

name of default value, it can be missed + if the value is the same as prop

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

code style value

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

remove() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its parent and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
if ( decl.prop.match(/^-webkit-/) ) {
+  decl.remove();
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

node to make calls chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeAll() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes all children from the container +and cleans their parent properties.

+
+ + + + + + + + + +
Example
+ +
rule.removeAll();
+rule.nodes.length //=> 0
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeChild(child) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes node from the container and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
rule.nodes.length  //=> 5
+rule.removeChild(decl);
+rule.nodes.length  //=> 4
+decl.parent        //=> undefined
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node +| + +number + + + +

child or child’s index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceValues(pattern, opts, callback) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Passes all declaration values within the container that match pattern +through callback, replacing those values with the returned result +of callback.

+

This method is useful if you are using a custom unit or function +and need to iterate through all values.

+
+ + + + + + + + + +
Example
+ +
root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
+  return 15 * parseInt(string) + 'px';
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pattern + + +string +| + +RegExp + + + +

replace pattern

opts + + +object + + + +

options to speed up the search

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string + + + +

an array of property names

fast + + +string + + + +

string that’s used + to narrow down values and speed up + the regexp search

+ +
callback + + +function +| + +string + + + +

string to replace pattern + or callback that returns a new value. + The callback will receive + the same arguments as those passed + to a function parameter + of String#replace.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceWith(…nodes) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts node(s) before the current node and removes the current node.

+
+ + + + + + + + + +
Example
+ +
if ( atrule.name == 'mixin' ) {
+  atrule.replaceWith(mixinRules[atrule.params]);
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nodes + + +Node + + + + + + + + + + <repeatable>
+ +

node(s) to replace current one

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

root() → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Finds the Root instance of the node’s tree.

+
+ + + + + + + + + +
Example
+ +
root.nodes[0].nodes[0].root() === root
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

root parent

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

some(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true for (at least) one +of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const hasPrefix = rule.every(i => i.prop[0] === '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

toResult(optsopt) → {Result}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Result instance representing the root’s CSS.

+
+ + + + + + + + + +
Example
+ +
const root1 = postcss.parse(css1, { from: 'a.css' });
+const root2 = postcss.parse(css2, { from: 'b.css' });
+root1.append(root2);
+const result = root1.toResult({ to: 'all.css', map: true });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +processOptions + + + + + + <optional>
+ + + + + +

options with only to and map keys

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

result with current root’s CSS

+
+ + + +
+
+ Type +
+
+ +Result + + +
+
+ + + + + + + + + +

toString(stringifieropt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CSS string representing the node.

+
+ + + + + + + + + +
Example
+ +
postcss.rule({ selector: 'a' }).toString() //=> "a {}"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
stringifier + + +stringifier +| + +syntax + + + + + + <optional>
+ + + + + +

a syntax to use + in string generation

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

CSS string of this node

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

walk(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each node.

+

Like container.each(), this method is safe to use +if you are mutating arrays during iteration.

+

If you only need to iterate through the container’s immediate children, +use Container#each.

+
+ + + + + + + + + +
Example
+ +
root.walk(node => {
+  // Traverses all descendant nodes.
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkAtRules(nameopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each at-rule node.

+

If you pass a filter, iteration will only happen over at-rules +that have matching names.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkAtRules(rule => {
+  if ( isOld(rule.name) ) rule.remove();
+});
+
+let first = false;
+root.walkAtRules('charset', rule => {
+  if ( !first ) {
+    first = true;
+  } else {
+    rule.remove();
+  }
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter at-rules by name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkComments(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each comment node.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkComments(comment => {
+  comment.remove();
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkDecls(propopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each declaration node.

+

If you pass a filter, iteration will only happen over declarations +with matching properties.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkDecls(decl => {
+  checkPropertySupport(decl.prop);
+});
+
+root.walkDecls('border-radius', decl => {
+  decl.remove();
+});
+
+root.walkDecls(/^background/, decl => {
+  decl.value = takeFirstColorFromGradient(decl.value);
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter declarations by property name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkRules(selectoropt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each rule node.

+

If you pass a filter, iteration will only happen over rules +with matching selectors.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
const selectors = [];
+root.walkRules(rule => {
+  selectors.push(rule.selector);
+});
+console.log(`Your CSS uses ${selectors.length} selectors');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
selector + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter rules by selector

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

warn(result, text, optsopt) → {Warning}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

This method is provided as a convenience wrapper for Result#warn.

+
+ + + + + + + + + +
Example
+ +
const plugin = postcss.plugin('postcss-deprecated', () => {
+  return (css, result) => {
+    css.walkDecls('bad', decl => {
+      decl.warn(result, 'Deprecated property bad');
+    });
+  };
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
result + + +Result + + + + + + + + + +

the Result instance + that will receive the warning

text + + +string + + + + + + + + + +

warning message

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this warning. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the warning

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the warning

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

created warning object

+
+ + + +
+
+ Type +
+
+ +Warning + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Rule.html b/Rule.html new file mode 100644 index 000000000..29717c4c3 --- /dev/null +++ b/Rule.html @@ -0,0 +1,6844 @@ + + + + + Rule - Documentation + + + + + + + + + + + + + + + + +
+ +

Rule

+ + + + + + + +
+ +
+ +

+ Rule +

+ +

Represents a CSS rule: a selector followed by a declaration block.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Rule()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
const root = postcss.parse('a{}');
+const rule = root.first;
+rule.type       //=> 'rule'
+rule.toString() //=> 'a{}'
+ + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

first :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s first child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.first == rules.nodes[0];
+ + + + + +

last :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s last child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.last == rule.nodes[rule.nodes.length - 1];
+ + + + + +

nodes :Array.<Node>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

an array containing the container’s children

+
+ + + +
Type:
+
    +
  • + +Array.<Node> + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a { color: black }');
+root.nodes.length           //=> 1
+root.nodes[0].selector      //=> 'a'
+root.nodes[0].nodes[0].prop //=> 'color'
+ + + + + +

parent :Container

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the node’s parent node.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.nodes[0].parent == root;
+ + + + + +

raws :object

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Information to generate byte-to-byte equal + node string as it was in the origin input.

+

Every parser saves its own properties, +but the default CSS parser uses:

+
    +
  • before: the space symbols before the node. It also stores * +and _ symbols before the declaration (IE hack).
  • +
  • after: the space symbols after the last child of the node +to the end of the node.
  • +
  • between: the symbols between the property and value +for declarations, selector and { for rules, or last parameter +and { for at-rules.
  • +
  • semicolon: contains true if the last child has +an (optional) semicolon.
  • +
+

PostCSS cleans selectors from comments and extra spaces, +but it stores origin content in raws properties. +As such, if you don’t change a declaration’s value, +PostCSS will use the raw value with comments.

+
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a {\n  color:black\n}')
+root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
+ + + + + +

selector :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the rule’s full selector represented + as a string

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a, b { }');
+const rule = root.first;
+rule.selector //=> 'a, b'
+ + + + + +

selectors :Array.<string>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

An array containing the rule’s individual selectors. +Groups of selectors are split at commas.

+
+ + + +
Type:
+
    +
  • + +Array.<string> + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a, b { }');
+const rule = root.first;
+
+rule.selector  //=> 'a, b'
+rule.selectors //=> ['a', 'b']
+
+rule.selectors = ['a', 'strong'];
+rule.selector //=> 'a, strong'
+ + + + + +

source :source

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the input source of the node

+

The property is used in source map generation.

+

If you create a node manually (e.g., with postcss.decl()), +that node will not have a source property and will be absent +from the source map. For this reason, the plugin developer should +consider cloning nodes to create new ones (in which case the new node’s +source will reference the original, cloned node) or setting +the source property manually.

+
// Bad
+const prefixed = postcss.decl({
+  prop: '-moz-' + decl.prop,
+  value: decl.value
+});
+
+// Good
+const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
if ( atrule.name == 'add-link' ) {
+  const rule = postcss.rule({ selector: 'a', source: atrule.source });
+  atrule.parent.insertBefore(atrule, rule);
+}
+
+ + + +
Type:
+ + + + + + +
Example
+ +
decl.source.input.from //=> '/home/ai/a.sass'
+decl.source.start      //=> { line: 10, column: 2 }
+decl.source.end        //=> { line: 10, column: 12 }
+ + + + + +

type :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

String representing the node’s type. + Possible values are root, atrule, rule, + decl, or comment.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
+ + + + + + + +

Methods

+ + + + + + +

append(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the start of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.append(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

clone(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

+
+ + + + + + + + + +
Example
+ +
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

clone of the node

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneAfter(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +after the current node.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneBefore(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

hortcut to clone the node and insert the resulting cloned node +before the current node.

+
+ + + + + + + + + +
Example
+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

each(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Iterates through the container’s immediate children, +calling callback for each child.

+

Returning false in the callback will break iteration.

+

This method only iterates through the container’s immediate children. +If you need to recursively iterate through all the container’s descendant +nodes, use Container#walk.

+

Unlike the for {}-cycle or Array#forEach this iterator is safe +if you are mutating the array of child nodes during iteration. +PostCSS will adjust the current index to match the mutations.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { color: black; z-index: 1 }');
+const rule = root.first;
+
+for ( let decl of rule.nodes ) {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Cycle will be infinite, because cloneBefore moves the current node
+    // to the next index
+}
+
+rule.each(decl => {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Will be executed only for color and z-index
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

error(message, optsopt) → {CssSyntaxError}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

+
+ + + + + + + + + +
Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

error description

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the error

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

error object to throw it

+
+ + + +
+
+ Type +
+
+ +CssSyntaxError + + +
+
+ + + + + + + + + +

every(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true +for all of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const noPrefixes = rule.every(i => i.prop[0] !== '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

index(child) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a child’s index within the Container#nodes array.

+
+ + + + + + + + + +
Example
+ +
rule.index( rule.nodes[2] ) //=> 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node + + + +

child of the current container.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

child index

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + +

insertAfter(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node after old node within the container.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

insertBefore(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node before old node within the container.

+
+ + + + + + + + + +
Example
+ +
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index.

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveAfter(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent after otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be after current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveBefore(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent before otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be before current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveTo(newParent) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it +at the end of newParent.

+

This will clean the before and after code Node#raws data +from the node and replace them with the indentation style of newParent. +It will also clean the between property +if newParent is in another Root.

+
+ + + + + + + + + +
Example
+ +
atrule.moveTo(atrule.root());
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
newParent + + +Container + + + +

container node where the current node + will be moved

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

next() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the next child of the node’s parent. +Returns undefined if the current node is the last child.

+
+ + + + + + + + + +
Example
+ +
if ( comment.text === 'delete next' ) {
+  const next = comment.next();
+  if ( next ) {
+    next.remove();
+  }
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

next node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

prepend(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the end of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.prepend(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

prev() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the previous child of the node’s parent. +Returns undefined if the current node is the first child.

+
+ + + + + + + + + +
Example
+ +
const annotation = decl.prev();
+if ( annotation.type == 'comment' ) {
+ readAnnotation(annotation.text);
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

previous node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

raw(prop, defaultTypeopt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Node#raws value. If the node is missing +the code style property (because the node was manually built or cloned), +PostCSS will try to autodetect the code style property by looking +at other nodes in the tree.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { background: white }');
+root.nodes[0].append({ prop: 'color', value: 'black' });
+root.nodes[0].nodes[1].raws.before   //=> undefined
+root.nodes[0].nodes[1].raw('before') //=> ' '
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string + + + + + + + + + +

name of code style property

defaultType + + +string + + + + + + <optional>
+ + + + + +

name of default value, it can be missed + if the value is the same as prop

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

code style value

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

remove() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its parent and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
if ( decl.prop.match(/^-webkit-/) ) {
+  decl.remove();
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

node to make calls chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeAll() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes all children from the container +and cleans their parent properties.

+
+ + + + + + + + + +
Example
+ +
rule.removeAll();
+rule.nodes.length //=> 0
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeChild(child) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes node from the container and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
rule.nodes.length  //=> 5
+rule.removeChild(decl);
+rule.nodes.length  //=> 4
+decl.parent        //=> undefined
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node +| + +number + + + +

child or child’s index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceValues(pattern, opts, callback) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Passes all declaration values within the container that match pattern +through callback, replacing those values with the returned result +of callback.

+

This method is useful if you are using a custom unit or function +and need to iterate through all values.

+
+ + + + + + + + + +
Example
+ +
root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
+  return 15 * parseInt(string) + 'px';
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pattern + + +string +| + +RegExp + + + +

replace pattern

opts + + +object + + + +

options to speed up the search

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string + + + +

an array of property names

fast + + +string + + + +

string that’s used + to narrow down values and speed up + the regexp search

+ +
callback + + +function +| + +string + + + +

string to replace pattern + or callback that returns a new value. + The callback will receive + the same arguments as those passed + to a function parameter + of String#replace.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceWith(…nodes) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts node(s) before the current node and removes the current node.

+
+ + + + + + + + + +
Example
+ +
if ( atrule.name == 'mixin' ) {
+  atrule.replaceWith(mixinRules[atrule.params]);
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nodes + + +Node + + + + + + + + + + <repeatable>
+ +

node(s) to replace current one

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

root() → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Finds the Root instance of the node’s tree.

+
+ + + + + + + + + +
Example
+ +
root.nodes[0].nodes[0].root() === root
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

root parent

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

some(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true for (at least) one +of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const hasPrefix = rule.every(i => i.prop[0] === '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

toString(stringifieropt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CSS string representing the node.

+
+ + + + + + + + + +
Example
+ +
postcss.rule({ selector: 'a' }).toString() //=> "a {}"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
stringifier + + +stringifier +| + +syntax + + + + + + <optional>
+ + + + + +

a syntax to use + in string generation

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

CSS string of this node

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

walk(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each node.

+

Like container.each(), this method is safe to use +if you are mutating arrays during iteration.

+

If you only need to iterate through the container’s immediate children, +use Container#each.

+
+ + + + + + + + + +
Example
+ +
root.walk(node => {
+  // Traverses all descendant nodes.
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkAtRules(nameopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each at-rule node.

+

If you pass a filter, iteration will only happen over at-rules +that have matching names.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkAtRules(rule => {
+  if ( isOld(rule.name) ) rule.remove();
+});
+
+let first = false;
+root.walkAtRules('charset', rule => {
+  if ( !first ) {
+    first = true;
+  } else {
+    rule.remove();
+  }
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter at-rules by name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkComments(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each comment node.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkComments(comment => {
+  comment.remove();
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkDecls(propopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each declaration node.

+

If you pass a filter, iteration will only happen over declarations +with matching properties.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkDecls(decl => {
+  checkPropertySupport(decl.prop);
+});
+
+root.walkDecls('border-radius', decl => {
+  decl.remove();
+});
+
+root.walkDecls(/^background/, decl => {
+  decl.value = takeFirstColorFromGradient(decl.value);
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter declarations by property name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkRules(selectoropt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each rule node.

+

If you pass a filter, iteration will only happen over rules +with matching selectors.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
const selectors = [];
+root.walkRules(rule => {
+  selectors.push(rule.selector);
+});
+console.log(`Your CSS uses ${selectors.length} selectors');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
selector + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter rules by selector

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

warn(result, text, optsopt) → {Warning}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

This method is provided as a convenience wrapper for Result#warn.

+
+ + + + + + + + + +
Example
+ +
const plugin = postcss.plugin('postcss-deprecated', () => {
+  return (css, result) => {
+    css.walkDecls('bad', decl => {
+      decl.warn(result, 'Deprecated property bad');
+    });
+  };
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
result + + +Result + + + + + + + + + +

the Result instance + that will receive the warning

text + + +string + + + + + + + + + +

warning message

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this warning. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the warning

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the warning

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

created warning object

+
+ + + +
+
+ Type +
+
+ +Warning + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/Warning.html b/Warning.html new file mode 100644 index 000000000..b365fb860 --- /dev/null +++ b/Warning.html @@ -0,0 +1,986 @@ + + + + + Warning - Documentation + + + + + + + + + + + + + + + + +
+ +

Warning

+ + + + + + + +
+ +
+ +

+ Warning +

+ +

Represents a plugin’s warning. It can be created using Node#warn.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Warning(text, optsopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Example
+ +
if ( decl.important ) {
+    decl.warn(result, 'Avoid !important', { word: '!important' });
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
text + + +string + + + + + + + + + +

warning message

opts + + +Object + + + + + + <optional>
+ + + + + +

warning options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
node + + +Node + + + +

CSS node that caused the warning

word + + +string + + + +

word in CSS source that caused the warning

index + + +number + + + +

index in CSS node string that caused + the warning

plugin + + +string + + + +

name of the plugin that created + this warning. Result#warn fills + this property automatically.

+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

column :number

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Column in the input file + with this warning’s source.

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Example
+ +
warning.column //=> 6
+ + + + + +

line :number

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Line in the input file + with this warning’s source

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Example
+ +
warning.line //=> 5
+ + + + + +

node :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Contains the CSS node that caused the warning.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
warning.node.toString() //=> 'color: white !important'
+ + + + + +

plugin :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The name of the plugin that created + it will fill this property automatically. + this warning. When you call Node#warn

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
warning.plugin //=> 'postcss-important'
+ + + + + +

text :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The warning message.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
warning.text //=> 'Try to avoid !important'
+ + + + + +

type :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Type to filter warnings from + Result#messages. Always equal + to "warning".

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
const nonWarning = result.messages.filter(i => i.type !== 'warning')
+ + + + + + + +

Methods

+ + + + + + +

toString() → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a warning position and message.

+
+ + + + + + + + + +
Example
+ +
warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

warning position and message

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/at-rule.es6.html b/at-rule.es6.html new file mode 100644 index 000000000..bd6b80266 --- /dev/null +++ b/at-rule.es6.html @@ -0,0 +1,172 @@ + + + + + at-rule.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

at-rule.es6

+ + + + + + + +
+
+
import Container from './container';
+import warnOnce  from './warn-once';
+
+/**
+ * Represents an at-rule.
+ *
+ * If it’s followed in the CSS by a {} block, this node will have
+ * a nodes property representing its children.
+ *
+ * @extends Container
+ *
+ * @example
+ * const root = postcss.parse('@charset "UTF-8"; @media print {}');
+ *
+ * const charset = root.first;
+ * charset.type  //=> 'atrule'
+ * charset.nodes //=> undefined
+ *
+ * const media = root.last;
+ * media.nodes   //=> []
+ */
+class AtRule extends Container {
+
+    constructor(defaults) {
+        super(defaults);
+        this.type = 'atrule';
+    }
+
+    append(...children) {
+        if ( !this.nodes ) this.nodes = [];
+        return super.append(...children);
+    }
+
+    prepend(...children) {
+        if ( !this.nodes ) this.nodes = [];
+        return super.prepend(...children);
+    }
+
+    get afterName() {
+        warnOnce('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
+        return this.raws.afterName;
+    }
+
+    set afterName(val) {
+        warnOnce('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
+        this.raws.afterName = val;
+    }
+
+    get _params() {
+        warnOnce('AtRule#_params was deprecated. Use AtRule#raws.params');
+        return this.raws.params;
+    }
+
+    set _params(val) {
+        warnOnce('AtRule#_params was deprecated. Use AtRule#raws.params');
+        this.raws.params = val;
+    }
+
+    /**
+     * @memberof AtRule#
+     * @member {string} name - the at-rule’s name immediately follows the `@`
+     *
+     * @example
+     * const root  = postcss.parse('@media print {}');
+     * media.name //=> 'media'
+     * const media = root.first;
+     */
+
+    /**
+     * @memberof AtRule#
+     * @member {string} params - the at-rule’s parameters, the values
+     *                           that follow the at-rule’s name but precede
+     *                           any {} block
+     *
+     * @example
+     * const root  = postcss.parse('@media print, screen {}');
+     * const media = root.first;
+     * media.params //=> 'print, screen'
+     */
+
+    /**
+     * @memberof AtRule#
+     * @member {object} raws - Information to generate byte-to-byte equal
+     *                         node string as it was in the origin input.
+     *
+     * Every parser saves its own properties,
+     * but the default CSS parser uses:
+     *
+     * * `before`: the space symbols before the node. It also stores `*`
+     *   and `_` symbols before the declaration (IE hack).
+     * * `after`: the space symbols after the last child of the node
+     *   to the end of the node.
+     * * `between`: the symbols between the property and value
+     *   for declarations, selector and `{` for rules, or last parameter
+     *   and `{` for at-rules.
+     * * `semicolon`: contains true if the last child has
+     *   an (optional) semicolon.
+     * * `afterName`: the space between the at-rule name and its parameters.
+     *
+     * PostCSS cleans at-rule parameters from comments and extra spaces,
+     * but it stores origin content in raws properties.
+     * As such, if you don’t change a declaration’s value,
+     * PostCSS will use the raw value with comments.
+     *
+     * @example
+     * const root = postcss.parse('  @media\nprint {\n}')
+     * root.first.first.raws //=> { before: '  ',
+     *                       //     between: ' ',
+     *                       //     afterName: '\n',
+     *                       //     after: '\n' }
+     */
+}
+
+export default AtRule;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/comment.es6.html b/comment.es6.html new file mode 100644 index 000000000..a9ea5d84e --- /dev/null +++ b/comment.es6.html @@ -0,0 +1,116 @@ + + + + + comment.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

comment.es6

+ + + + + + + +
+
+
import warnOnce from './warn-once';
+import Node     from './node';
+
+/**
+ * Represents a comment between declarations or statements (rule and at-rules).
+ *
+ * Comments inside selectors, at-rule parameters, or declaration values
+ * will be stored in the `raws` properties explained above.
+ *
+ * @extends Node
+ */
+class Comment extends Node {
+
+    constructor(defaults) {
+        super(defaults);
+        this.type = 'comment';
+    }
+
+    get left() {
+        warnOnce('Comment#left was deprecated. Use Comment#raws.left');
+        return this.raws.left;
+    }
+
+    set left(val) {
+        warnOnce('Comment#left was deprecated. Use Comment#raws.left');
+        this.raws.left = val;
+    }
+
+    get right() {
+        warnOnce('Comment#right was deprecated. Use Comment#raws.right');
+        return this.raws.right;
+    }
+
+    set right(val) {
+        warnOnce('Comment#right was deprecated. Use Comment#raws.right');
+        this.raws.right = val;
+    }
+
+    /**
+     * @memberof Comment#
+     * @member {string} text - the comment’s text
+     */
+
+    /**
+     * @memberof Comment#
+     * @member {object} raws - Information to generate byte-to-byte equal
+     *                         node string as it was in the origin input.
+     *
+     * Every parser saves its own properties,
+     * but the default CSS parser uses:
+     *
+     * * `before`: the space symbols before the node.
+     * * `left`: the space symbols between `/*` and the comment’s text.
+     * * `right`: the space symbols between the comment’s text.
+     */
+}
+
+export default Comment;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/container.es6.html b/container.es6.html new file mode 100644 index 000000000..78f9918fe --- /dev/null +++ b/container.es6.html @@ -0,0 +1,802 @@ + + + + + container.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

container.es6

+ + + + + + + +
+
+
import Declaration from './declaration';
+import warnOnce    from './warn-once';
+import Comment     from './comment';
+import Node        from './node';
+
+function cleanSource(nodes) {
+    return nodes.map( i => {
+        if ( i.nodes ) i.nodes = cleanSource(i.nodes);
+        delete i.source;
+        return i;
+    });
+}
+
+/**
+ * @callback childCondition
+ * @param {Node} node    - container child
+ * @param {number} index - child index
+ * @param {Node[]} nodes - all container children
+ * @return {boolean}
+ */
+
+ /**
+  * @callback childIterator
+  * @param {Node} node    - container child
+  * @param {number} index - child index
+  * @return {false|undefined} returning `false` will break iteration
+  */
+
+/**
+ * The {@link Root}, {@link AtRule}, and {@link Rule} container nodes
+ * inherit some common methods to help work with their children.
+ *
+ * Note that all containers can store any content. If you write a rule inside
+ * a rule, PostCSS will parse it.
+ *
+ * @extends Node
+ * @abstract
+ * @ignore
+ */
+class Container extends Node {
+
+    push(child) {
+        child.parent = this;
+        this.nodes.push(child);
+        return this;
+    }
+
+    /**
+     * Iterates through the container’s immediate children,
+     * calling `callback` for each child.
+     *
+     * Returning `false` in the callback will break iteration.
+     *
+     * This method only iterates through the container’s immediate children.
+     * If you need to recursively iterate through all the container’s descendant
+     * nodes, use {@link Container#walk}.
+     *
+     * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
+     * if you are mutating the array of child nodes during iteration.
+     * PostCSS will adjust the current index to match the mutations.
+     *
+     * @param {childIterator} callback - iterator receives each node and index
+     *
+     * @return {false|undefined} returns `false` if iteration was broke
+     *
+     * @example
+     * const root = postcss.parse('a { color: black; z-index: 1 }');
+     * const rule = root.first;
+     *
+     * for ( let decl of rule.nodes ) {
+     *     decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+     *     // Cycle will be infinite, because cloneBefore moves the current node
+     *     // to the next index
+     * }
+     *
+     * rule.each(decl => {
+     *     decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+     *     // Will be executed only for color and z-index
+     * });
+     */
+    each(callback) {
+        if ( !this.lastEach ) this.lastEach = 0;
+        if ( !this.indexes ) this.indexes = { };
+
+        this.lastEach += 1;
+        let id = this.lastEach;
+        this.indexes[id] = 0;
+
+        if ( !this.nodes ) return undefined;
+
+        let index, result;
+        while ( this.indexes[id] < this.nodes.length ) {
+            index  = this.indexes[id];
+            result = callback(this.nodes[index], index);
+            if ( result === false ) break;
+
+            this.indexes[id] += 1;
+        }
+
+        delete this.indexes[id];
+
+        return result;
+    }
+
+    /**
+     * Traverses the container’s descendant nodes, calling callback
+     * for each node.
+     *
+     * Like container.each(), this method is safe to use
+     * if you are mutating arrays during iteration.
+     *
+     * If you only need to iterate through the container’s immediate children,
+     * use {@link Container#each}.
+     *
+     * @param {childIterator} callback - iterator receives each node and index
+     *
+     * @return {false|undefined} returns `false` if iteration was broke
+     *
+     * @example
+     * root.walk(node => {
+     *   // Traverses all descendant nodes.
+     * });
+     */
+    walk(callback) {
+        return this.each( (child, i) => {
+            let result = callback(child, i);
+            if ( result !== false && child.walk ) {
+                result = child.walk(callback);
+            }
+            return result;
+        });
+    }
+
+    /**
+     * Traverses the container’s descendant nodes, calling callback
+     * for each declaration node.
+     *
+     * If you pass a filter, iteration will only happen over declarations
+     * with matching properties.
+     *
+     * Like {@link Container#each}, this method is safe
+     * to use if you are mutating arrays during iteration.
+     *
+     * @param {string|RegExp} [prop]   - string or regular expression
+     *                                   to filter declarations by property name
+     * @param {childIterator} callback - iterator receives each node and index
+     *
+     * @return {false|undefined} returns `false` if iteration was broke
+     *
+     * @example
+     * root.walkDecls(decl => {
+     *   checkPropertySupport(decl.prop);
+     * });
+     *
+     * root.walkDecls('border-radius', decl => {
+     *   decl.remove();
+     * });
+     *
+     * root.walkDecls(/^background/, decl => {
+     *   decl.value = takeFirstColorFromGradient(decl.value);
+     * });
+     */
+    walkDecls(prop, callback) {
+        if ( !callback ) {
+            callback = prop;
+            return this.walk( (child, i) => {
+                if ( child.type === 'decl' ) {
+                    return callback(child, i);
+                }
+            });
+        } else if ( prop instanceof RegExp ) {
+            return this.walk( (child, i) => {
+                if ( child.type === 'decl' && prop.test(child.prop) ) {
+                    return callback(child, i);
+                }
+            });
+        } else {
+            return this.walk( (child, i) => {
+                if ( child.type === 'decl' && child.prop === prop ) {
+                    return callback(child, i);
+                }
+            });
+        }
+    }
+
+    /**
+     * Traverses the container’s descendant nodes, calling callback
+     * for each rule node.
+     *
+     * If you pass a filter, iteration will only happen over rules
+     * with matching selectors.
+     *
+     * Like {@link Container#each}, this method is safe
+     * to use if you are mutating arrays during iteration.
+     *
+     * @param {string|RegExp} [selector] - string or regular expression
+     *                                     to filter rules by selector
+     * @param {childIterator} callback   - iterator receives each node and index
+     *
+     * @return {false|undefined} returns `false` if iteration was broke
+     *
+     * @example
+     * const selectors = [];
+     * root.walkRules(rule => {
+     *   selectors.push(rule.selector);
+     * });
+     * console.log(`Your CSS uses ${selectors.length} selectors');
+     */
+    walkRules(selector, callback) {
+        if ( !callback ) {
+            callback = selector;
+
+            return this.walk( (child, i) => {
+                if ( child.type === 'rule' ) {
+                    return callback(child, i);
+                }
+            });
+        } else if ( selector instanceof RegExp ) {
+            return this.walk( (child, i) => {
+                if ( child.type === 'rule' && selector.test(child.selector) ) {
+                    return callback(child, i);
+                }
+            });
+        } else {
+            return this.walk( (child, i) => {
+                if ( child.type === 'rule' && child.selector === selector ) {
+                    return callback(child, i);
+                }
+            });
+        }
+    }
+
+    /**
+     * Traverses the container’s descendant nodes, calling callback
+     * for each at-rule node.
+     *
+     * If you pass a filter, iteration will only happen over at-rules
+     * that have matching names.
+     *
+     * Like {@link Container#each}, this method is safe
+     * to use if you are mutating arrays during iteration.
+     *
+     * @param {string|RegExp} [name]   - string or regular expression
+     *                                   to filter at-rules by name
+     * @param {childIterator} callback - iterator receives each node and index
+     *
+     * @return {false|undefined} returns `false` if iteration was broke
+     *
+     * @example
+     * root.walkAtRules(rule => {
+     *   if ( isOld(rule.name) ) rule.remove();
+     * });
+     *
+     * let first = false;
+     * root.walkAtRules('charset', rule => {
+     *   if ( !first ) {
+     *     first = true;
+     *   } else {
+     *     rule.remove();
+     *   }
+     * });
+     */
+    walkAtRules(name, callback) {
+        if ( !callback ) {
+            callback = name;
+            return this.walk( (child, i) => {
+                if ( child.type === 'atrule' ) {
+                    return callback(child, i);
+                }
+            });
+        } else if ( name instanceof RegExp ) {
+            return this.walk( (child, i) => {
+                if ( child.type === 'atrule' && name.test(child.name) ) {
+                    return callback(child, i);
+                }
+            });
+        } else {
+            return this.walk( (child, i) => {
+                if ( child.type === 'atrule' && child.name === name ) {
+                    return callback(child, i);
+                }
+            });
+        }
+    }
+
+    /**
+     * Traverses the container’s descendant nodes, calling callback
+     * for each comment node.
+     *
+     * Like {@link Container#each}, this method is safe
+     * to use if you are mutating arrays during iteration.
+     *
+     * @param {childIterator} callback - iterator receives each node and index
+     *
+     * @return {false|undefined} returns `false` if iteration was broke
+     *
+     * @example
+     * root.walkComments(comment => {
+     *   comment.remove();
+     * });
+     */
+    walkComments(callback) {
+        return this.walk( (child, i) => {
+            if ( child.type === 'comment' ) {
+                return callback(child, i);
+            }
+        });
+    }
+
+    /**
+     * Inserts new nodes to the start of the container.
+     *
+     * @param {...(Node|object|string|Node[])} children - new nodes
+     *
+     * @return {Node} this node for methods chain
+     *
+     * @example
+     * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+     * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+     * rule.append(decl1, decl2);
+     *
+     * root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+     * root.append({ selector: 'a' });                       // rule
+     * rule.append({ prop: 'color', value: 'black' });       // declaration
+     * rule.append({ text: 'Comment' })                      // comment
+     *
+     * root.append('a {}');
+     * root.first.append('color: black; z-index: 1');
+     */
+    append(...children) {
+        for ( let child of children ) {
+            let nodes = this.normalize(child, this.last);
+            for ( let node of nodes ) this.nodes.push(node);
+        }
+        return this;
+    }
+
+    /**
+     * Inserts new nodes to the end of the container.
+     *
+     * @param {...(Node|object|string|Node[])} children - new nodes
+     *
+     * @return {Node} this node for methods chain
+     *
+     * @example
+     * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+     * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+     * rule.prepend(decl1, decl2);
+     *
+     * root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+     * root.append({ selector: 'a' });                       // rule
+     * rule.append({ prop: 'color', value: 'black' });       // declaration
+     * rule.append({ text: 'Comment' })                      // comment
+     *
+     * root.append('a {}');
+     * root.first.append('color: black; z-index: 1');
+     */
+    prepend(...children) {
+        children = children.reverse();
+        for ( let child of children ) {
+            let nodes = this.normalize(child, this.first, 'prepend').reverse();
+            for ( let node of nodes ) this.nodes.unshift(node);
+            for ( let id in this.indexes ) {
+                this.indexes[id] = this.indexes[id] + nodes.length;
+            }
+        }
+        return this;
+    }
+
+    cleanRaws(keepBetween) {
+        super.cleanRaws(keepBetween);
+        if ( this.nodes ) {
+            for ( let node of this.nodes ) node.cleanRaws(keepBetween);
+        }
+    }
+
+    /**
+     * Insert new node before old node within the container.
+     *
+     * @param {Node|number} exist             - child or child’s index.
+     * @param {Node|object|string|Node[]} add - new node
+     *
+     * @return {Node} this node for methods chain
+     *
+     * @example
+     * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
+     */
+    insertBefore(exist, add) {
+        exist = this.index(exist);
+
+        let type  = exist === 0 ? 'prepend' : false;
+        let nodes = this.normalize(add, this.nodes[exist], type).reverse();
+        for ( let node of nodes ) this.nodes.splice(exist, 0, node);
+
+        let index;
+        for ( let id in this.indexes ) {
+            index = this.indexes[id];
+            if ( exist <= index ) {
+                this.indexes[id] = index + nodes.length;
+            }
+        }
+
+        return this;
+    }
+
+    /**
+     * Insert new node after old node within the container.
+     *
+     * @param {Node|number} exist             - child or child’s index
+     * @param {Node|object|string|Node[]} add - new node
+     *
+     * @return {Node} this node for methods chain
+     */
+    insertAfter(exist, add) {
+        exist = this.index(exist);
+
+        let nodes = this.normalize(add, this.nodes[exist]).reverse();
+        for ( let node of nodes ) this.nodes.splice(exist + 1, 0, node);
+
+        let index;
+        for ( let id in this.indexes ) {
+            index = this.indexes[id];
+            if ( exist < index ) {
+                this.indexes[id] = index + nodes.length;
+            }
+        }
+
+        return this;
+    }
+
+    remove(child) {
+        if ( typeof child !== 'undefined' ) {
+            warnOnce('Container#remove is deprecated. ' +
+                     'Use Container#removeChild');
+            this.removeChild(child);
+        } else {
+            super.remove();
+        }
+        return this;
+    }
+
+    /**
+     * Removes node from the container and cleans the parent properties
+     * from the node and its children.
+     *
+     * @param {Node|number} child - child or child’s index
+     *
+     * @return {Node} this node for methods chain
+     *
+     * @example
+     * rule.nodes.length  //=> 5
+     * rule.removeChild(decl);
+     * rule.nodes.length  //=> 4
+     * decl.parent        //=> undefined
+     */
+    removeChild(child) {
+        child = this.index(child);
+        this.nodes[child].parent = undefined;
+        this.nodes.splice(child, 1);
+
+        let index;
+        for ( let id in this.indexes ) {
+            index = this.indexes[id];
+            if ( index >= child ) {
+                this.indexes[id] = index - 1;
+            }
+        }
+
+        return this;
+    }
+
+    /**
+     * Removes all children from the container
+     * and cleans their parent properties.
+     *
+     * @return {Node} this node for methods chain
+     *
+     * @example
+     * rule.removeAll();
+     * rule.nodes.length //=> 0
+     */
+    removeAll() {
+        for ( let node of this.nodes ) node.parent = undefined;
+        this.nodes = [];
+        return this;
+    }
+
+    /**
+     * Passes all declaration values within the container that match pattern
+     * through callback, replacing those values with the returned result
+     * of callback.
+     *
+     * This method is useful if you are using a custom unit or function
+     * and need to iterate through all values.
+     *
+     * @param {string|RegExp} pattern    - replace pattern
+     * @param {object} opts              - options to speed up the search
+     * @param {string} opts.prop         - an array of property names
+     * @param {string} opts.fast         - string that’s used
+     *                                     to narrow down values and speed up
+     *                                     the regexp search
+     * @param {function|string} callback - string to replace pattern
+     *                                     or callback that returns a new value.
+     *                                     The callback will receive
+     *                                     the same arguments as those passed
+     *                                     to a function parameter
+     *                                     of `String#replace`.
+     *
+     * @return {Node} this node for methods chain
+     *
+     * @example
+     * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
+     *   return 15 * parseInt(string) + 'px';
+     * });
+     */
+    replaceValues(pattern, opts, callback) {
+        if ( !callback ) {
+            callback = opts;
+            opts = { };
+        }
+
+        this.walkDecls( decl => {
+            if ( opts.props && opts.props.indexOf(decl.prop) === -1 ) return;
+            if ( opts.fast  && decl.value.indexOf(opts.fast) === -1 ) return;
+
+            decl.value = decl.value.replace(pattern, callback);
+        });
+
+        return this;
+    }
+
+    /**
+     * Returns `true` if callback returns `true`
+     * for all of the container’s children.
+     *
+     * @param {childCondition} condition - iterator returns true or false.
+     *
+     * @return {boolean} is every child pass condition
+     *
+     * @example
+     * const noPrefixes = rule.every(i => i.prop[0] !== '-');
+     */
+    every(condition) {
+        return this.nodes.every(condition);
+    }
+
+    /**
+     * Returns `true` if callback returns `true` for (at least) one
+     * of the container’s children.
+     *
+     * @param {childCondition} condition - iterator returns true or false.
+     *
+     * @return {boolean} is every child pass condition
+     *
+     * @example
+     * const hasPrefix = rule.every(i => i.prop[0] === '-');
+     */
+    some(condition) {
+        return this.nodes.some(condition);
+    }
+
+    /**
+     * Returns a `child`’s index within the {@link Container#nodes} array.
+     *
+     * @param {Node} child - child of the current container.
+     *
+     * @return {number} child index
+     *
+     * @example
+     * rule.index( rule.nodes[2] ) //=> 2
+     */
+    index(child) {
+        if ( typeof child === 'number' ) {
+            return child;
+        } else {
+            return this.nodes.indexOf(child);
+        }
+    }
+
+    /**
+     * The container’s first child.
+     *
+     * @type {Node}
+     *
+     * @example
+     * rule.first == rules.nodes[0];
+     */
+    get first() {
+        if ( !this.nodes ) return undefined;
+        return this.nodes[0];
+    }
+
+    /**
+     * The container’s last child.
+     *
+     * @type {Node}
+     *
+     * @example
+     * rule.last == rule.nodes[rule.nodes.length - 1];
+     */
+    get last() {
+        if ( !this.nodes ) return undefined;
+        return this.nodes[this.nodes.length - 1];
+    }
+
+    normalize(nodes, sample) {
+        if ( typeof nodes === 'string' ) {
+            let parse = require('./parse');
+            nodes = cleanSource(parse(nodes).nodes);
+        } else if ( !Array.isArray(nodes) ) {
+            if ( nodes.type === 'root' ) {
+                nodes = nodes.nodes;
+            } else if ( nodes.type ) {
+                nodes = [nodes];
+            } else if ( nodes.prop ) {
+                if ( typeof nodes.value === 'undefined' ) {
+                    throw new Error('Value field is missed in node creation');
+                } else if ( typeof nodes.value !== 'string' ) {
+                    nodes.value = String(nodes.value);
+                }
+                nodes = [new Declaration(nodes)];
+            } else if ( nodes.selector ) {
+                let Rule = require('./rule');
+                nodes = [new Rule(nodes)];
+            } else if ( nodes.name ) {
+                let AtRule = require('./at-rule');
+                nodes = [new AtRule(nodes)];
+            } else if ( nodes.text ) {
+                nodes = [new Comment(nodes)];
+            } else {
+                throw new Error('Unknown node type in node creation');
+            }
+        }
+
+        let processed = nodes.map( i => {
+            if ( typeof i.raws === 'undefined' ) i = this.rebuild(i);
+
+            if ( i.parent ) i = i.clone();
+            if ( typeof i.raws.before === 'undefined' ) {
+                if ( sample && typeof sample.raws.before !== 'undefined' ) {
+                    i.raws.before = sample.raws.before.replace(/[^\s]/g, '');
+                }
+            }
+            i.parent = this;
+            return i;
+        });
+
+        return processed;
+    }
+
+    rebuild(node, parent) {
+        let fix;
+        if ( node.type === 'root' ) {
+            let Root = require('./root');
+            fix = new Root();
+        } else if ( node.type === 'atrule' ) {
+            let AtRule = require('./at-rule');
+            fix = new AtRule();
+        } else if ( node.type === 'rule' ) {
+            let Rule = require('./rule');
+            fix = new Rule();
+        } else if ( node.type === 'decl' ) {
+            fix = new Declaration();
+        } else if ( node.type === 'comment' ) {
+            fix = new Comment();
+        }
+
+        for ( let i in node ) {
+            if ( i === 'nodes' ) {
+                fix.nodes = node.nodes.map( j => this.rebuild(j, fix) );
+            } else if ( i === 'parent' && parent ) {
+                fix.parent = parent;
+            } else if ( node.hasOwnProperty(i) ) {
+                fix[i] = node[i];
+            }
+        }
+
+        return fix;
+    }
+
+    eachInside(callback) {
+        warnOnce('Container#eachInside is deprecated. ' +
+                 'Use Container#walk instead.');
+        return this.walk(callback);
+    }
+
+    eachDecl(prop, callback) {
+        warnOnce('Container#eachDecl is deprecated. ' +
+                 'Use Container#walkDecls instead.');
+        return this.walkDecls(prop, callback);
+    }
+
+    eachRule(selector, callback) {
+        warnOnce('Container#eachRule is deprecated. ' +
+                 'Use Container#walkRules instead.');
+        return this.walkRules(selector, callback);
+    }
+
+    eachAtRule(name, callback) {
+        warnOnce('Container#eachAtRule is deprecated. ' +
+                 'Use Container#walkAtRules instead.');
+        return this.walkAtRules(name, callback);
+    }
+
+    eachComment(callback) {
+        warnOnce('Container#eachComment is deprecated. ' +
+                 'Use Container#walkComments instead.');
+        return this.walkComments(callback);
+    }
+
+    get semicolon() {
+        warnOnce('Node#semicolon is deprecated. Use Node#raws.semicolon');
+        return this.raws.semicolon;
+    }
+
+    set semicolon(val) {
+        warnOnce('Node#semicolon is deprecated. Use Node#raws.semicolon');
+        this.raws.semicolon = val;
+    }
+
+    get after() {
+        warnOnce('Node#after is deprecated. Use Node#raws.after');
+        return this.raws.after;
+    }
+
+    set after(val) {
+        warnOnce('Node#after is deprecated. Use Node#raws.after');
+        this.raws.after = val;
+    }
+
+    /**
+     * @memberof Container#
+     * @member {Node[]} nodes - an array containing the container’s children
+     *
+     * @example
+     * const root = postcss.parse('a { color: black }');
+     * root.nodes.length           //=> 1
+     * root.nodes[0].selector      //=> 'a'
+     * root.nodes[0].nodes[0].prop //=> 'color'
+     */
+
+}
+
+export default Container;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/css-syntax-error.es6.html b/css-syntax-error.es6.html new file mode 100644 index 000000000..dc7c1e294 --- /dev/null +++ b/css-syntax-error.es6.html @@ -0,0 +1,271 @@ + + + + + css-syntax-error.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

css-syntax-error.es6

+ + + + + + + +
+
+
import supportsColor from 'supports-color';
+
+import warnOnce from './warn-once';
+
+/**
+ * The CSS parser throws this error for broken CSS.
+ *
+ * Custom parsers can throw this error for broken custom syntax using
+ * the {@link Node#error} method.
+ *
+ * PostCSS will use the input source map to detect the original error location.
+ * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
+ * PostCSS will show the original position in the Sass file.
+ *
+ * If you need the position in the PostCSS input
+ * (e.g., to debug the previous compiler), use `error.input.file`.
+ *
+ * @example
+ * // Catching and checking syntax error
+ * try {
+ *   postcss.parse('a{')
+ * } catch (error) {
+ *   if ( error.name === 'CssSyntaxError' ) {
+ *     error //=> CssSyntaxError
+ *   }
+ * }
+ *
+ * @example
+ * // Raising error from plugin
+ * throw node.error('Unknown variable', { plugin: 'postcss-vars' });
+ */
+class CssSyntaxError {
+
+    /**
+     * @param {string} message  - error message
+     * @param {number} [line]   - source line of the error
+     * @param {number} [column] - source column of the error
+     * @param {string} [source] - source code of the broken file
+     * @param {string} [file]   - absolute path to the broken file
+     * @param {string} [plugin] - PostCSS plugin name, if error came from plugin
+     */
+    constructor(message, line, column, source, file, plugin) {
+        /**
+         * @member {string} - Always equal to `'CssSyntaxError'`. You should
+         *                    always check error type
+         *                    by `error.name === 'CssSyntaxError'` instead of
+         *                    `error instanceof CssSyntaxError`, because
+         *                    npm could have several PostCSS versions.
+         *
+         * @example
+         * if ( error.name === 'CssSyntaxError' ) {
+         *   error //=> CssSyntaxError
+         * }
+         */
+        this.name   = 'CssSyntaxError';
+        /**
+         * @member {string} - Error message.
+         *
+         * @example
+         * error.message //=> 'Unclosed block'
+         */
+        this.reason = message;
+
+        if ( file ) {
+            /**
+             * @member {string} - Absolute path to the broken file.
+             *
+             * @example
+             * error.file       //=> 'a.sass'
+             * error.input.file //=> 'a.css'
+             */
+            this.file = file;
+        }
+        if ( source ) {
+            /**
+             * @member {string} - Source code of the broken file.
+             *
+             * @example
+             * error.source       //=> 'a { b {} }'
+             * error.input.column //=> 'a b { }'
+             */
+            this.source = source;
+        }
+        if ( plugin ) {
+            /**
+             * @member {string} - Plugin name, if error came from plugin.
+             *
+             * @example
+             * error.plugin //=> 'postcss-vars'
+             */
+            this.plugin = plugin;
+        }
+        if ( typeof line !== 'undefined' && typeof column !== 'undefined' ) {
+            /**
+             * @member {number} - Source line of the error.
+             *
+             * @example
+             * error.line       //=> 2
+             * error.input.line //=> 4
+             */
+            this.line   = line;
+            /**
+             * @member {number} - Source column of the error.
+             *
+             * @example
+             * error.column       //=> 1
+             * error.input.column //=> 4
+             */
+            this.column = column;
+        }
+
+        this.setMessage();
+
+        if ( Error.captureStackTrace ) {
+            Error.captureStackTrace(this, CssSyntaxError);
+        }
+    }
+
+    setMessage() {
+        /**
+         * @member {string} - Full error text in the GNU error format
+         *                    with plugin, file, line and column.
+         *
+         * @example
+         * error.message //=> 'a.css:1:1: Unclosed block'
+         */
+        this.message  = this.plugin ? this.plugin + ': ' : '';
+        this.message += this.file ? this.file : '<css input>';
+        if ( typeof this.line !== 'undefined' ) {
+            this.message += ':' + this.line + ':' + this.column;
+        }
+        this.message += ': ' + this.reason;
+    }
+
+    /**
+     * Returns a few lines of CSS source that caused the error.
+     *
+     * If the CSS has an input source map without `sourceContent`,
+     * this method will return an empty string.
+     *
+     * @param {boolean} [color] whether arrow will be colored red by terminal
+     *                          color codes. By default, PostCSS will detect
+     *                          color support by `process.stdout.isTTY`
+     *                          and `process.env.NODE_DISABLE_COLORS`.
+     *
+     * @example
+     * error.showSourceCode() //=> "a {
+     *                        //      bad
+     *                        //      ^
+     *                        //    }"
+     *
+     * @return {string} few lines of CSS source that caused the error
+     */
+    showSourceCode(color) {
+        if ( !this.source ) return '';
+
+        let num   = this.line - 1;
+        let lines = this.source.split('\n');
+
+        let prev   = num > 0 ? lines[num - 1] + '\n' : '';
+        let broken = lines[num];
+        let next   = num < lines.length - 1 ? '\n' + lines[num + 1] : '';
+
+        let mark = '\n';
+        for ( let i = 0; i < this.column - 1; i++ ) {
+            mark += ' ';
+        }
+
+        if ( typeof color === 'undefined' ) color = supportsColor;
+        if ( color ) {
+            mark += '\x1B[1;31m^\x1B[0m';
+        } else {
+            mark += '^';
+        }
+
+        return '\n' + prev + broken + mark + next;
+    }
+
+    /**
+     * Returns error position, message and source code of the broken part.
+     *
+     * @example
+     * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
+     *                  //    a {
+     *                  //    ^"
+     *
+     * @return {string} error position, message and source code
+     */
+    toString() {
+        return this.name + ': ' + this.message + this.showSourceCode();
+    }
+
+    get generated() {
+        warnOnce('CssSyntaxError#generated is depreacted. Use input instead.');
+        return this.input;
+    }
+
+    /**
+     * @memberof CssSyntaxError#
+     * @member {Input} input - Input object with PostCSS internal information
+     *                         about input file. If input has source map
+     *                         from previous tool, PostCSS will use origin
+     *                         (for example, Sass) source. You can use this
+     *                         object to get PostCSS input source.
+     *
+     * @example
+     * error.input.file //=> 'a.css'
+     * error.file       //=> 'a.sass'
+     */
+
+}
+
+export default CssSyntaxError;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/declaration.es6.html b/declaration.es6.html new file mode 100644 index 000000000..21ab18cc6 --- /dev/null +++ b/declaration.es6.html @@ -0,0 +1,159 @@ + + + + + declaration.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

declaration.es6

+ + + + + + + +
+
+
import warnOnce from './warn-once';
+import Node     from './node';
+
+/**
+ * Represents a CSS declaration.
+ *
+ * @extends Node
+ *
+ * @example
+ * const root = postcss.parse('a { color: black }');
+ * const decl = root.first.first;
+ * decl.type       //=> 'decl'
+ * decl.toString() //=> ' color: black'
+ */
+class Declaration extends Node {
+
+    constructor(defaults) {
+        super(defaults);
+        this.type = 'decl';
+    }
+
+    get _value() {
+        warnOnce('Node#_value was deprecated. Use Node#raws.value');
+        return this.raws.value;
+    }
+
+    set _value(val) {
+        warnOnce('Node#_value was deprecated. Use Node#raws.value');
+        this.raws.value = val;
+    }
+
+    get _important() {
+        warnOnce('Node#_important was deprecated. Use Node#raws.important');
+        return this.raws.important;
+    }
+
+    set _important(val) {
+        warnOnce('Node#_important was deprecated. Use Node#raws.important');
+        this.raws.important = val;
+    }
+
+    /**
+     * @memberof Declaration#
+     * @member {string} prop - the declaration’s property name
+     *
+     * @example
+     * const root = postcss.parse('a { color: black }');
+     * const decl = root.first.first;
+     * decl.prop //=> 'color'
+     */
+
+    /**
+     * @memberof Declaration#
+     * @member {string} value - the declaration’s value
+     *
+     * @example
+     * const root = postcss.parse('a { color: black }');
+     * const decl = root.first.first;
+     * decl.value //=> 'black'
+     */
+
+    /**
+     * @memberof Declaration#
+     * @member {boolean} important - `true` if the declaration
+     *                               has an !important annotation.
+     *
+     * @example
+     * const root = postcss.parse('a { color: black !important; color: red }');
+     * root.first.first.important //=> true
+     * root.first.last.important  //=> undefined
+     */
+
+    /**
+     * @memberof Declaration#
+     * @member {object} raws - Information to generate byte-to-byte equal
+     *                         node string as it was in the origin input.
+     *
+     * Every parser saves its own properties,
+     * but the default CSS parser uses:
+     *
+     * * `before`: the space symbols before the node. It also stores `*`
+     *   and `_` symbols before the declaration (IE hack).
+     * * `between`: the symbols between the property and value
+     *   for declarations, selector and `{` for rules, or last parameter
+     *   and `{` for at-rules.
+     * * `important`: the content of the important statement,
+     *   if it is not just `!important`.
+     *
+     * PostCSS cleans declaration from comments and extra spaces,
+     * but it stores origin content in raws properties.
+     * As such, if you don’t change a declaration’s value,
+     * PostCSS will use the raw value with comments.
+     *
+     * @example
+     * const root = postcss.parse('a {\n  color:black\n}')
+     * root.first.first.raws //=> { before: '\n  ', between: ':' }
+     */
+
+}
+
+export default Declaration;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/global.html b/global.html new file mode 100644 index 000000000..fe4f9f57c --- /dev/null +++ b/global.html @@ -0,0 +1,2907 @@ + + + + + Global - Documentation + + + + + + + + + + + + + + + + +
+ +

Global

+ + + + + + + +
+ +
+ +

+ +

+ + +
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +

Type Definitions

+ + + + + + +

builder(part, node, typeopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
part + + +string + + + + + + + + + +

part of generated CSS connected to this node

node + + +Node + + + + + + + + + +

AST node

type + + +"start" +| + +"end" + + + + + + <optional>
+ + + + + +

node’s part type

+ + + + + + + + + + + + + + + + + + + + + +

childCondition(node, index, nodes) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
node + + +Node + + + +

container child

index + + +number + + + +

child index

nodes + + +Array.<Node> + + + +

all container children

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

childIterator(node, index) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
node + + +Node + + + +

container child

index + + +number + + + +

child index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returning false will break iteration

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + +

filePosition

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
file + + +string + + + +

path to file

line + + +number + + + +

source line in file

column + + +number + + + +

source column in file

+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + +

Message

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +string + + + +

message type

plugin + + +string + + + +

source PostCSS plugin name

+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + + + + +

onFulfilled(result)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
result + + +Result + + + +
+ + + + + + + + + + + + + + + + + + + + + +

onRejected(error)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
error + + +Error + + + +
+ + + + + + + + + + + + + + + + + + + + + +

parser(css, optsopt) → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
css + + +string +| + +toString + + + + + + + + + +

string with input CSS or any object + with toString() method, like a Buffer

opts + + +processOptions + + + + + + <optional>
+ + + + + +

options with only from and map keys

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

PostCSS AST

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + +

Plugin

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
postcss + + +function + + + +

PostCSS plugin function

+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + + + + +

pluginFunction(root, result)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
root + + +Root + + + +

parsed input CSS

result + + +Result + + + +

result to set warnings or check other plugins

+ + + + + + + + + + + + + + + + + + +

position

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
line + + +number + + + +

source line in file

column + + +number + + + +

source column in file

+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + +

processOptions

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
from + + +string + + + +

the path of the CSS source file. + You should always set from, + because it is used in source map + generation and syntax error messages.

to + + +string + + + +

the path where you’ll put the output + CSS file. You should always set to + to generate correct source maps.

parser + + +parser + + + +

function to generate AST by string

stringifier + + +stringifier + + + +

class to generate string by AST

syntax + + +syntax + + + +

object with parse and stringify

map + + +object + + + +

source map options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
inline + + +boolean + + + +

does source map should + be embedded in the output + CSS as a base64-encoded + comment

prev + + +string +| + +object +| + +false +| + +function + + + +

source map content + from a previous + processing step + (for example, Sass). + PostCSS will try to find + previous map + automatically, so you + could disable it by + false value.

sourcesContent + + +boolean + + + +

does PostCSS should set + the origin content to map

annotation + + +string +| + +false + + + +

does PostCSS should set + annotation comment to map

from + + +string + + + +

override from in map’s + sources

+ +
+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + +

source

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Input + + + +

Input with input file

start + + +position + + + +

The starting position of the node’s source

end + + +position + + + +

The ending position of the node’s source

+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + + + + +

stringifier(node, builder) → {void}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
node + + +Node + + + +

start node for stringifing. Usually Root.

builder + + +builder + + + +

function to concatenate CSS from node’s parts + or generate string and source map

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + +

syntax

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parse + + +parser + + + +

function to generate AST by string

stringify + + +stringifier + + + +

function to generate string by AST

+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + +

toString

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
toString + + +function + + + +
+ + + + + + + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 000000000..1d0a49893 --- /dev/null +++ b/index.html @@ -0,0 +1,64 @@ + + + + + Home - Documentation + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/input.es6.html b/input.es6.html new file mode 100644 index 000000000..9cd2fa2a7 --- /dev/null +++ b/input.es6.html @@ -0,0 +1,223 @@ + + + + + input.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

input.es6

+ + + + + + + +
+
+
import CssSyntaxError from './css-syntax-error';
+import PreviousMap    from './previous-map';
+
+import path from 'path';
+
+let sequence = 0;
+
+/**
+ * @typedef  {object} filePosition
+ * @property {string} file   - path to file
+ * @property {number} line   - source line in file
+ * @property {number} column - source column in file
+ */
+
+/**
+ * Represents the source CSS.
+ *
+ * @example
+ * const root  = postcss.parse(css, { from: file });
+ * const input = root.source.input;
+ */
+class Input {
+
+    /**
+     * @param {string} css    - input CSS source
+     * @param {object} [opts] - {@link Processor#process} options
+     */
+    constructor(css, opts = { }) {
+        /**
+         * @member {string} - input CSS source
+         *
+         * @example
+         * const input = postcss.parse('a{}', { from: file }).input;
+         * input.css //=> "a{}";
+         */
+        this.css = css.toString();
+
+        if ( this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE' ) {
+            this.css = this.css.slice(1);
+        }
+
+        if ( opts.from ) {
+            if ( /^\w+:\/\//.test(opts.from) ) {
+                /**
+                 * @member {string} - The absolute path to the CSS source file
+                 *                    defined with the `from` option.
+                 *
+                 * @example
+                 * const root = postcss.parse(css, { from: 'a.css' });
+                 * root.source.input.file //=> '/home/ai/a.css'
+                 */
+                this.file = opts.from;
+            } else {
+                this.file = path.resolve(opts.from);
+            }
+        }
+
+        let map = new PreviousMap(this.css, opts);
+        if ( map.text ) {
+            /**
+             * @member {PreviousMap} - The input source map passed from
+             *                         a compilation step before PostCSS
+             *                         (for example, from Sass compiler).
+             *
+             * @example
+             * root.source.input.map.consumer().sources //=> ['a.sass']
+             */
+            this.map = map;
+            let file = map.consumer().file;
+            if ( !this.file && file ) this.file = this.mapResolve(file);
+        }
+
+        if ( !this.file ) {
+            sequence += 1;
+            /**
+             * @member {string} - The unique ID of the CSS source. It will be
+             *                    created if `from` option is not provided
+             *                    (because PostCSS does not know the file path).
+             *
+             * @example
+             * const root = postcss.parse(css);
+             * root.source.input.file //=> undefined
+             * root.source.input.id   //=> "<input css 1>"
+             */
+            this.id   = '<input css ' + sequence + '>';
+        }
+        if ( this.map ) this.map.file = this.from;
+    }
+
+    error(message, line, column, opts = { }) {
+        let result;
+        let origin = this.origin(line, column);
+        if ( origin ) {
+            result = new CssSyntaxError(message, origin.line, origin.column,
+                origin.source, origin.file, opts.plugin);
+        } else {
+            result = new CssSyntaxError(message, line, column,
+                this.css, this.file, opts.plugin);
+        }
+
+        result.input = { line, column, source: this.css };
+        if ( this.file ) result.input.file = this.file;
+
+        return result;
+    }
+
+    /**
+     * Reads the input source map and returns a symbol position
+     * in the input source (e.g., in a Sass file that was compiled
+     * to CSS before being passed to PostCSS).
+     *
+     * @param {number} line   - line in input CSS
+     * @param {number} column - column in input CSS
+     *
+     * @return {filePosition} position in input source
+     *
+     * @example
+     * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
+     */
+    origin(line, column) {
+        if ( !this.map ) return false;
+        let consumer = this.map.consumer();
+
+        let from = consumer.originalPositionFor({ line, column });
+        if ( !from.source ) return false;
+
+        let result = {
+            file:   this.mapResolve(from.source),
+            line:   from.line,
+            column: from.column
+        };
+
+        let source = consumer.sourceContentFor(from.source);
+        if ( source ) result.source = source;
+
+        return result;
+    }
+
+    mapResolve(file) {
+        if ( /^\w+:\/\//.test(file) ) {
+            return file;
+        } else {
+            return path.resolve(this.map.consumer().sourceRoot || '.', file);
+        }
+    }
+
+    /**
+     * The CSS source identifier. Contains {@link Input#file} if the user
+     * set the `from` option, or {@link Input#id} if they did not.
+     * @type {string}
+     *
+     * @example
+     * const root = postcss.parse(css, { from: 'a.css' });
+     * root.source.input.from //=> "/home/ai/a.css"
+     *
+     * const root = postcss.parse(css);
+     * root.source.input.from //=> "<input css 1>"
+     */
+    get from() {
+        return this.file || this.id;
+    }
+
+}
+
+export default Input;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/lazy-result.es6.html b/lazy-result.es6.html new file mode 100644 index 000000000..f7d491bdb --- /dev/null +++ b/lazy-result.es6.html @@ -0,0 +1,418 @@ + + + + + lazy-result.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

lazy-result.es6

+ + + + + + + +
+
+
import MapGenerator from './map-generator';
+import stringify    from './stringify';
+import warnOnce     from './warn-once';
+import Result       from './result';
+import parse        from './parse';
+
+function isPromise(obj) {
+    return typeof obj === 'object' && typeof obj.then === 'function';
+}
+
+/**
+ * @callback onFulfilled
+ * @param {Result} result
+ */
+
+/**
+ * @callback onRejected
+ * @param {Error} error
+ */
+
+/**
+ * A Promise proxy for the result of PostCSS transformations.
+ *
+ * A `LazyResult` instance is returned by {@link Processor#process}.
+ *
+ * @example
+ * const lazy = postcss([cssnext]).process(css);
+ */
+class LazyResult {
+
+    constructor(processor, css, opts) {
+        this.stringified = false;
+        this.processed   = false;
+
+        let root;
+        if ( typeof css === 'object' && css.type === 'root' ) {
+            root = css;
+        } else if ( css instanceof LazyResult || css instanceof Result ) {
+            root = css.root;
+            if ( css.map ) {
+                if ( typeof opts.map === 'undefined' ) opts.map = { };
+                if ( !opts.map.inline ) opts.map.inline = false;
+                opts.map.prev = css.map;
+            }
+        } else {
+            let parser = parse;
+            if ( opts.syntax )  parser = opts.syntax.parse;
+            if ( opts.parser )  parser = opts.parser;
+            if ( parser.parse ) parser = parser.parse;
+
+            try {
+                root = parser(css, opts);
+            } catch (error) {
+                this.error = error;
+            }
+        }
+
+        this.result = new Result(processor, root, opts);
+    }
+
+    /**
+     * Returns a {@link Processor} instance, which will be used
+     * for CSS transformations.
+     * @type {Processor}
+     */
+    get processor() {
+        return this.result.processor;
+    }
+
+    /**
+     * Options from the {@link Processor#process} call.
+     * @type {processOptions}
+     */
+    get opts() {
+        return this.result.opts;
+    }
+
+    /**
+     * Processes input CSS through synchronous plugins, converts `Root`
+     * to a CSS string and returns {@link Result#css}.
+     *
+     * This property will only work with synchronous plugins.
+     * If the processor contains any asynchronous plugins
+     * it will throw an error. This is why this method is only
+     * for debug purpose, you should always use {@link LazyResult#then}.
+     *
+     * @type {string}
+     * @see Result#css
+     */
+    get css() {
+        return this.stringify().css;
+    }
+
+    /**
+     * An alias for the `css` property. Use it with syntaxes
+     * that generate non-CSS output.
+     *
+     * This property will only work with synchronous plugins.
+     * If the processor contains any asynchronous plugins
+     * it will throw an error. This is why this method is only
+     * for debug purpose, you should always use {@link LazyResult#then}.
+     *
+     * @type {string}
+     * @see Result#content
+     */
+    get content() {
+        return this.stringify().content;
+    }
+
+    /**
+     * Processes input CSS through synchronous plugins
+     * and returns {@link Result#map}.
+     *
+     * This property will only work with synchronous plugins.
+     * If the processor contains any asynchronous plugins
+     * it will throw an error. This is why this method is only
+     * for debug purpose, you should always use {@link LazyResult#then}.
+     *
+     * @type {SourceMapGenerator}
+     * @see Result#map
+     */
+    get map() {
+        return this.stringify().map;
+    }
+
+    /**
+     * Processes input CSS through synchronous plugins
+     * and returns {@link Result#root}.
+     *
+     * This property will only work with synchronous plugins. If the processor
+     * contains any asynchronous plugins it will throw an error.
+     *
+     * This is why this method is only for debug purpose,
+     * you should always use {@link LazyResult#then}.
+     *
+     * @type {Root}
+     * @see Result#root
+     */
+    get root() {
+        return this.sync().root;
+    }
+
+    /**
+     * Processes input CSS through synchronous plugins
+     * and returns {@link Result#messages}.
+     *
+     * This property will only work with synchronous plugins. If the processor
+     * contains any asynchronous plugins it will throw an error.
+     *
+     * This is why this method is only for debug purpose,
+     * you should always use {@link LazyResult#then}.
+     *
+     * @type {Message[]}
+     * @see Result#messages
+     */
+    get messages() {
+        return this.sync().messages;
+    }
+
+    /**
+     * Processes input CSS through synchronous plugins
+     * and calls {@link Result#warnings()}.
+     *
+     * @return {Warning[]} warnings from plugins
+     */
+    warnings() {
+        return this.sync().warnings();
+    }
+
+    /**
+     * Alias for the {@link LazyResult#css} property.
+     *
+     * @example
+     * lazy + '' === lazy.css;
+     *
+     * @return {string} output CSS
+     */
+    toString() {
+        return this.css;
+    }
+
+    /**
+     * Processes input CSS through synchronous and asynchronous plugins
+     * and calls `onFulfilled` with a Result instance. If a plugin throws
+     * an error, the `onRejected` callback will be executed.
+     *
+     * It implements standard Promise API.
+     *
+     * @param {onFulfilled} onFulfilled - callback will be executed
+     *                                    when all plugins will finish work
+     * @param {onRejected}  onRejected  - callback will be execited on any error
+     *
+     * @return {Promise} Promise API to make queue
+     *
+     * @example
+     * postcss([cssnext]).process(css).then(result => {
+     *   console.log(result.css);
+     * });
+     */
+    then(onFulfilled, onRejected) {
+        return this.async().then(onFulfilled, onRejected);
+    }
+
+    /**
+     * Processes input CSS through synchronous and asynchronous plugins
+     * and calls onRejected for each error thrown in any plugin.
+     *
+     * It implements standard Promise API.
+     *
+     * @param {onRejected} onRejected - callback will be execited on any error
+     *
+     * @return {Promise} Promise API to make queue
+     *
+     * @example
+     * postcss([cssnext]).process(css).then(result => {
+     *   console.log(result.css);
+     * }).catch(error => {
+     *   console.error(error);
+     * });
+     */
+    catch(onRejected) {
+        return this.async().catch(onRejected);
+    }
+
+    handleError(error, plugin) {
+        try {
+            this.error = error;
+            if ( error.name === 'CssSyntaxError' && !error.plugin ) {
+                error.plugin = plugin.postcssPlugin;
+                error.setMessage();
+            } else if ( plugin.postcssVersion ) {
+                let pluginName = plugin.postcssPlugin;
+                let pluginVer  = plugin.postcssVersion;
+                let runtimeVer = this.result.processor.version;
+                let a = pluginVer.split('.');
+                let b = runtimeVer.split('.');
+
+                if ( a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1]) ) {
+                    warnOnce('Your current PostCSS version ' +
+                             'is ' + runtimeVer + ', but ' + pluginName + ' ' +
+                             'uses ' + pluginVer + '. Perhaps this is ' +
+                             'the source of the error below.');
+                }
+            }
+        } catch (err) {
+            if ( console && console.error ) console.error(err);
+        }
+    }
+
+    asyncTick(resolve, reject) {
+        if ( this.plugin >= this.processor.plugins.length ) {
+            this.processed = true;
+            return resolve();
+        }
+
+        try {
+            let plugin  = this.processor.plugins[this.plugin];
+            let promise = this.run(plugin);
+            this.plugin += 1;
+
+            if ( isPromise(promise) ) {
+                promise.then( () => {
+                    this.asyncTick(resolve, reject);
+                }).catch( error => {
+                    this.handleError(error, plugin);
+                    this.processed = true;
+                    reject(error);
+                });
+            } else {
+                this.asyncTick(resolve, reject);
+            }
+
+        } catch (error) {
+            this.processed = true;
+            reject(error);
+        }
+    }
+
+    async() {
+        if ( this.processed ) {
+            return new Promise( (resolve, reject) => {
+                if ( this.error ) {
+                    reject(this.error);
+                } else {
+                    resolve(this.stringify());
+                }
+            });
+        }
+        if ( this.processing ) {
+            return this.processing;
+        }
+
+        this.processing = new Promise( (resolve, reject) => {
+            if ( this.error ) return reject(this.error);
+            this.plugin = 0;
+            this.asyncTick(resolve, reject);
+        }).then( () => {
+            this.processed = true;
+            return this.stringify();
+        });
+
+        return this.processing;
+    }
+
+    sync() {
+        if ( this.processed ) return this.result;
+        this.processed = true;
+
+        if ( this.processing ) {
+            throw new Error(
+                'Use process(css).then(cb) to work with async plugins');
+        }
+
+        if ( this.error ) throw this.error;
+
+        for ( let plugin of this.result.processor.plugins ) {
+            let promise = this.run(plugin);
+            if ( isPromise(promise) ) {
+                throw new Error(
+                    'Use process(css).then(cb) to work with async plugins');
+            }
+        }
+
+        return this.result;
+    }
+
+    run(plugin) {
+        this.result.lastPlugin = plugin;
+
+        try {
+            return plugin(this.result.root, this.result);
+        } catch (error) {
+            this.handleError(error, plugin);
+            throw error;
+        }
+    }
+
+    stringify() {
+        if ( this.stringified ) return this.result;
+        this.stringified = true;
+
+        this.sync();
+
+        let opts = this.result.opts;
+        let str  = stringify;
+        if ( opts.syntax )      str = opts.syntax.stringify;
+        if ( opts.stringifier ) str = opts.stringifier;
+        if ( str.stringify )    str = str.stringify;
+
+        let map  = new MapGenerator(str, this.result.root, this.result.opts);
+        let data = map.generate();
+        this.result.css = data[0];
+        this.result.map = data[1];
+
+        return this.result;
+    }
+
+}
+
+export default LazyResult;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/list.es6.html b/list.es6.html new file mode 100644 index 000000000..6ac6dfb7c --- /dev/null +++ b/list.es6.html @@ -0,0 +1,148 @@ + + + + + list.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

list.es6

+ + + + + + + +
+
+
/**
+ * Contains helpers for safely splitting lists of CSS values,
+ * preserving parentheses and quotes.
+ *
+ * @example
+ * const list = postcss.list;
+ *
+ * @namespace list
+ */
+let list = {
+
+    split(string, separators, last) {
+        let array   = [];
+        let current = '';
+        let split   = false;
+
+        let func    = 0;
+        let quote   = false;
+        let escape  = false;
+
+        for ( let i = 0; i < string.length; i++ ) {
+            let letter = string[i];
+
+            if ( quote ) {
+                if ( escape ) {
+                    escape = false;
+                } else if ( letter === '\\' ) {
+                    escape = true;
+                } else if ( letter === quote ) {
+                    quote = false;
+                }
+            } else if ( letter === '"' || letter === '\'' ) {
+                quote = letter;
+            } else if ( letter === '(' ) {
+                func += 1;
+            } else if ( letter === ')' ) {
+                if ( func > 0 ) func -= 1;
+            } else if ( func === 0 ) {
+                if ( separators.indexOf(letter) !== -1 ) split = true;
+            }
+
+            if ( split ) {
+                if ( current !== '' ) array.push(current.trim());
+                current = '';
+                split   = false;
+            } else {
+                current += letter;
+            }
+        }
+
+        if ( last || current !== '' ) array.push(current.trim());
+        return array;
+    },
+
+    /**
+     * Safely splits space-separated values (such as those for `background`,
+     * `border-radius`, and other shorthand properties).
+     *
+     * @param {string} string - space-separated values
+     *
+     * @return {string[]} splitted values
+     *
+     * @example
+     * postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
+     */
+    space(string) {
+        let spaces = [' ', '\n', '\t'];
+        return list.split(string, spaces);
+    },
+
+    /**
+     * Safely splits comma-separated values (such as those for `transition-*`
+     * and `background` properties).
+     *
+     * @param {string} string - comma-separated values
+     *
+     * @return {string[]} splitted values
+     *
+     * @example
+     * postcss.list.comma('black, linear-gradient(white, black)')
+     * //=> ['black', 'linear-gradient(white, black)']
+     */
+    comma(string) {
+        let comma = ',';
+        return list.split(string, [comma], true);
+    }
+
+};
+
+export default list;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/list.html b/list.html new file mode 100644 index 000000000..791705571 --- /dev/null +++ b/list.html @@ -0,0 +1,473 @@ + + + + + list - Documentation + + + + + + + + + + + + + + + + +
+ +

list

+ + + + + + + +
+ +
+ +

+ list +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Contains helpers for safely splitting lists of CSS values, +preserving parentheses and quotes.

+ + + +

Example

+ +
const list = postcss.list;
+ + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

(static) comma(string) → {Array.<string>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Safely splits comma-separated values (such as those for transition-* +and background properties).

+
+ + + + + + + + + +
Example
+ +
postcss.list.comma('black, linear-gradient(white, black)')
+//=> ['black', 'linear-gradient(white, black)']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
string + + +string + + + +

comma-separated values

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

splitted values

+
+ + + +
+
+ Type +
+
+ +Array.<string> + + +
+
+ + + + + + + + + +

(static) space(string) → {Array.<string>}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Safely splits space-separated values (such as those for background, +border-radius, and other shorthand properties).

+
+ + + + + + + + + +
Example
+ +
postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
string + + +string + + + +

space-separated values

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

splitted values

+
+ + + +
+
+ Type +
+
+ +Array.<string> + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/node.es6.html b/node.es6.html new file mode 100644 index 000000000..27ef661c2 --- /dev/null +++ b/node.es6.html @@ -0,0 +1,633 @@ + + + + + node.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

node.es6

+ + + + + + + +
+
+
import CssSyntaxError from './css-syntax-error';
+import Stringifier    from './stringifier';
+import stringify      from './stringify';
+import warnOnce       from './warn-once';
+
+/**
+ * @typedef {object} position
+ * @property {number} line   - source line in file
+ * @property {number} column - source column in file
+ */
+
+/**
+ * @typedef {object} source
+ * @property {Input} input    - {@link Input} with input file
+ * @property {position} start - The starting position of the node’s source
+ * @property {position} end   - The ending position of the node’s source
+ */
+
+let cloneNode = function (obj, parent) {
+    let cloned = new obj.constructor();
+
+    for ( let i in obj ) {
+        if ( !obj.hasOwnProperty(i) ) continue;
+        let value = obj[i];
+        let type  = typeof value;
+
+        if ( i === 'parent' && type === 'object' ) {
+            if (parent) cloned[i] = parent;
+        } else if ( i === 'source' ) {
+            cloned[i] = value;
+        } else if ( value instanceof Array ) {
+            cloned[i] = value.map( j => cloneNode(j, cloned) );
+        } else if ( i !== 'before'  && i !== 'after' &&
+                    i !== 'between' && i !== 'semicolon' ) {
+            if ( type === 'object' && value !== null ) value = cloneNode(value);
+            cloned[i] = value;
+        }
+    }
+
+    return cloned;
+};
+
+/**
+ * All node classes inherit the following common methods.
+ *
+ * @abstract
+ * @ignore
+ */
+class Node {
+
+    /**
+     * @param {object} [defaults] - value for node properties
+     */
+    constructor(defaults = { }) {
+        this.raws = { };
+        for ( let name in defaults ) {
+            this[name] = defaults[name];
+        }
+    }
+
+    /**
+     * Returns a CssSyntaxError instance containing the original position
+     * of the node in the source, showing line and column numbers and also
+     * a small excerpt to facilitate debugging.
+     *
+     * If present, an input source map will be used to get the original position
+     * of the source, even from a previous compilation step
+     * (e.g., from Sass compilation).
+     *
+     * This method produces very useful error messages.
+     *
+     * @param {string} message     - error description
+     * @param {object} [opts]      - options
+     * @param {string} opts.plugin - plugin name that created this error.
+     *                               PostCSS will set it automatically.
+     * @param {string} opts.word   - a word inside a node’s string that should
+     *                               be highlighted as the source of the error
+     * @param {number} opts.index  - an index inside a node’s string that should
+     *                               be highlighted as the source of the error
+     *
+     * @return {CssSyntaxError} error object to throw it
+     *
+     * @example
+     * if ( !variables[name] ) {
+     *   throw decl.error('Unknown variable ' + name, { word: name });
+     *   // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+     *   //   color: $black
+     *   // a
+     *   //          ^
+     *   //   background: white
+     * }
+     */
+    error(message, opts = { }) {
+        if ( this.source ) {
+            let pos = this.positionBy(opts);
+            return this.source.input.error(message, pos.line, pos.column, opts);
+        } else {
+            return new CssSyntaxError(message);
+        }
+    }
+
+    /**
+     * This method is provided as a convenience wrapper for {@link Result#warn}.
+     *
+     * @param {Result} result      - the {@link Result} instance
+     *                               that will receive the warning
+     * @param {string} text        - warning message
+     * @param {object} [opts]      - options
+     * @param {string} opts.plugin - plugin name that created this warning.
+     *                               PostCSS will set it automatically.
+     * @param {string} opts.word   - a word inside a node’s string that should
+     *                               be highlighted as the source of the warning
+     * @param {number} opts.index  - an index inside a node’s string that should
+     *                               be highlighted as the source of the warning
+     *
+     * @return {Warning} created warning object
+     *
+     * @example
+     * const plugin = postcss.plugin('postcss-deprecated', () => {
+     *   return (css, result) => {
+     *     css.walkDecls('bad', decl => {
+     *       decl.warn(result, 'Deprecated property bad');
+     *     });
+     *   };
+     * });
+     */
+    warn(result, text, opts) {
+        let data = { node: this };
+        for ( let i in opts ) data[i] = opts[i];
+        return result.warn(text, data);
+    }
+
+    /**
+     * Removes the node from its parent and cleans the parent properties
+     * from the node and its children.
+     *
+     * @example
+     * if ( decl.prop.match(/^-webkit-/) ) {
+     *   decl.remove();
+     * }
+     *
+     * @return {Node} node to make calls chain
+     */
+    remove() {
+        if ( this.parent ) {
+            this.parent.removeChild(this);
+        }
+        this.parent = undefined;
+        return this;
+    }
+
+    /**
+     * Returns a CSS string representing the node.
+     *
+     * @param {stringifier|syntax} [stringifier] - a syntax to use
+     *                                             in string generation
+     *
+     * @return {string} CSS string of this node
+     *
+     * @example
+     * postcss.rule({ selector: 'a' }).toString() //=> "a {}"
+     */
+    toString(stringifier = stringify) {
+        if ( stringifier.stringify ) stringifier = stringifier.stringify;
+        let result  = '';
+        stringifier(this, i => {
+            result += i;
+        });
+        return result;
+    }
+
+    /**
+     * Returns a clone of the node.
+     *
+     * The resulting cloned node and its (cloned) children will have
+     * a clean parent and code style properties.
+     *
+     * @param {object} [overrides] - new properties to override in the clone.
+     *
+     * @example
+     * const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+     * cloned.raws.before  //=> undefined
+     * cloned.parent       //=> undefined
+     * cloned.toString()   //=> -moz-transform: scale(0)
+     *
+     * @return {Node} clone of the node
+     */
+    clone(overrides = { }) {
+        let cloned = cloneNode(this);
+        for ( let name in overrides ) {
+            cloned[name] = overrides[name];
+        }
+        return cloned;
+    }
+
+    /**
+     * hortcut to clone the node and insert the resulting cloned node
+     * before the current node.
+     *
+     * @param {object} [overrides] - new properties to override in the clone.
+     *
+     * @example
+     * decl.cloneBefore({ prop: '-moz-' + decl.prop });
+     *
+     * @return {Node} - new node
+     */
+    cloneBefore(overrides = { }) {
+        let cloned = this.clone(overrides);
+        this.parent.insertBefore(this, cloned);
+        return cloned;
+    }
+
+    /**
+     * hortcut to clone the node and insert the resulting cloned node
+     * after the current node.
+     *
+     * @param {object} [overrides] - new properties to override in the clone.
+     *
+     * @return {Node} - new node
+     */
+    cloneAfter(overrides = { }) {
+        let cloned = this.clone(overrides);
+        this.parent.insertAfter(this, cloned);
+        return cloned;
+    }
+
+    /**
+     * Inserts node(s) before the current node and removes the current node.
+     *
+     * @param {...Node} nodes - node(s) to replace current one
+     *
+     * @example
+     * if ( atrule.name == 'mixin' ) {
+     *   atrule.replaceWith(mixinRules[atrule.params]);
+     * }
+     *
+     * @return {Node} current node to methods chain
+     */
+    replaceWith(...nodes) {
+        if (this.parent) {
+            for (let node of nodes) {
+                this.parent.insertBefore(this, node);
+            }
+
+            this.remove();
+        }
+
+        return this;
+    }
+
+    /**
+     * Removes the node from its current parent and inserts it
+     * at the end of `newParent`.
+     *
+     * This will clean the `before` and `after` code {@link Node#raws} data
+     * from the node and replace them with the indentation style of `newParent`.
+     * It will also clean the `between` property
+     * if `newParent` is in another {@link Root}.
+     *
+     * @param {Container} newParent - container node where the current node
+     *                                will be moved
+     *
+     * @example
+     * atrule.moveTo(atrule.root());
+     *
+     * @return {Node} current node to methods chain
+     */
+    moveTo(newParent) {
+        this.cleanRaws(this.root() === newParent.root());
+        this.remove();
+        newParent.append(this);
+        return this;
+    }
+
+    /**
+     * Removes the node from its current parent and inserts it into
+     * a new parent before `otherNode`.
+     *
+     * This will also clean the node’s code style properties just as it would
+     * in {@link Node#moveTo}.
+     *
+     * @param {Node} otherNode - node that will be before current node
+     *
+     * @return {Node} current node to methods chain
+     */
+    moveBefore(otherNode) {
+        this.cleanRaws(this.root() === otherNode.root());
+        this.remove();
+        otherNode.parent.insertBefore(otherNode, this);
+        return this;
+    }
+
+    /**
+     * Removes the node from its current parent and inserts it into
+     * a new parent after `otherNode`.
+     *
+     * This will also clean the node’s code style properties just as it would
+     * in {@link Node#moveTo}.
+     *
+     * @param {Node} otherNode - node that will be after current node
+     *
+     * @return {Node} current node to methods chain
+     */
+    moveAfter(otherNode) {
+        this.cleanRaws(this.root() === otherNode.root());
+        this.remove();
+        otherNode.parent.insertAfter(otherNode, this);
+        return this;
+    }
+
+    /**
+     * Returns the next child of the node’s parent.
+     * Returns `undefined` if the current node is the last child.
+     *
+     * @return {Node|undefined} next node
+     *
+     * @example
+     * if ( comment.text === 'delete next' ) {
+     *   const next = comment.next();
+     *   if ( next ) {
+     *     next.remove();
+     *   }
+     * }
+     */
+    next() {
+        let index = this.parent.index(this);
+        return this.parent.nodes[index + 1];
+    }
+
+    /**
+     * Returns the previous child of the node’s parent.
+     * Returns `undefined` if the current node is the first child.
+     *
+     * @return {Node|undefined} previous node
+     *
+     * @example
+     * const annotation = decl.prev();
+     * if ( annotation.type == 'comment' ) {
+     *  readAnnotation(annotation.text);
+     * }
+     */
+    prev() {
+        let index = this.parent.index(this);
+        return this.parent.nodes[index - 1];
+    }
+
+    toJSON() {
+        let fixed = { };
+
+        for ( let name in this ) {
+            if ( !this.hasOwnProperty(name) ) continue;
+            if ( name === 'parent' ) continue;
+            let value = this[name];
+
+            if ( value instanceof Array ) {
+                fixed[name] = value.map( i => {
+                    if ( typeof i === 'object' && i.toJSON ) {
+                        return i.toJSON();
+                    } else {
+                        return i;
+                    }
+                });
+            } else if ( typeof value === 'object' && value.toJSON ) {
+                fixed[name] = value.toJSON();
+            } else {
+                fixed[name] = value;
+            }
+        }
+
+        return fixed;
+    }
+
+    /**
+     * Returns a {@link Node#raws} value. If the node is missing
+     * the code style property (because the node was manually built or cloned),
+     * PostCSS will try to autodetect the code style property by looking
+     * at other nodes in the tree.
+     *
+     * @param {string} prop          - name of code style property
+     * @param {string} [defaultType] - name of default value, it can be missed
+     *                                 if the value is the same as prop
+     *
+     * @example
+     * const root = postcss.parse('a { background: white }');
+     * root.nodes[0].append({ prop: 'color', value: 'black' });
+     * root.nodes[0].nodes[1].raws.before   //=> undefined
+     * root.nodes[0].nodes[1].raw('before') //=> ' '
+     *
+     * @return {string} code style value
+     */
+    raw(prop, defaultType) {
+        let str = new Stringifier();
+        return str.raw(this, prop, defaultType);
+    }
+
+    /**
+     * Finds the Root instance of the node’s tree.
+     *
+     * @example
+     * root.nodes[0].nodes[0].root() === root
+     *
+     * @return {Root} root parent
+     */
+    root() {
+        let result = this;
+        while ( result.parent ) result = result.parent;
+        return result;
+    }
+
+    cleanRaws(keepBetween) {
+        delete this.raws.before;
+        delete this.raws.after;
+        if ( !keepBetween ) delete this.raws.between;
+    }
+
+    positionInside(index) {
+        let string = this.toString();
+        let column = this.source.start.column;
+        let line   = this.source.start.line;
+
+        for ( let i = 0; i < index; i++ ) {
+            if ( string[i] === '\n' ) {
+                column = 1;
+                line  += 1;
+            } else {
+                column += 1;
+            }
+        }
+
+        return { line, column };
+    }
+
+    positionBy(opts) {
+        let pos = this.source.start;
+        if ( opts.index ) {
+            pos = this.positionInside(opts.index);
+        } else if ( opts.word ) {
+            let index = this.toString().indexOf(opts.word);
+            if ( index !== -1 ) pos = this.positionInside(index);
+        }
+        return pos;
+    }
+
+    removeSelf() {
+        warnOnce('Node#removeSelf is deprecated. Use Node#remove.');
+        return this.remove();
+    }
+
+    replace(nodes) {
+        warnOnce('Node#replace is deprecated. Use Node#replaceWith');
+        return this.replaceWith(nodes);
+    }
+
+    style(own, detect) {
+        warnOnce('Node#style() is deprecated. Use Node#raw()');
+        return this.raw(own, detect);
+    }
+
+    cleanStyles(keepBetween) {
+        warnOnce('Node#cleanStyles() is deprecated. Use Node#cleanRaws()');
+        return this.cleanRaws(keepBetween);
+    }
+
+    get before() {
+        warnOnce('Node#before is deprecated. Use Node#raws.before');
+        return this.raws.before;
+    }
+
+    set before(val) {
+        warnOnce('Node#before is deprecated. Use Node#raws.before');
+        this.raws.before = val;
+    }
+
+    get between() {
+        warnOnce('Node#between is deprecated. Use Node#raws.between');
+        return this.raws.between;
+    }
+
+    set between(val) {
+        warnOnce('Node#between is deprecated. Use Node#raws.between');
+        this.raws.between = val;
+    }
+
+    /**
+     * @memberof Node#
+     * @member {string} type - String representing the node’s type.
+     *                         Possible values are `root`, `atrule`, `rule`,
+     *                         `decl`, or `comment`.
+     *
+     * @example
+     * postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
+     */
+
+    /**
+     * @memberof Node#
+     * @member {Container} parent - the node’s parent node.
+     *
+     * @example
+     * root.nodes[0].parent == root;
+     */
+
+    /**
+     * @memberof Node#
+     * @member {source} source - the input source of the node
+     *
+     * The property is used in source map generation.
+     *
+     * If you create a node manually (e.g., with `postcss.decl()`),
+     * that node will not have a `source` property and will be absent
+     * from the source map. For this reason, the plugin developer should
+     * consider cloning nodes to create new ones (in which case the new node’s
+     * source will reference the original, cloned node) or setting
+     * the `source` property manually.
+     *
+     * ```js
+     * // Bad
+     * const prefixed = postcss.decl({
+     *   prop: '-moz-' + decl.prop,
+     *   value: decl.value
+     * });
+     *
+     * // Good
+     * const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
+     * ```
+     *
+     * ```js
+     * if ( atrule.name == 'add-link' ) {
+     *   const rule = postcss.rule({ selector: 'a', source: atrule.source });
+     *   atrule.parent.insertBefore(atrule, rule);
+     * }
+     * ```
+     *
+     * @example
+     * decl.source.input.from //=> '/home/ai/a.sass'
+     * decl.source.start      //=> { line: 10, column: 2 }
+     * decl.source.end        //=> { line: 10, column: 12 }
+     */
+
+    /**
+     * @memberof Node#
+     * @member {object} raws - Information to generate byte-to-byte equal
+     *                         node string as it was in the origin input.
+     *
+     * Every parser saves its own properties,
+     * but the default CSS parser uses:
+     *
+     * * `before`: the space symbols before the node. It also stores `*`
+     *   and `_` symbols before the declaration (IE hack).
+     * * `after`: the space symbols after the last child of the node
+     *   to the end of the node.
+     * * `between`: the symbols between the property and value
+     *   for declarations, selector and `{` for rules, or last parameter
+     *   and `{` for at-rules.
+     * * `semicolon`: contains true if the last child has
+     *   an (optional) semicolon.
+     * * `afterName`: the space between the at-rule name and its parameters.
+     * * `left`: the space symbols between `/*` and the comment’s text.
+     * * `right`: the space symbols between the comment’s text
+     *   and <code>*&#47;</code>.
+     * * `important`: the content of the important statement,
+     *   if it is not just `!important`.
+     *
+     * PostCSS cleans selectors, declaration values and at-rule parameters
+     * from comments and extra spaces, but it stores origin content in raws
+     * properties. As such, if you don’t change a declaration’s value,
+     * PostCSS will use the raw value with comments.
+     *
+     * @example
+     * const root = postcss.parse('a {\n  color:black\n}')
+     * root.first.first.raws //=> { before: '\n  ', between: ':' }
+     */
+
+}
+
+export default Node;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/postcss.es6.html b/postcss.es6.html new file mode 100644 index 000000000..764d632ce --- /dev/null +++ b/postcss.es6.html @@ -0,0 +1,299 @@ + + + + + postcss.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

postcss.es6

+ + + + + + + +
+
+
import Declaration from './declaration';
+import Processor   from './processor';
+import stringify   from './stringify';
+import Comment     from './comment';
+import AtRule      from './at-rule';
+import vendor      from './vendor';
+import parse       from './parse';
+import list        from './list';
+import Rule        from './rule';
+import Root        from './root';
+
+/**
+ * Create a new {@link Processor} instance that will apply `plugins`
+ * as CSS processors.
+ *
+ * @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
+ *        plugins. See {@link Processor#use} for plugin format.
+ *
+ * @return {Processor} Processor to process multiple CSS
+ *
+ * @example
+ * import postcss from 'postcss';
+ *
+ * postcss(plugins).process(css, { from, to }).then(result => {
+ *   console.log(result.css);
+ * });
+ *
+ * @namespace postcss
+ */
+function postcss(...plugins) {
+    if ( plugins.length === 1 && Array.isArray(plugins[0]) ) {
+        plugins = plugins[0];
+    }
+    return new Processor(plugins);
+}
+
+/**
+ * Creates a PostCSS plugin with a standard API.
+ *
+ * The newly-wrapped function will provide both the name and PostCSS
+ * version of the plugin.
+ *
+ * ```js
+ *  const processor = postcss([replace]);
+ *  processor.plugins[0].postcssPlugin  //=> 'postcss-replace'
+ *  processor.plugins[0].postcssVersion //=> '5.1.0'
+ * ```
+ *
+ * The plugin function receives 2 arguments: {@link Root}
+ * and {@link Result} instance. The function should mutate the provided
+ * `Root` node. Alternatively, you can create a new `Root` node
+ * and override the `result.root` property.
+ *
+ * ```js
+ * const cleaner = postcss.plugin('postcss-cleaner', () => {
+ *   return (css, result) => {
+ *     result.root = postcss.root();
+ *   };
+ * });
+ * ```
+ *
+ * As a convenience, plugins also expose a `process` method so that you can use
+ * them as standalone tools.
+ *
+ * ```js
+ * cleaner.process(css, options);
+ * // This is equivalent to:
+ * postcss([ cleaner(options) ]).process(css);
+ * ```
+ *
+ * Asynchronous plugins should return a `Promise` instance.
+ *
+ * ```js
+ * postcss.plugin('postcss-import', () => {
+ *   return (css, result) => {
+ *     return new Promise( (resolve, reject) => {
+ *       fs.readFile('base.css', (base) => {
+ *         css.prepend(base);
+ *         resolve();
+ *       });
+ *     });
+ *   };
+ * });
+ * ```
+ *
+ * Add warnings using the {@link Node#warn} method.
+ * Send data to other plugins using the {@link Result#messages} array.
+ *
+ * ```js
+ * postcss.plugin('postcss-caniuse-test', () => {
+ *   return (css, result) => {
+ *     css.walkDecls(decl => {
+ *       if ( !caniuse.support(decl.prop) ) {
+ *         decl.warn(result, 'Some browsers do not support ' + decl.prop);
+ *       }
+ *     });
+ *   };
+ * });
+ * ```
+ *
+ * @param {string} name          - PostCSS plugin name. Same as in `name`
+ *                                 property in `package.json`. It will be saved
+ *                                 in `plugin.postcssPlugin` property.
+ * @param {function} initializer - will receive plugin options
+ *                                 and should return {@link pluginFunction}
+ *
+ * @return {Plugin} PostCSS plugin
+ */
+postcss.plugin = function plugin(name, initializer) {
+    let creator = function (...args) {
+        let transformer = initializer(...args);
+        transformer.postcssPlugin  = name;
+        transformer.postcssVersion = (new Processor()).version;
+        return transformer;
+    };
+
+    let cache;
+    Object.defineProperty(creator, 'postcss', {
+        get() {
+            if ( !cache ) cache = creator();
+            return cache;
+        }
+    });
+
+    creator.process = function (css, opts) {
+        return postcss([ creator(opts) ]).process(css, opts);
+    };
+
+    return creator;
+};
+
+/**
+ * Default function to convert a node tree into a CSS string.
+ *
+ * @param {Node} node       - start node for stringifing. Usually {@link Root}.
+ * @param {builder} builder - function to concatenate CSS from node’s parts
+ *                            or generate string and source map
+ *
+ * @return {void}
+ *
+ * @function
+ */
+postcss.stringify = stringify;
+
+/**
+ * Parses source css and returns a new {@link Root} node,
+ * which contains the source CSS nodes.
+ *
+ * @param {string|toString} css   - string with input CSS or any object
+ *                                  with toString() method, like a Buffer
+ * @param {processOptions} [opts] - options with only `from` and `map` keys
+ *
+ * @return {Root} PostCSS AST
+ *
+ * @example
+ * // Simple CSS concatenation with source map support
+ * const root1 = postcss.parse(css1, { from: file1 });
+ * const root2 = postcss.parse(css2, { from: file2 });
+ * root1.append(root2).toResult().css;
+ *
+ * @function
+ */
+postcss.parse = parse;
+
+/**
+ * @member {vendor} - Contains the {@link vendor} module.
+ *
+ * @example
+ * postcss.vendor.unprefixed('-moz-tab') //=> ['tab']
+ */
+postcss.vendor = vendor;
+
+/**
+ * @member {list} - Contains the {@link list} module.
+ *
+ * @example
+ * postcss.list.space('5px calc(10% + 5px)') //=> ['5px', 'calc(10% + 5px)']
+ */
+postcss.list = list;
+
+/**
+ * Creates a new {@link Comment} node.
+ *
+ * @param {object} [defaults] - properties for the new node.
+ *
+ * @return {Comment} new Comment node
+ *
+ * @example
+ * postcss.comment({ text: 'test' })
+ */
+postcss.comment = defaults => new Comment(defaults);
+
+/**
+ * Creates a new {@link AtRule} node.
+ *
+ * @param {object} [defaults] - properties for the new node.
+ *
+ * @return {AtRule} new AtRule node
+ *
+ * @example
+ * postcss.atRule({ name: 'charset' }).toString() //=> "@charset"
+ */
+postcss.atRule = defaults => new AtRule(defaults);
+
+/**
+ * Creates a new {@link Declaration} node.
+ *
+ * @param {object} [defaults] - properties for the new node.
+ *
+ * @return {Declaration} new Declaration node
+ *
+ * @example
+ * postcss.decl({ prop: 'color', value: 'red' }).toString() //=> "color: red"
+ */
+postcss.decl = defaults => new Declaration(defaults);
+
+/**
+ * Creates a new {@link Rule} node.
+ *
+ * @param {object} [defaults] - properties for the new node.
+ *
+ * @return {AtRule} new Rule node
+ *
+ * @example
+ * postcss.rule({ selector: 'a' }).toString() //=> "a {\n}"
+ */
+postcss.rule = defaults => new Rule(defaults);
+
+/**
+ * Creates a new {@link Root} node.
+ *
+ * @param {object} [defaults] - properties for the new node.
+ *
+ * @return {Root} new Root node
+ *
+ * @example
+ * postcss.root({ after: '\n' }).toString() //=> "\n"
+ */
+postcss.root = defaults => new Root(defaults);
+
+export default postcss;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/postcss.html b/postcss.html new file mode 100644 index 000000000..e7a0a76bb --- /dev/null +++ b/postcss.html @@ -0,0 +1,1778 @@ + + + + + postcss - Documentation + + + + + + + + + + + + + + + + +
+ +

postcss

+ + + + + + + +
+ +
+ +

+ postcss +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Create a new Processor instance that will apply plugins +as CSS processors.

+ + + +

Example

+ +
import postcss from 'postcss';
+
+postcss(plugins).process(css, { from, to }).then(result => {
+  console.log(result.css);
+});
+ + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) list :list

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Contains the list module.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
postcss.list.space('5px calc(10% + 5px)') //=> ['5px', 'calc(10% + 5px)']
+ + + + + +

(static) vendor :vendor

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Contains the vendor module.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
postcss.vendor.unprefixed('-moz-tab') //=> ['tab']
+ + + + + + + +

Methods

+ + + + + + +

(static) atRule(defaultsopt) → {AtRule}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Creates a new AtRule node.

+
+ + + + + + + + + +
Example
+ +
postcss.atRule({ name: 'charset' }).toString() //=> "@charset"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
defaults + + +object + + + + + + <optional>
+ + + + + +

properties for the new node.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

new AtRule node

+
+ + + +
+
+ Type +
+
+ +AtRule + + +
+
+ + + + + + + + + +

(static) comment(defaultsopt) → {Comment}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Creates a new Comment node.

+
+ + + + + + + + + +
Example
+ +
postcss.comment({ text: 'test' })
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
defaults + + +object + + + + + + <optional>
+ + + + + +

properties for the new node.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

new Comment node

+
+ + + +
+
+ Type +
+
+ +Comment + + +
+
+ + + + + + + + + +

(static) decl(defaultsopt) → {Declaration}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Creates a new Declaration node.

+
+ + + + + + + + + +
Example
+ +
postcss.decl({ prop: 'color', value: 'red' }).toString() //=> "color: red"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
defaults + + +object + + + + + + <optional>
+ + + + + +

properties for the new node.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

new Declaration node

+
+ + + +
+
+ Type +
+
+ +Declaration + + +
+
+ + + + + + + + + +

(static) parse(css, optsopt) → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Parses source css and returns a new Root node, +which contains the source CSS nodes.

+
+ + + + + + + + + +
Example
+ +
// Simple CSS concatenation with source map support
+const root1 = postcss.parse(css1, { from: file1 });
+const root2 = postcss.parse(css2, { from: file2 });
+root1.append(root2).toResult().css;
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
css + + +string +| + +toString + + + + + + + + + +

string with input CSS or any object + with toString() method, like a Buffer

opts + + +processOptions + + + + + + <optional>
+ + + + + +

options with only from and map keys

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

PostCSS AST

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

(static) plugin(name, initializer) → {Plugin}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Creates a PostCSS plugin with a standard API.

+

The newly-wrapped function will provide both the name and PostCSS +version of the plugin.

+
 const processor = postcss([replace]);
+ processor.plugins[0].postcssPlugin  //=> 'postcss-replace'
+ processor.plugins[0].postcssVersion //=> '5.1.0'

The plugin function receives 2 arguments: Root +and Result instance. The function should mutate the provided +Root node. Alternatively, you can create a new Root node +and override the result.root property.

+
const cleaner = postcss.plugin('postcss-cleaner', () => {
+  return (css, result) => {
+    result.root = postcss.root();
+  };
+});

As a convenience, plugins also expose a process method so that you can use +them as standalone tools.

+
cleaner.process(css, options);
+// This is equivalent to:
+postcss([ cleaner(options) ]).process(css);

Asynchronous plugins should return a Promise instance.

+
postcss.plugin('postcss-import', () => {
+  return (css, result) => {
+    return new Promise( (resolve, reject) => {
+      fs.readFile('base.css', (base) => {
+        css.prepend(base);
+        resolve();
+      });
+    });
+  };
+});

Add warnings using the Node#warn method. +Send data to other plugins using the Result#messages array.

+
postcss.plugin('postcss-caniuse-test', () => {
+  return (css, result) => {
+    css.walkDecls(decl => {
+      if ( !caniuse.support(decl.prop) ) {
+        decl.warn(result, 'Some browsers do not support ' + decl.prop);
+      }
+    });
+  };
+});
+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

PostCSS plugin name. Same as in name + property in package.json. It will be saved + in plugin.postcssPlugin property.

initializer + + +function + + + +

will receive plugin options + and should return pluginFunction

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

PostCSS plugin

+
+ + + +
+
+ Type +
+
+ +Plugin + + +
+
+ + + + + + + + + +

(static) root(defaultsopt) → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Creates a new Root node.

+
+ + + + + + + + + +
Example
+ +
postcss.root({ after: '\n' }).toString() //=> "\n"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
defaults + + +object + + + + + + <optional>
+ + + + + +

properties for the new node.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

new Root node

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

(static) rule(defaultsopt) → {AtRule}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Creates a new Rule node.

+
+ + + + + + + + + +
Example
+ +
postcss.rule({ selector: 'a' }).toString() //=> "a {\n}"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
defaults + + +object + + + + + + <optional>
+ + + + + +

properties for the new node.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

new Rule node

+
+ + + +
+
+ Type +
+
+ +AtRule + + +
+
+ + + + + + + + + +

(static) stringify(node, builder) → {void}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Default function to convert a node tree into a CSS string.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
node + + +Node + + + +

start node for stringifing. Usually Root.

builder + + +builder + + + +

function to concatenate CSS from node’s parts + or generate string and source map

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/previous-map.es6.html b/previous-map.es6.html new file mode 100644 index 000000000..aeedef9a2 --- /dev/null +++ b/previous-map.es6.html @@ -0,0 +1,202 @@ + + + + + previous-map.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

previous-map.es6

+ + + + + + + +
+
+
import { Base64 } from 'js-base64';
+import   mozilla  from 'source-map';
+import   path     from 'path';
+import   fs       from 'fs';
+
+/**
+ * Source map information from input CSS.
+ * For example, source map after Sass compiler.
+ *
+ * This class will automatically find source map in input CSS or in file system
+ * near input file (according `from` option).
+ *
+ * @example
+ * const root = postcss.parse(css, { from: 'a.sass.css' });
+ * root.input.map //=> PreviousMap
+ */
+class PreviousMap {
+
+    /**
+     * @param {string}         css    - input CSS source
+     * @param {processOptions} [opts] - {@link Processor#process} options
+     */
+    constructor(css, opts) {
+        this.loadAnnotation(css);
+        /**
+         * @member {boolean} - Was source map inlined by data-uri to input CSS.
+         */
+        this.inline = this.startWith(this.annotation, 'data:');
+
+        let prev = opts.map ? opts.map.prev : undefined;
+        let text = this.loadMap(opts.from, prev);
+        if ( text ) this.text = text;
+    }
+
+    /**
+     * Create a instance of `SourceMapGenerator` class
+     * from the `source-map` library to work with source map information.
+     *
+     * It is lazy method, so it will create object only on first call
+     * and then it will use cache.
+     *
+     * @return {SourceMapGenerator} object woth source map information
+     */
+    consumer() {
+        if ( !this.consumerCache ) {
+            this.consumerCache = new mozilla.SourceMapConsumer(this.text);
+        }
+        return this.consumerCache;
+    }
+
+    /**
+     * Does source map contains `sourcesContent` with input source text.
+     *
+     * @return {boolean} Is `sourcesContent` present
+     */
+    withContent() {
+        return !!(this.consumer().sourcesContent &&
+                  this.consumer().sourcesContent.length > 0);
+    }
+
+    startWith(string, start) {
+        if ( !string ) return false;
+        return string.substr(0, start.length) === start;
+    }
+
+    loadAnnotation(css) {
+        let match = css.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);
+        if ( match ) this.annotation = match[1].trim();
+    }
+
+    decodeInline(text) {
+        let utfd64 = 'data:application/json;charset=utf-8;base64,';
+        let utf64  = 'data:application/json;charset=utf8;base64,';
+        let b64    = 'data:application/json;base64,';
+        let uri    = 'data:application/json,';
+
+        if ( this.startWith(text, uri) ) {
+            return decodeURIComponent( text.substr(uri.length) );
+
+        } else if ( this.startWith(text, b64) ) {
+            return Base64.decode( text.substr(b64.length) );
+
+        } else if ( this.startWith(text, utf64) ) {
+            return Base64.decode( text.substr(utf64.length) );
+
+        } else if ( this.startWith(text, utfd64) ) {
+            return Base64.decode( text.substr(utfd64.length) );
+
+        } else {
+            let encoding = text.match(/data:application\/json;([^,]+),/)[1];
+            throw new Error('Unsupported source map encoding ' + encoding);
+        }
+    }
+
+    loadMap(file, prev) {
+        if ( prev === false ) return false;
+
+        if ( prev ) {
+            if ( typeof prev === 'string' ) {
+                return prev;
+            } else if ( typeof prev === 'function' ) {
+                let prevPath = prev(file);
+                if ( prevPath && fs.existsSync && fs.existsSync(prevPath) ) {
+                    return fs.readFileSync(prevPath, 'utf-8').toString().trim();
+                } else {
+                    throw new Error('Unable to load previous source map: ' +
+                    prevPath.toString());
+                }
+            } else if ( prev instanceof mozilla.SourceMapConsumer ) {
+                return mozilla.SourceMapGenerator
+                    .fromSourceMap(prev).toString();
+            } else if ( prev instanceof mozilla.SourceMapGenerator ) {
+                return prev.toString();
+            } else if ( this.isMap(prev) ) {
+                return JSON.stringify(prev);
+            } else {
+                throw new Error('Unsupported previous source map format: ' +
+                    prev.toString());
+            }
+
+        } else if ( this.inline ) {
+            return this.decodeInline(this.annotation);
+
+        } else if ( this.annotation ) {
+            let map = this.annotation;
+            if ( file ) map = path.join(path.dirname(file), map);
+
+            this.root = path.dirname(map);
+            if ( fs.existsSync && fs.existsSync(map) ) {
+                return fs.readFileSync(map, 'utf-8').toString().trim();
+            } else {
+                return false;
+            }
+        }
+    }
+
+    isMap(map) {
+        if ( typeof map !== 'object' ) return false;
+        return typeof map.mappings === 'string' ||
+               typeof map._mappings === 'string';
+    }
+}
+
+export default PreviousMap;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/processor.es6.html b/processor.es6.html new file mode 100644 index 000000000..dc8721ca4 --- /dev/null +++ b/processor.es6.html @@ -0,0 +1,257 @@ + + + + + processor.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

processor.es6

+ + + + + + + +
+
+
import LazyResult  from './lazy-result';
+
+/**
+ * @callback builder
+ * @param {string} part          - part of generated CSS connected to this node
+ * @param {Node}   node          - AST node
+ * @param {"start"|"end"} [type] - node’s part type
+ */
+
+/**
+ * @callback parser
+ *
+ * @param {string|toString} css   - string with input CSS or any object
+ *                                  with toString() method, like a Buffer
+ * @param {processOptions} [opts] - options with only `from` and `map` keys
+ *
+ * @return {Root} PostCSS AST
+ */
+
+/**
+ * @callback stringifier
+ *
+ * @param {Node} node       - start node for stringifing. Usually {@link Root}.
+ * @param {builder} builder - function to concatenate CSS from node’s parts
+ *                            or generate string and source map
+ *
+ * @return {void}
+ */
+
+/**
+ * @typedef {object} syntax
+ * @property {parser} parse          - function to generate AST by string
+ * @property {stringifier} stringify - function to generate string by AST
+ */
+
+/**
+ * @typedef {object} toString
+ * @property {function} toString
+ */
+
+/**
+ * @callback pluginFunction
+ * @param {Root} root     - parsed input CSS
+ * @param {Result} result - result to set warnings or check other plugins
+ */
+
+/**
+ * @typedef {object} Plugin
+ * @property {function} postcss - PostCSS plugin function
+ */
+
+/**
+ * @typedef {object} processOptions
+ * @property {string} from             - the path of the CSS source file.
+ *                                       You should always set `from`,
+ *                                       because it is used in source map
+ *                                       generation and syntax error messages.
+ * @property {string} to               - the path where you’ll put the output
+ *                                       CSS file. You should always set `to`
+ *                                       to generate correct source maps.
+ * @property {parser} parser           - function to generate AST by string
+ * @property {stringifier} stringifier - class to generate string by AST
+ * @property {syntax} syntax           - object with `parse` and `stringify`
+ * @property {object} map              - source map options
+ * @property {boolean} map.inline                    - does source map should
+ *                                                     be embedded in the output
+ *                                                     CSS as a base64-encoded
+ *                                                     comment
+ * @property {string|object|false|function} map.prev - source map content
+ *                                                     from a previous
+ *                                                     processing step
+ *                                                     (for example, Sass).
+ *                                                     PostCSS will try to find
+ *                                                     previous map
+ *                                                     automatically, so you
+ *                                                     could disable it by
+ *                                                     `false` value.
+ * @property {boolean} map.sourcesContent            - does PostCSS should set
+ *                                                     the origin content to map
+ * @property {string|false} map.annotation           - does PostCSS should set
+ *                                                     annotation comment to map
+ * @property {string} map.from                       - override `from` in map’s
+ *                                                     `sources`
+ */
+
+/**
+ * Contains plugins to process CSS. Create one `Processor` instance,
+ * initialize its plugins, and then use that instance on numerous CSS files.
+ *
+ * @example
+ * const processor = postcss([autoprefixer, precss]);
+ * processor.process(css1).then(result => console.log(result.css));
+ * processor.process(css2).then(result => console.log(result.css));
+ */
+class Processor {
+
+    /**
+     * @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
+     *        plugins. See {@link Processor#use} for plugin format.
+     */
+    constructor(plugins = []) {
+        /**
+         * @member {string} - Current PostCSS version.
+         *
+         * @example
+         * if ( result.processor.version.split('.')[0] !== '5' ) {
+         *   throw new Error('This plugin works only with PostCSS 5');
+         * }
+         */
+        this.version = '5.0.21';
+        /**
+         * @member {pluginFunction[]} - Plugins added to this processor.
+         *
+         * @example
+         * const processor = postcss([autoprefixer, precss]);
+         * processor.plugins.length //=> 2
+         */
+        this.plugins = this.normalize(plugins);
+    }
+
+    /**
+     * Adds a plugin to be used as a CSS processor.
+     *
+     * PostCSS plugin can be in 4 formats:
+     * * A plugin created by {@link postcss.plugin} method.
+     * * A function. PostCSS will pass the function a @{link Root}
+     *   as the first argument and current {@link Result} instance
+     *   as the second.
+     * * An object with a `postcss` method. PostCSS will use that method
+     *   as described in #2.
+     * * Another {@link Processor} instance. PostCSS will copy plugins
+     *   from that instance into this one.
+     *
+     * Plugins can also be added by passing them as arguments when creating
+     * a `postcss` instance (see [`postcss(plugins)`]).
+     *
+     * Asynchronous plugins should return a `Promise` instance.
+     *
+     * @param {Plugin|pluginFunction|Processor} plugin - PostCSS plugin
+     *                                                   or {@link Processor}
+     *                                                   with plugins
+     *
+     * @example
+     * const processor = postcss()
+     *   .use(autoprefixer)
+     *   .use(precss);
+     *
+     * @return {Processes} current processor to make methods chain
+     */
+    use(plugin) {
+        this.plugins = this.plugins.concat(this.normalize([plugin]));
+        return this;
+    }
+
+    /**
+     * Parses source CSS and returns a {@link LazyResult} Promise proxy.
+     * Because some plugins can be asynchronous it doesn’t make
+     * any transformations. Transformations will be applied
+     * in the {@link LazyResult} methods.
+     *
+     * @param {string|toString|Result} css - String with input CSS or
+     *                                       any object with a `toString()`
+     *                                       method, like a Buffer.
+     *                                       Optionally, send a {@link Result}
+     *                                       instance and the processor will
+     *                                       take the {@link Root} from it.
+     * @param {processOptions} [opts]      - options
+     *
+     * @return {LazyResult} Promise proxy
+     *
+     * @example
+     * processor.process(css, { from: 'a.css', to: 'a.out.css' })
+     *   .then(result => {
+     *      console.log(result.css);
+     *   });
+     */
+    process(css, opts = { }) {
+        return new LazyResult(this, css, opts);
+    }
+
+    normalize(plugins) {
+        let normalized = [];
+        for ( let i of plugins ) {
+            if ( i.postcss ) i = i.postcss;
+
+            if ( typeof i === 'object' && Array.isArray(i.plugins) ) {
+                normalized = normalized.concat(i.plugins);
+            } else if ( typeof i === 'function' ) {
+                normalized.push(i);
+            } else {
+                throw new Error(i + ' is not a PostCSS plugin');
+            }
+        }
+        return normalized;
+    }
+
+}
+
+export default Processor;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/result.es6.html b/result.es6.html new file mode 100644 index 000000000..c750da7bf --- /dev/null +++ b/result.es6.html @@ -0,0 +1,231 @@ + + + + + result.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

result.es6

+ + + + + + + +
+
+
import Warning from './warning';
+
+/**
+ * @typedef  {object} Message
+ * @property {string} type   - message type
+ * @property {string} plugin - source PostCSS plugin name
+ */
+
+/**
+ * Provides the result of the PostCSS transformations.
+ *
+ * A Result instance is returned by {@link LazyResult#then}
+ * or {@link Root#toResult} methods.
+ *
+ * @example
+ * postcss([cssnext]).process(css).then(function (result) {
+ *    console.log(result.css);
+ * });
+ *
+ * @example
+ * var result2 = postcss.parse(css).toResult();
+ */
+class Result {
+
+    /**
+     * @param {Processor} processor - processor used for this transformation.
+     * @param {Root}      root      - Root node after all transformations.
+     * @param {processOptions} opts - options from the {@link Processor#process}
+     *                                or {@link Root#toResult}
+     */
+    constructor(processor, root, opts) {
+        /**
+         * @member {Processor} - The Processor instance used
+         *                       for this transformation.
+         *
+         * @example
+         * for ( let plugin of result.processor.plugins) {
+         *   if ( plugin.postcssPlugin === 'postcss-bad' ) {
+         *     throw 'postcss-good is incompatible with postcss-bad';
+         *   }
+         * });
+         */
+        this.processor = processor;
+        /**
+         * @member {Message[]} - Contains messages from plugins
+         *                       (e.g., warnings or custom messages).
+         *                       Each message should have type
+         *                       and plugin properties.
+         *
+         * @example
+         * postcss.plugin('postcss-min-browser', () => {
+         *   return (css, result) => {
+         *     var browsers = detectMinBrowsersByCanIUse(css);
+         *     result.messages.push({
+         *       type:    'min-browser',
+         *       plugin:  'postcss-min-browser',
+         *       browsers: browsers
+         *     });
+         *   };
+         * });
+         */
+        this.messages = [];
+        /**
+         * @member {Root} - Root node after all transformations.
+         *
+         * @example
+         * root.toResult().root == root;
+         */
+        this.root = root;
+        /**
+         * @member {processOptions} - Options from the {@link Processor#process}
+         *                            or {@link Root#toResult} call
+         *                            that produced this Result instance.
+         *
+         * @example
+         * root.toResult(opts).opts == opts;
+         */
+        this.opts = opts;
+        /**
+         * @member {string} - A CSS string representing of {@link Result#root}.
+         *
+         * @example
+         * postcss.parse('a{}').toResult().css //=> "a{}"
+         */
+        this.css = undefined;
+        /**
+         * @member {SourceMapGenerator} - An instance of `SourceMapGenerator`
+         *                                class from the `source-map` library,
+         *                                representing changes
+         *                                to the {@link Result#root} instance.
+         *
+         * @example
+         * result.map.toJSON() //=> { version: 3, file: 'a.css', … }
+         *
+         * @example
+         * if ( result.map ) {
+         *   fs.writeFileSync(result.opts.to + '.map', result.map.toString());
+         * }
+         */
+        this.map = undefined;
+    }
+
+    /**
+     * Returns for @{link Result#css} content.
+     *
+     * @example
+     * result + '' === result.css
+     *
+     * @return {string} string representing of {@link Result#root}
+     */
+    toString() {
+        return this.css;
+    }
+
+    /**
+     * Creates an instance of {@link Warning} and adds it
+     * to {@link Result#messages}.
+     *
+     * @param {string} text        - warning message
+     * @param {Object} [opts]      - warning options
+     * @param {Node}   opts.node   - CSS node that caused the warning
+     * @param {string} opts.word   - word in CSS source that caused the warning
+     * @param {number} opts.index  - index in CSS node string that caused
+     *                               the warning
+     * @param {string} opts.plugin - name of the plugin that created
+     *                               this warning. {@link Result#warn} fills
+     *                               this property automatically.
+     *
+     * @return {Warning} created warning
+     */
+    warn(text, opts = { }) {
+        if ( !opts.plugin ) {
+            if ( this.lastPlugin && this.lastPlugin.postcssPlugin ) {
+                opts.plugin = this.lastPlugin.postcssPlugin;
+            }
+        }
+
+        let warning = new Warning(text, opts);
+        this.messages.push(warning);
+
+        return warning;
+    }
+
+    /**
+     * Returns warnings from plugins. Filters {@link Warning} instances
+     * from {@link Result#messages}.
+     *
+     * @example
+     * result.warnings().forEach(warn => {
+     *   console.warn(warn.toString());
+     * });
+     *
+     * @return {Warning[]} warnings from plugins
+     */
+    warnings() {
+        return this.messages.filter( i => i.type === 'warning' );
+    }
+
+    /**
+     * An alias for the {@link Result#css} property.
+     * Use it with syntaxes that generate non-CSS output.
+     * @type {string}
+     *
+     * @example
+     * result.css === result.content;
+     */
+    get content() {
+        return this.css;
+    }
+
+}
+
+export default Result;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/root.es6.html b/root.es6.html new file mode 100644 index 000000000..aab682ae3 --- /dev/null +++ b/root.es6.html @@ -0,0 +1,159 @@ + + + + + root.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

root.es6

+ + + + + + + +
+
+
import Container from './container';
+import warnOnce  from './warn-once';
+
+/**
+ * Represents a CSS file and contains all its parsed nodes.
+ *
+ * @extends Container
+ *
+ * @example
+ * const root = postcss.parse('a{color:black} b{z-index:2}');
+ * root.type         //=> 'root'
+ * root.nodes.length //=> 2
+ */
+class Root extends Container {
+
+    constructor(defaults) {
+        super(defaults);
+        this.type = 'root';
+        if ( !this.nodes ) this.nodes = [];
+    }
+
+    removeChild(child) {
+        child = this.index(child);
+
+        if ( child === 0 && this.nodes.length > 1 ) {
+            this.nodes[1].raws.before = this.nodes[child].raws.before;
+        }
+
+        return super.removeChild(child);
+    }
+
+    normalize(child, sample, type) {
+        let nodes = super.normalize(child);
+
+        if ( sample ) {
+            if ( type === 'prepend' ) {
+                if ( this.nodes.length > 1 ) {
+                    sample.raws.before = this.nodes[1].raws.before;
+                } else {
+                    delete sample.raws.before;
+                }
+            } else if ( this.first !== sample ) {
+                for ( let node of nodes ) {
+                    node.raws.before = sample.raws.before;
+                }
+            }
+        }
+
+        return nodes;
+    }
+
+    /**
+     * Returns a {@link Result} instance representing the root’s CSS.
+     *
+     * @param {processOptions} [opts] - options with only `to` and `map` keys
+     *
+     * @return {Result} result with current root’s CSS
+     *
+     * @example
+     * const root1 = postcss.parse(css1, { from: 'a.css' });
+     * const root2 = postcss.parse(css2, { from: 'b.css' });
+     * root1.append(root2);
+     * const result = root1.toResult({ to: 'all.css', map: true });
+     */
+    toResult(opts = { }) {
+        let LazyResult = require('./lazy-result');
+        let Processor  = require('./processor');
+
+        let lazy = new LazyResult(new Processor(), this, opts);
+        return lazy.stringify();
+    }
+
+    remove(child) {
+        warnOnce('Root#remove is deprecated. Use Root#removeChild');
+        this.removeChild(child);
+    }
+
+    prevMap() {
+        warnOnce('Root#prevMap is deprecated. Use Root#source.input.map');
+        return this.source.input.map;
+    }
+
+    /**
+     * @memberof Root#
+     * @member {object} raws - Information to generate byte-to-byte equal
+     *                         node string as it was in the origin input.
+     *
+     * Every parser saves its own properties,
+     * but the default CSS parser uses:
+     *
+     * * `after`: the space symbols after the last child to the end of file.
+     * * `semicolon`: is the last child has an (optional) semicolon.
+     *
+     * @example
+     * postcss.parse('a {}\n').raws //=> { after: '\n' }
+     * postcss.parse('a {}').raws   //=> { after: '' }
+     */
+
+}
+
+export default Root;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/rule.es6.html b/rule.es6.html new file mode 100644 index 000000000..8114cdf19 --- /dev/null +++ b/rule.es6.html @@ -0,0 +1,159 @@ + + + + + rule.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

rule.es6

+ + + + + + + +
+
+
import Container from './container';
+import warnOnce  from './warn-once';
+import list      from './list';
+
+/**
+ * Represents a CSS rule: a selector followed by a declaration block.
+ *
+ * @extends Container
+ *
+ * @example
+ * const root = postcss.parse('a{}');
+ * const rule = root.first;
+ * rule.type       //=> 'rule'
+ * rule.toString() //=> 'a{}'
+ */
+class Rule extends Container {
+
+    constructor(defaults) {
+        super(defaults);
+        this.type = 'rule';
+        if ( !this.nodes ) this.nodes = [];
+    }
+
+    /**
+     * An array containing the rule’s individual selectors.
+     * Groups of selectors are split at commas.
+     *
+     * @type {string[]}
+     *
+     * @example
+     * const root = postcss.parse('a, b { }');
+     * const rule = root.first;
+     *
+     * rule.selector  //=> 'a, b'
+     * rule.selectors //=> ['a', 'b']
+     *
+     * rule.selectors = ['a', 'strong'];
+     * rule.selector //=> 'a, strong'
+     */
+    get selectors() {
+        return list.comma(this.selector);
+    }
+
+    set selectors(values) {
+        let match = this.selector ? this.selector.match(/,\s*/) : null;
+        let sep   = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
+        this.selector = values.join(sep);
+    }
+
+    get _selector() {
+        warnOnce('Rule#_selector is deprecated. Use Rule#raws.selector');
+        return this.raws.selector;
+    }
+
+    set _selector(val) {
+        warnOnce('Rule#_selector is deprecated. Use Rule#raws.selector');
+        this.raws.selector = val;
+    }
+
+    /**
+     * @memberof Rule#
+     * @member {string} selector - the rule’s full selector represented
+     *                             as a string
+     *
+     * @example
+     * const root = postcss.parse('a, b { }');
+     * const rule = root.first;
+     * rule.selector //=> 'a, b'
+     */
+
+    /**
+     * @memberof Rule#
+     * @member {object} raws - Information to generate byte-to-byte equal
+     *                         node string as it was in the origin input.
+     *
+     * Every parser saves its own properties,
+     * but the default CSS parser uses:
+     *
+     * * `before`: the space symbols before the node. It also stores `*`
+     *   and `_` symbols before the declaration (IE hack).
+     * * `after`: the space symbols after the last child of the node
+     *   to the end of the node.
+     * * `between`: the symbols between the property and value
+     *   for declarations, selector and `{` for rules, or last parameter
+     *   and `{` for at-rules.
+     * * `semicolon`: contains true if the last child has
+     *   an (optional) semicolon.
+     *
+     * PostCSS cleans selectors from comments and extra spaces,
+     * but it stores origin content in raws properties.
+     * As such, if you don’t change a declaration’s value,
+     * PostCSS will use the raw value with comments.
+     *
+     * @example
+     * const root = postcss.parse('a {\n  color:black\n}')
+     * root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
+     */
+
+}
+
+export default Rule;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/scripts/linenumber.js b/scripts/linenumber.js new file mode 100644 index 000000000..9cb891484 --- /dev/null +++ b/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(function() { + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + var lineId; + var lines; + var totalLines; + var anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/scripts/prettify/Apache-License-2.0.txt b/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 000000000..75b52484e --- /dev/null +++ b/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/scripts/prettify/lang-css.js b/scripts/prettify/lang-css.js new file mode 100644 index 000000000..bb6dbea43 --- /dev/null +++ b/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/scripts/prettify/prettify.js b/scripts/prettify/prettify.js new file mode 100644 index 000000000..ec2a488bd --- /dev/null +++ b/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p ul { + padding: 0 10px; +} + +nav > ul > li > a { + color: #606; +} + +nav ul ul { + margin-bottom: 10px +} + +nav ul ul + ul { + margin-top: -10px; +} + +nav ul ul a { + color: hsl(207, 1%, 60%); + border-left: 1px solid hsl(207, 10%, 86%); +} + +nav ul ul a, +nav ul ul a:active { + padding-left: 20px +} + +nav h2 { + font-size: 12px; + margin: 0; + padding: 0; +} + +nav > h2 > a { + display: block; + margin: 10px 0 -10px; + color: #606 !important; +} + +footer { + color: hsl(0, 0%, 28%); + margin-left: 250px; + display: block; + padding: 15px; + font-style: italic; + font-size: 90%; +} + +.ancestors { + color: #999 +} + +.ancestors a { + color: #999 !important; +} + +.clear { + clear: both +} + +.important { + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px +} + +.type-signature { + color: #CA79CA +} + +.type-signature:last-child { + color: #eee; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace +} + +.signature { + color: #fc83ff; +} + +.details { + margin-top: 6px; + border-left: 2px solid #DDD; + line-height: 20px; + font-size: 14px; +} + +.details dt { + width: 120px; + float: left; + padding-left: 10px; +} + +.details dd { + margin-left: 70px; + margin-top: 6px; + margin-bottom: 6px; +} + +.details ul { + margin: 0 +} + +.details ul { + list-style-type: none +} + +.details pre.prettyprint { + margin: 0 +} + +.details .object-value { + padding-top: 0 +} + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption { + font-style: italic; + font-size: 107%; + margin: 0; +} + +.prettyprint { + font-size: 14px; + overflow: auto; +} + +.prettyprint.source { + width: inherit; + line-height: 18px; + display: block; + background-color: #0d152a; + color: #aeaeae; +} + +.prettyprint code { + line-height: 18px; + display: block; + background-color: #0d152a; + color: #4D4E53; +} + +.prettyprint > code { + padding: 15px; +} + +.prettyprint .linenums code { + padding: 0 15px +} + +.prettyprint .linenums li:first-of-type code { + padding-top: 15px +} + +.prettyprint code span.line { + display: inline-block +} + +.prettyprint.linenums { + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol { + padding-left: 0 +} + +.prettyprint.linenums li { + border-left: 3px #34446B solid; +} + +.prettyprint.linenums li.selected, .prettyprint.linenums li.selected * { + background-color: #34446B; +} + +.prettyprint.linenums li * { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params, .props { + border-spacing: 0; + border: 1px solid #ddd; + border-collapse: collapse; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + width: 100%; + font-size: 14px; + margin: 1em 0; +} + +.params .type { + white-space: nowrap; +} + +.params code { + white-space: pre; +} + +.params td, .params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td, .params th, .props td, .props th { + margin: 0px; + text-align: left; + vertical-align: top; + padding: 10px; + display: table-cell; +} + +.params td { + border-top: 1px solid #eee +} + +.params thead tr, .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params .params thead tr, .props .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params td.description > p:first-child, .props td.description > p:first-child { + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child, .props td.description > p:last-child { + margin-bottom: 0; + padding-bottom: 0; +} + +span.param-type, .params td .param-type, .param-type dd { + color: #606; + font-family: Consolas, Monaco, 'Andale Mono', monospace +} + +.param-type dt, .param-type dd { + display: inline-block +} + +.param-type { + margin: 14px 0; +} + +.disabled { + color: #454545 +} + +/* navicon button */ +.navicon-button { + display: none; + position: relative; + padding: 2.0625rem 1.5rem; + transition: 0.25s; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + opacity: .8; +} +.navicon-button .navicon:before, .navicon-button .navicon:after { + transition: 0.25s; +} +.navicon-button:hover { + transition: 0.5s; + opacity: 1; +} +.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after { + transition: 0.25s; +} +.navicon-button:hover .navicon:before { + top: .825rem; +} +.navicon-button:hover .navicon:after { + top: -.825rem; +} + +/* navicon */ +.navicon { + position: relative; + width: 2.5em; + height: .3125rem; + background: #000; + transition: 0.3s; + border-radius: 2.5rem; +} +.navicon:before, .navicon:after { + display: block; + content: ""; + height: .3125rem; + width: 2.5rem; + background: #000; + position: absolute; + z-index: -1; + transition: 0.3s 0.25s; + border-radius: 1rem; +} +.navicon:before { + top: .625rem; +} +.navicon:after { + top: -.625rem; +} + +/* open */ +.nav-trigger:checked + label:not(.steps) .navicon:before, +.nav-trigger:checked + label:not(.steps) .navicon:after { + top: 0 !important; +} + +.nav-trigger:checked + label .navicon:before, +.nav-trigger:checked + label .navicon:after { + transition: 0.5s; +} + +/* Minus */ +.nav-trigger:checked + label { + -webkit-transform: scale(0.75); + transform: scale(0.75); +} + +/* × and + */ +.nav-trigger:checked + label.plus .navicon, +.nav-trigger:checked + label.x .navicon { + background: transparent; +} + +.nav-trigger:checked + label.plus .navicon:before, +.nav-trigger:checked + label.x .navicon:before { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + background: #FFF; +} + +.nav-trigger:checked + label.plus .navicon:after, +.nav-trigger:checked + label.x .navicon:after { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + background: #FFF; +} + +.nav-trigger:checked + label.plus { + -webkit-transform: scale(0.75) rotate(45deg); + transform: scale(0.75) rotate(45deg); +} + +.nav-trigger:checked ~ nav { + left: 0 !important; +} + +.nav-trigger:checked ~ .overlay { + display: block; +} + +.nav-trigger { + position: fixed; + top: 0; + clip: rect(0, 0, 0, 0); +} + +.overlay { + display: none; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 100%; + background: hsla(0, 0%, 0%, 0.5); + z-index: 1; +} + +@media only screen and (min-width: 320px) and (max-width: 680px) { + body { + overflow-x: hidden; + } + + nav { + background: #FFF; + width: 250px; + height: 100%; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: -250px; + z-index: 3; + padding: 0 10px; + transition: left 0.2s; + } + + .navicon-button { + display: inline-block; + position: fixed; + top: 1.5em; + right: 0; + z-index: 2; + } + + #main { + width: 100%; + min-width: 360px; + } + + #main h1.page-title { + margin: 1em 0; + } + + #main section { + padding: 0; + } + + footer { + margin-left: 0; + } +} + +/** Add a '#' to static members */ +[data-type="member"] a::before { + content: '#'; + display: inline-block; + margin-left: -14px; + margin-right: 5px; +} diff --git a/styles/prettify.css b/styles/prettify.css new file mode 100644 index 000000000..629bde515 --- /dev/null +++ b/styles/prettify.css @@ -0,0 +1,79 @@ +.pln { + color: #ddd; +} + +/* string content */ +.str { + color: #61ce3c; +} + +/* a keyword */ +.kwd { + color: #fbde2d; +} + +/* a comment */ +.com { + color: #aeaeae; +} + +/* a type name */ +.typ { + color: #8da6ce; +} + +/* a literal value */ +.lit { + color: #fbde2d; +} + +/* punctuation */ +.pun { + color: #ddd; +} + +/* lisp open bracket */ +.opn { + color: #000000; +} + +/* lisp close bracket */ +.clo { + color: #000000; +} + +/* a markup tag name */ +.tag { + color: #8da6ce; +} + +/* a markup attribute name */ +.atn { + color: #fbde2d; +} + +/* a markup attribute value */ +.atv { + color: #ddd; +} + +/* a declaration */ +.dec { + color: #EF5050; +} + +/* a variable name */ +.var { + color: #c82829; +} + +/* a function name */ +.fun { + color: #4271ae; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/vendor.es6.html b/vendor.es6.html new file mode 100644 index 000000000..f37ede247 --- /dev/null +++ b/vendor.es6.html @@ -0,0 +1,110 @@ + + + + + vendor.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

vendor.es6

+ + + + + + + +
+
+
/**
+ * Contains helpers for working with vendor prefixes.
+ *
+ * @example
+ * const vendor = postcss.vendor;
+ *
+ * @namespace vendor
+ */
+let vendor = {
+
+    /**
+     * Returns the vendor prefix extracted from an input string.
+     *
+     * @param {string} prop - string with or without vendor prefix
+     *
+     * @return {string} vendor prefix or empty string
+     *
+     * @example
+     * postcss.vendor.prefix('-moz-tab-size') //=> '-moz-'
+     * postcss.vendor.prefix('tab-size')      //=> ''
+     */
+    prefix(prop) {
+        if ( prop[0] === '-' ) {
+            let sep = prop.indexOf('-', 1);
+            return prop.substr(0, sep + 1);
+        } else {
+            return '';
+        }
+    },
+
+    /**
+     * Returns the input string stripped of its vendor prefix.
+     *
+     * @param {string} prop - string with or without vendor prefix
+     *
+     * @return {string} string name without vendor prefixes
+     *
+     * @example
+     * postcss.vendor.unprefixed('-moz-tab-size') //=> 'tab-size'
+     */
+    unprefixed(prop) {
+        if ( prop[0] === '-' ) {
+            let sep = prop.indexOf('-', 1);
+            return prop.substr(sep + 1);
+        } else {
+            return prop;
+        }
+    }
+
+};
+
+export default vendor;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + diff --git a/vendor.html b/vendor.html new file mode 100644 index 000000000..f2d5e1dd5 --- /dev/null +++ b/vendor.html @@ -0,0 +1,470 @@ + + + + + vendor - Documentation + + + + + + + + + + + + + + + + +
+ +

vendor

+ + + + + + + +
+ +
+ +

+ vendor +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Contains helpers for working with vendor prefixes.

+ + + +

Example

+ +
const vendor = postcss.vendor;
+ + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

(static) prefix(prop) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the vendor prefix extracted from an input string.

+
+ + + + + + + + + +
Example
+ +
postcss.vendor.prefix('-moz-tab-size') //=> '-moz-'
+postcss.vendor.prefix('tab-size')      //=> ''
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string + + + +

string with or without vendor prefix

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

vendor prefix or empty string

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

(static) unprefixed(prop) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the input string stripped of its vendor prefix.

+
+ + + + + + + + + +
Example
+ +
postcss.vendor.unprefixed('-moz-tab-size') //=> 'tab-size'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string + + + +

string with or without vendor prefix

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

string name without vendor prefixes

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/warning.es6.html b/warning.es6.html new file mode 100644 index 000000000..8854ba1dd --- /dev/null +++ b/warning.es6.html @@ -0,0 +1,163 @@ + + + + + warning.es6 - Documentation + + + + + + + + + + + + + + + + +
+ +

warning.es6

+ + + + + + + +
+
+
/**
+ * Represents a plugin’s warning. It can be created using {@link Node#warn}.
+ *
+ * @example
+ * if ( decl.important ) {
+ *     decl.warn(result, 'Avoid !important', { word: '!important' });
+ * }
+ */
+class Warning {
+
+    /**
+     * @param {string} text        - warning message
+     * @param {Object} [opts]      - warning options
+     * @param {Node}   opts.node   - CSS node that caused the warning
+     * @param {string} opts.word   - word in CSS source that caused the warning
+     * @param {number} opts.index  - index in CSS node string that caused
+     *                               the warning
+     * @param {string} opts.plugin - name of the plugin that created
+     *                               this warning. {@link Result#warn} fills
+     *                               this property automatically.
+     */
+    constructor(text, opts = { }) {
+        /**
+         * @member {string} - Type to filter warnings from
+         *                    {@link Result#messages}. Always equal
+         *                    to `"warning"`.
+         *
+         * @example
+         * const nonWarning = result.messages.filter(i => i.type !== 'warning')
+         */
+        this.type = 'warning';
+        /**
+         * @member {string} - The warning message.
+         *
+         * @example
+         * warning.text //=> 'Try to avoid !important'
+         */
+        this.text = text;
+
+        if ( opts.node && opts.node.source ) {
+            let pos     = opts.node.positionBy(opts);
+            /**
+             * @member {number} - Line in the input file
+             *                    with this warning’s source
+             *
+             * @example
+             * warning.line //=> 5
+             */
+            this.line   = pos.line;
+            /**
+             * @member {number} - Column in the input file
+             *                    with this warning’s source.
+             *
+             * @example
+             * warning.column //=> 6
+             */
+            this.column = pos.column;
+        }
+
+        for ( let opt in opts ) this[opt] = opts[opt];
+    }
+
+    /**
+     * Returns a warning position and message.
+     *
+     * @example
+     * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
+     *
+     * @return {string} warning position and message
+     */
+    toString() {
+        if ( this.node ) {
+            return this.node.error(this.text, {
+                plugin: this.plugin,
+                index:  this.index,
+                word:   this.word
+            }).message;
+        } else if ( this.plugin ) {
+            return this.plugin + ': ' + this.text;
+        } else {
+            return this.text;
+        }
+    }
+
+    /**
+     * @memberof Warning#
+     * @member {string} plugin - The name of the plugin that created
+     *                           it will fill this property automatically.
+     *                           this warning. When you call {@link Node#warn}
+     *
+     * @example
+     * warning.plugin //=> 'postcss-important'
+     */
+
+    /**
+     * @memberof Warning#
+     * @member {Node} node - Contains the CSS node that caused the warning.
+     *
+     * @example
+     * warning.node.toString() //=> 'color: white !important'
+     */
+
+}
+
+export default Warning;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. +
+ + + + + From f329b3a236e6bb201c4154447a0c96f40ca237dd Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Tue, 28 Jun 2016 12:18:03 +0300 Subject: [PATCH 09/17] Use api.postcss.org --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..1c6432a25 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +api.postcss.org From d6c7b0248c905857d14fda525b1190b274bceeff Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Tue, 30 Aug 2016 03:43:34 +0300 Subject: [PATCH 10/17] Add Node and Container docs and use root argument in plugin examples --- AtRule.html | 42 +- Comment.html | 48 +- Container.html | 6583 +++++++++++++++++++++++++++++++++++++ CssSyntaxError.html | 4 +- Declaration.html | 48 +- Input.html | 4 +- LazyResult.html | 4 +- Node.html | 3281 ++++++++++++++++++ PreviousMap.html | 4 +- Processor.html | 4 +- Result.html | 8 +- Root.html | 86 +- Rule.html | 86 +- Warning.html | 4 +- at-rule.es6.html | 4 +- comment.es6.html | 4 +- container.es6.html | 5 +- css-syntax-error.es6.html | 4 +- declaration.es6.html | 4 +- global.html | 4 +- index.html | 4 +- input.es6.html | 4 +- lazy-result.es6.html | 4 +- list.es6.html | 4 +- list.html | 4 +- node.es6.html | 13 +- postcss.es6.html | 16 +- postcss.html | 12 +- previous-map.es6.html | 4 +- processor.es6.html | 6 +- result.es6.html | 8 +- root.es6.html | 4 +- rule.es6.html | 4 +- vendor.es6.html | 4 +- vendor.html | 4 +- warning.es6.html | 4 +- 36 files changed, 10096 insertions(+), 234 deletions(-) create mode 100644 Container.html create mode 100644 Node.html diff --git a/AtRule.html b/AtRule.html index 729ecffde..6042dc220 100644 --- a/AtRule.html +++ b/AtRule.html @@ -22,7 +22,7 @@
@@ -186,7 +186,7 @@

firstSource:
@@ -269,7 +269,7 @@

lastSource:
@@ -432,7 +432,7 @@

nodesSource:
@@ -711,7 +711,7 @@

appendSource:
@@ -907,7 +907,7 @@

eachSource:
@@ -1095,7 +1095,7 @@

everySource:
@@ -1261,7 +1261,7 @@

indexSource:
@@ -1426,7 +1426,7 @@

insertAfte
Source:
@@ -1621,7 +1621,7 @@

insertBef
Source:
@@ -1821,7 +1821,7 @@

prependSource:
@@ -2017,7 +2017,7 @@

removeAllSource:
@@ -2135,7 +2135,7 @@

removeChil
Source:
@@ -2307,7 +2307,7 @@

replaceV
Source:
@@ -2609,7 +2609,7 @@

someSource:
@@ -2775,7 +2775,7 @@

walkSource:
@@ -2950,7 +2950,7 @@

walkAtRule
Source:
@@ -3181,7 +3181,7 @@

walkComme
Source:
@@ -3354,7 +3354,7 @@

walkDeclsSource:
@@ -3584,7 +3584,7 @@

walkRulesSource:
@@ -3809,7 +3809,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Comment.html b/Comment.html index 58ec29254..de2804cca 100644 --- a/Comment.html +++ b/Comment.html @@ -22,7 +22,7 @@
@@ -174,7 +174,7 @@

parentSource:
@@ -343,7 +343,7 @@

sourceSource:
@@ -519,7 +519,7 @@

typeSource:
@@ -614,7 +614,7 @@

cloneSource:
@@ -796,7 +796,7 @@

cloneAfter<
Source:
@@ -841,7 +841,7 @@

cloneAfter<
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node after the current node.

@@ -971,7 +971,7 @@

cloneBefor
Source:
@@ -1016,7 +1016,7 @@

cloneBefor
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node before the current node.

@@ -1151,7 +1151,7 @@

errorSource:
@@ -1470,7 +1470,7 @@

moveAfterSource:
@@ -1633,7 +1633,7 @@

moveBefore<
Source:
@@ -1796,7 +1796,7 @@

moveToSource:
@@ -1967,7 +1967,7 @@

nextSource:
@@ -2092,7 +2092,7 @@

prevSource:
@@ -2215,7 +2215,7 @@

rawSource:
@@ -2430,7 +2430,7 @@

removeSource:
@@ -2549,7 +2549,7 @@

replaceWit
Source:
@@ -2728,7 +2728,7 @@

rootSource:
@@ -2844,7 +2844,7 @@

toStringSource:
@@ -3025,7 +3025,7 @@

warnSource:
@@ -3084,8 +3084,8 @@

warnconst plugin = postcss.plugin('postcss-deprecated', () => { - return (css, result) => { - css.walkDecls('bad', decl => { + return (root, result) => { + root.walkDecls('bad', decl => { decl.warn(result, 'Deprecated property bad'); }); }; @@ -3370,7 +3370,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Container.html b/Container.html new file mode 100644 index 000000000..b2a8ebea6 --- /dev/null +++ b/Container.html @@ -0,0 +1,6583 @@ + + + + + Container - Documentation + + + + + + + + + + + + + + + + +
+ +

Container

+ + + + + + + +
+ +
+ +

+ Container +

+ +

The Root, AtRule, and Rule container nodes +inherit some common methods to help work with their children.

+

Note that all containers can store any content. If you write a rule inside +a rule, PostCSS will parse it.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

(abstract) new Container()

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

first :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s first child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.first == rules.nodes[0];
+ + + + + +

last :Node

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

The container’s last child.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
rule.last == rule.nodes[rule.nodes.length - 1];
+ + + + + +

nodes :Array.<Node>

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

an array containing the container’s children

+
+ + + +
Type:
+
    +
  • + +Array.<Node> + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a { color: black }');
+root.nodes.length           //=> 1
+root.nodes[0].selector      //=> 'a'
+root.nodes[0].nodes[0].prop //=> 'color'
+ + + + + +

parent :Container

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the node’s parent node.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.nodes[0].parent == root;
+ + + + + +

raws :object

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Information to generate byte-to-byte equal + node string as it was in the origin input.

+

Every parser saves its own properties, +but the default CSS parser uses:

+
    +
  • before: the space symbols before the node. It also stores * +and _ symbols before the declaration (IE hack).
  • +
  • after: the space symbols after the last child of the node +to the end of the node.
  • +
  • between: the symbols between the property and value +for declarations, selector and { for rules, or last parameter +and { for at-rules.
  • +
  • semicolon: contains true if the last child has +an (optional) semicolon.
  • +
  • afterName: the space between the at-rule name and its parameters.
  • +
  • left: the space symbols between /* and the comment’s text.
  • +
  • right: the space symbols between the comment’s text +and */.
  • +
  • important: the content of the important statement, +if it is not just !important.
  • +
+

PostCSS cleans selectors, declaration values and at-rule parameters +from comments and extra spaces, but it stores origin content in raws +properties. As such, if you don’t change a declaration’s value, +PostCSS will use the raw value with comments.

+
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a {\n  color:black\n}')
+root.first.first.raws //=> { before: '\n  ', between: ':' }
+ + + + + +

source :source

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the input source of the node

+

The property is used in source map generation.

+

If you create a node manually (e.g., with postcss.decl()), +that node will not have a source property and will be absent +from the source map. For this reason, the plugin developer should +consider cloning nodes to create new ones (in which case the new node’s +source will reference the original, cloned node) or setting +the source property manually.

+
// Bad
+const prefixed = postcss.decl({
+  prop: '-moz-' + decl.prop,
+  value: decl.value
+});
+
+// Good
+const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
if ( atrule.name == 'add-link' ) {
+  const rule = postcss.rule({ selector: 'a', source: atrule.source });
+  atrule.parent.insertBefore(atrule, rule);
+}
+
+ + + +
Type:
+ + + + + + +
Example
+ +
decl.source.input.from //=> '/home/ai/a.sass'
+decl.source.start      //=> { line: 10, column: 2 }
+decl.source.end        //=> { line: 10, column: 12 }
+ + + + + +

type :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

String representing the node’s type. + Possible values are root, atrule, rule, + decl, or comment.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
+ + + + + + + +

Methods

+ + + + + + +

append(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the start of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.append(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

clone(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

+
+ + + + + + + + + +
Example
+ +
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

clone of the node

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneAfter(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Shortcut to clone the node and insert the resulting cloned node +after the current node.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneBefore(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Shortcut to clone the node and insert the resulting cloned node +before the current node.

+
+ + + + + + + + + +
Example
+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

each(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Iterates through the container’s immediate children, +calling callback for each child.

+

Returning false in the callback will break iteration.

+

This method only iterates through the container’s immediate children. +If you need to recursively iterate through all the container’s descendant +nodes, use Container#walk.

+

Unlike the for {}-cycle or Array#forEach this iterator is safe +if you are mutating the array of child nodes during iteration. +PostCSS will adjust the current index to match the mutations.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { color: black; z-index: 1 }');
+const rule = root.first;
+
+for ( let decl of rule.nodes ) {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Cycle will be infinite, because cloneBefore moves the current node
+    // to the next index
+}
+
+rule.each(decl => {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Will be executed only for color and z-index
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

error(message, optsopt) → {CssSyntaxError}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

+
+ + + + + + + + + +
Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

error description

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the error

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

error object to throw it

+
+ + + +
+
+ Type +
+
+ +CssSyntaxError + + +
+
+ + + + + + + + + +

every(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true +for all of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const noPrefixes = rule.every(i => i.prop[0] !== '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

index(child) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a child’s index within the Container#nodes array.

+
+ + + + + + + + + +
Example
+ +
rule.index( rule.nodes[2] ) //=> 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node + + + +

child of the current container.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

child index

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + +

insertAfter(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node after old node within the container.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

insertBefore(exist, add) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Insert new node before old node within the container.

+
+ + + + + + + + + +
Example
+ +
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
exist + + +Node +| + +number + + + +

child or child’s index.

add + + +Node +| + +object +| + +string +| + +Array.<Node> + + + +

new node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveAfter(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent after otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be after current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveBefore(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent before otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be before current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveTo(newParent) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it +at the end of newParent.

+

This will clean the before and after code Node#raws data +from the node and replace them with the indentation style of newParent. +It will also clean the between property +if newParent is in another Root.

+
+ + + + + + + + + +
Example
+ +
atrule.moveTo(atrule.root());
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
newParent + + +Container + + + +

container node where the current node + will be moved

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

next() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the next child of the node’s parent. +Returns undefined if the current node is the last child.

+
+ + + + + + + + + +
Example
+ +
if ( comment.text === 'delete next' ) {
+  const next = comment.next();
+  if ( next ) {
+    next.remove();
+  }
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

next node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

prepend(…children) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts new nodes to the end of the container.

+
+ + + + + + + + + +
Example
+ +
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.prepend(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
children + + +Node +| + +object +| + +string +| + +Array.<Node> + + + + + + + + + + <repeatable>
+ +

new nodes

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

prev() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the previous child of the node’s parent. +Returns undefined if the current node is the first child.

+
+ + + + + + + + + +
Example
+ +
const annotation = decl.prev();
+if ( annotation.type == 'comment' ) {
+ readAnnotation(annotation.text);
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

previous node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

raw(prop, defaultTypeopt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Node#raws value. If the node is missing +the code style property (because the node was manually built or cloned), +PostCSS will try to autodetect the code style property by looking +at other nodes in the tree.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { background: white }');
+root.nodes[0].append({ prop: 'color', value: 'black' });
+root.nodes[0].nodes[1].raws.before   //=> undefined
+root.nodes[0].nodes[1].raw('before') //=> ' '
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string + + + + + + + + + +

name of code style property

defaultType + + +string + + + + + + <optional>
+ + + + + +

name of default value, it can be missed + if the value is the same as prop

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

code style value

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

remove() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its parent and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
if ( decl.prop.match(/^-webkit-/) ) {
+  decl.remove();
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

node to make calls chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeAll() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes all children from the container +and cleans their parent properties.

+
+ + + + + + + + + +
Example
+ +
rule.removeAll();
+rule.nodes.length //=> 0
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

removeChild(child) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes node from the container and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
rule.nodes.length  //=> 5
+rule.removeChild(decl);
+rule.nodes.length  //=> 4
+decl.parent        //=> undefined
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
child + + +Node +| + +number + + + +

child or child’s index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceValues(pattern, opts, callback) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Passes all declaration values within the container that match pattern +through callback, replacing those values with the returned result +of callback.

+

This method is useful if you are using a custom unit or function +and need to iterate through all values.

+
+ + + + + + + + + +
Example
+ +
root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
+  return 15 * parseInt(string) + 'px';
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pattern + + +string +| + +RegExp + + + +

replace pattern

opts + + +object + + + +

options to speed up the search

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string + + + +

an array of property names

fast + + +string + + + +

string that’s used + to narrow down values and speed up + the regexp search

+ +
callback + + +function +| + +string + + + +

string to replace pattern + or callback that returns a new value. + The callback will receive + the same arguments as those passed + to a function parameter + of String#replace.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

this node for methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceWith(…nodes) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts node(s) before the current node and removes the current node.

+
+ + + + + + + + + +
Example
+ +
if ( atrule.name == 'mixin' ) {
+  atrule.replaceWith(mixinRules[atrule.params]);
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nodes + + +Node + + + + + + + + + + <repeatable>
+ +

node(s) to replace current one

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

root() → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Finds the Root instance of the node’s tree.

+
+ + + + + + + + + +
Example
+ +
root.nodes[0].nodes[0].root() === root
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

root parent

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

some(condition) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns true if callback returns true for (at least) one +of the container’s children.

+
+ + + + + + + + + +
Example
+ +
const hasPrefix = rule.every(i => i.prop[0] === '-');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
condition + + +childCondition + + + +

iterator returns true or false.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

is every child pass condition

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + +

toString(stringifieropt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CSS string representing the node.

+
+ + + + + + + + + +
Example
+ +
postcss.rule({ selector: 'a' }).toString() //=> "a {}"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
stringifier + + +stringifier +| + +syntax + + + + + + <optional>
+ + + + + +

a syntax to use + in string generation

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

CSS string of this node

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

walk(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each node.

+

Like container.each(), this method is safe to use +if you are mutating arrays during iteration.

+

If you only need to iterate through the container’s immediate children, +use Container#each.

+
+ + + + + + + + + +
Example
+ +
root.walk(node => {
+  // Traverses all descendant nodes.
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkAtRules(nameopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each at-rule node.

+

If you pass a filter, iteration will only happen over at-rules +that have matching names.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkAtRules(rule => {
+  if ( isOld(rule.name) ) rule.remove();
+});
+
+let first = false;
+root.walkAtRules('charset', rule => {
+  if ( !first ) {
+    first = true;
+  } else {
+    rule.remove();
+  }
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter at-rules by name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkComments(callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each comment node.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkComments(comment => {
+  comment.remove();
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +childIterator + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkDecls(propopt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each declaration node.

+

If you pass a filter, iteration will only happen over declarations +with matching properties.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
root.walkDecls(decl => {
+  checkPropertySupport(decl.prop);
+});
+
+root.walkDecls('border-radius', decl => {
+  decl.remove();
+});
+
+root.walkDecls(/^background/, decl => {
+  decl.value = takeFirstColorFromGradient(decl.value);
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter declarations by property name

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

walkRules(selectoropt, callback) → {false|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Traverses the container’s descendant nodes, calling callback +for each rule node.

+

If you pass a filter, iteration will only happen over rules +with matching selectors.

+

Like Container#each, this method is safe +to use if you are mutating arrays during iteration.

+
+ + + + + + + + + +
Example
+ +
const selectors = [];
+root.walkRules(rule => {
+  selectors.push(rule.selector);
+});
+console.log(`Your CSS uses ${selectors.length} selectors');
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
selector + + +string +| + +RegExp + + + + + + <optional>
+ + + + + +

string or regular expression + to filter rules by selector

callback + + +childIterator + + + + + + + + + +

iterator receives each node and index

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

returns false if iteration was broke

+
+ + + +
+
+ Type +
+
+ +false +| + +undefined + + +
+
+ + + + + + + + + +

warn(result, text, optsopt) → {Warning}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

This method is provided as a convenience wrapper for Result#warn.

+
+ + + + + + + + + +
Example
+ +
const plugin = postcss.plugin('postcss-deprecated', () => {
+  return (root, result) => {
+    root.walkDecls('bad', decl => {
+      decl.warn(result, 'Deprecated property bad');
+    });
+  };
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
result + + +Result + + + + + + + + + +

the Result instance + that will receive the warning

text + + +string + + + + + + + + + +

warning message

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this warning. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the warning

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the warning

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

created warning object

+
+ + + +
+
+ Type +
+
+ +Warning + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/CssSyntaxError.html b/CssSyntaxError.html index 621f7164a..50d64589c 100644 --- a/CssSyntaxError.html +++ b/CssSyntaxError.html @@ -22,7 +22,7 @@
@@ -1429,7 +1429,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Declaration.html b/Declaration.html index 99820b158..07bb55407 100644 --- a/Declaration.html +++ b/Declaration.html @@ -22,7 +22,7 @@
@@ -261,7 +261,7 @@

parentSource:
@@ -524,7 +524,7 @@

sourceSource:
@@ -627,7 +627,7 @@

typeSource:
@@ -802,7 +802,7 @@

cloneSource:
@@ -984,7 +984,7 @@

cloneAfter<
Source:
@@ -1029,7 +1029,7 @@

cloneAfter<
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node after the current node.

@@ -1159,7 +1159,7 @@

cloneBefor
Source:
@@ -1204,7 +1204,7 @@

cloneBefor
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node before the current node.

@@ -1339,7 +1339,7 @@

errorSource:
@@ -1658,7 +1658,7 @@

moveAfterSource:
@@ -1821,7 +1821,7 @@

moveBefore<
Source:
@@ -1984,7 +1984,7 @@

moveToSource:
@@ -2155,7 +2155,7 @@

nextSource:
@@ -2280,7 +2280,7 @@

prevSource:
@@ -2403,7 +2403,7 @@

rawSource:
@@ -2618,7 +2618,7 @@

removeSource:
@@ -2737,7 +2737,7 @@

replaceWit
Source:
@@ -2916,7 +2916,7 @@

rootSource:
@@ -3032,7 +3032,7 @@

toStringSource:
@@ -3213,7 +3213,7 @@

warnSource:
@@ -3272,8 +3272,8 @@

warnconst plugin = postcss.plugin('postcss-deprecated', () => { - return (css, result) => { - css.walkDecls('bad', decl => { + return (root, result) => { + root.walkDecls('bad', decl => { decl.warn(result, 'Deprecated property bad'); }); }; @@ -3558,7 +3558,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Input.html b/Input.html index 878869554..c1bf50028 100644 --- a/Input.html +++ b/Input.html @@ -22,7 +22,7 @@
@@ -859,7 +859,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/LazyResult.html b/LazyResult.html index c5e5590ad..b9f1438da 100644 --- a/LazyResult.html +++ b/LazyResult.html @@ -22,7 +22,7 @@
@@ -1323,7 +1323,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Node.html b/Node.html new file mode 100644 index 000000000..23b35da36 --- /dev/null +++ b/Node.html @@ -0,0 +1,3281 @@ + + + + + Node - Documentation + + + + + + + + + + + + + + + + +
+ +

Node

+ + + + + + + +
+ +
+ +

+ Node +

+ +

All node classes inherit the following common methods.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

(abstract) new Node(defaultsopt)

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
defaults + + +object + + + + + + <optional>
+ + + + + +

value for node properties

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

parent :Container

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the node’s parent node.

+
+ + + +
Type:
+ + + + + + +
Example
+ +
root.nodes[0].parent == root;
+ + + + + +

raws :object

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Information to generate byte-to-byte equal + node string as it was in the origin input.

+

Every parser saves its own properties, +but the default CSS parser uses:

+
    +
  • before: the space symbols before the node. It also stores * +and _ symbols before the declaration (IE hack).
  • +
  • after: the space symbols after the last child of the node +to the end of the node.
  • +
  • between: the symbols between the property and value +for declarations, selector and { for rules, or last parameter +and { for at-rules.
  • +
  • semicolon: contains true if the last child has +an (optional) semicolon.
  • +
  • afterName: the space between the at-rule name and its parameters.
  • +
  • left: the space symbols between /* and the comment’s text.
  • +
  • right: the space symbols between the comment’s text +and */.
  • +
  • important: the content of the important statement, +if it is not just !important.
  • +
+

PostCSS cleans selectors, declaration values and at-rule parameters +from comments and extra spaces, but it stores origin content in raws +properties. As such, if you don’t change a declaration’s value, +PostCSS will use the raw value with comments.

+
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Example
+ +
const root = postcss.parse('a {\n  color:black\n}')
+root.first.first.raws //=> { before: '\n  ', between: ':' }
+ + + + + +

source :source

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

the input source of the node

+

The property is used in source map generation.

+

If you create a node manually (e.g., with postcss.decl()), +that node will not have a source property and will be absent +from the source map. For this reason, the plugin developer should +consider cloning nodes to create new ones (in which case the new node’s +source will reference the original, cloned node) or setting +the source property manually.

+
// Bad
+const prefixed = postcss.decl({
+  prop: '-moz-' + decl.prop,
+  value: decl.value
+});
+
+// Good
+const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
if ( atrule.name == 'add-link' ) {
+  const rule = postcss.rule({ selector: 'a', source: atrule.source });
+  atrule.parent.insertBefore(atrule, rule);
+}
+
+ + + +
Type:
+ + + + + + +
Example
+ +
decl.source.input.from //=> '/home/ai/a.sass'
+decl.source.start      //=> { line: 10, column: 2 }
+decl.source.end        //=> { line: 10, column: 12 }
+ + + + + +

type :string

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

String representing the node’s type. + Possible values are root, atrule, rule, + decl, or comment.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
Example
+ +
postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
+ + + + + + + +

Methods

+ + + + + + +

clone(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

+
+ + + + + + + + + +
Example
+ +
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

clone of the node

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneAfter(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Shortcut to clone the node and insert the resulting cloned node +after the current node.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

cloneBefore(overridesopt) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Shortcut to clone the node and insert the resulting cloned node +before the current node.

+
+ + + + + + + + + +
Example
+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
overrides + + +object + + + + + + <optional>
+ + + + + +

new properties to override in the clone.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • new node
  • +
+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

error(message, optsopt) → {CssSyntaxError}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

+
+ + + + + + + + + +
Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

error description

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the error

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

error object to throw it

+
+ + + +
+
+ Type +
+
+ +CssSyntaxError + + +
+
+ + + + + + + + + +

moveAfter(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent after otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be after current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveBefore(otherNode) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it into +a new parent before otherNode.

+

This will also clean the node’s code style properties just as it would +in Node#moveTo.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
otherNode + + +Node + + + +

node that will be before current node

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

moveTo(newParent) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its current parent and inserts it +at the end of newParent.

+

This will clean the before and after code Node#raws data +from the node and replace them with the indentation style of newParent. +It will also clean the between property +if newParent is in another Root.

+
+ + + + + + + + + +
Example
+ +
atrule.moveTo(atrule.root());
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
newParent + + +Container + + + +

container node where the current node + will be moved

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

next() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the next child of the node’s parent. +Returns undefined if the current node is the last child.

+
+ + + + + + + + + +
Example
+ +
if ( comment.text === 'delete next' ) {
+  const next = comment.next();
+  if ( next ) {
+    next.remove();
+  }
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

next node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

prev() → {Node|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns the previous child of the node’s parent. +Returns undefined if the current node is the first child.

+
+ + + + + + + + + +
Example
+ +
const annotation = decl.prev();
+if ( annotation.type == 'comment' ) {
+ readAnnotation(annotation.text);
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

previous node

+
+ + + +
+
+ Type +
+
+ +Node +| + +undefined + + +
+
+ + + + + + + + + +

raw(prop, defaultTypeopt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a Node#raws value. If the node is missing +the code style property (because the node was manually built or cloned), +PostCSS will try to autodetect the code style property by looking +at other nodes in the tree.

+
+ + + + + + + + + +
Example
+ +
const root = postcss.parse('a { background: white }');
+root.nodes[0].append({ prop: 'color', value: 'black' });
+root.nodes[0].nodes[1].raws.before   //=> undefined
+root.nodes[0].nodes[1].raw('before') //=> ' '
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
prop + + +string + + + + + + + + + +

name of code style property

defaultType + + +string + + + + + + <optional>
+ + + + + +

name of default value, it can be missed + if the value is the same as prop

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

code style value

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

remove() → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Removes the node from its parent and cleans the parent properties +from the node and its children.

+
+ + + + + + + + + +
Example
+ +
if ( decl.prop.match(/^-webkit-/) ) {
+  decl.remove();
+}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

node to make calls chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

replaceWith(…nodes) → {Node}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Inserts node(s) before the current node and removes the current node.

+
+ + + + + + + + + +
Example
+ +
if ( atrule.name == 'mixin' ) {
+  atrule.replaceWith(mixinRules[atrule.params]);
+}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nodes + + +Node + + + + + + + + + + <repeatable>
+ +

node(s) to replace current one

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

current node to methods chain

+
+ + + +
+
+ Type +
+
+ +Node + + +
+
+ + + + + + + + + +

root() → {Root}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Finds the Root instance of the node’s tree.

+
+ + + + + + + + + +
Example
+ +
root.nodes[0].nodes[0].root() === root
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

root parent

+
+ + + +
+
+ Type +
+
+ +Root + + +
+
+ + + + + + + + + +

toString(stringifieropt) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Returns a CSS string representing the node.

+
+ + + + + + + + + +
Example
+ +
postcss.rule({ selector: 'a' }).toString() //=> "a {}"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
stringifier + + +stringifier +| + +syntax + + + + + + <optional>
+ + + + + +

a syntax to use + in string generation

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

CSS string of this node

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + +

warn(result, text, optsopt) → {Warning}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

This method is provided as a convenience wrapper for Result#warn.

+
+ + + + + + + + + +
Example
+ +
const plugin = postcss.plugin('postcss-deprecated', () => {
+  return (root, result) => {
+    root.walkDecls('bad', decl => {
+      decl.warn(result, 'Deprecated property bad');
+    });
+  };
+});
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
result + + +Result + + + + + + + + + +

the Result instance + that will receive the warning

text + + +string + + + + + + + + + +

warning message

opts + + +object + + + + + + <optional>
+ + + + + +

options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plugin + + +string + + + +

plugin name that created this warning. + PostCSS will set it automatically.

word + + +string + + + +

a word inside a node’s string that should + be highlighted as the source of the warning

index + + +number + + + +

an index inside a node’s string that should + be highlighted as the source of the warning

+ +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

created warning object

+
+ + + +
+
+ Type +
+
+ +Warning + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. +
+ + + + + \ No newline at end of file diff --git a/PreviousMap.html b/PreviousMap.html index 01460cb2c..5488e26c9 100644 --- a/PreviousMap.html +++ b/PreviousMap.html @@ -22,7 +22,7 @@
@@ -561,7 +561,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Processor.html b/Processor.html index df7b39905..b7ecbd693 100644 --- a/Processor.html +++ b/Processor.html @@ -22,7 +22,7 @@
@@ -796,7 +796,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Result.html b/Result.html index ce1bda8b6..3146da0ee 100644 --- a/Result.html +++ b/Result.html @@ -22,7 +22,7 @@
@@ -575,8 +575,8 @@
Type:
Example
postcss.plugin('postcss-min-browser', () => {
-  return (css, result) => {
-    var browsers = detectMinBrowsersByCanIUse(css);
+  return (root, result) => {
+    var browsers = detectMinBrowsersByCanIUse(root);
     result.messages.push({
       type:    'min-browser',
       plugin:  'postcss-min-browser',
@@ -1397,7 +1397,7 @@ 
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Root.html b/Root.html index a701a33fe..8513e1c69 100644 --- a/Root.html +++ b/Root.html @@ -22,7 +22,7 @@
@@ -179,7 +179,7 @@

firstSource:
@@ -262,7 +262,7 @@

lastSource:
@@ -345,7 +345,7 @@

nodesSource:
@@ -431,7 +431,7 @@

parentSource:
@@ -605,7 +605,7 @@

sourceSource:
@@ -708,7 +708,7 @@

typeSource:
@@ -803,7 +803,7 @@

appendSource:
@@ -999,7 +999,7 @@

cloneSource:
@@ -1181,7 +1181,7 @@

cloneAfter<
Source:
@@ -1226,7 +1226,7 @@

cloneAfter<
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node after the current node.

@@ -1356,7 +1356,7 @@

cloneBefor
Source:
@@ -1401,7 +1401,7 @@

cloneBefor
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node before the current node.

@@ -1536,7 +1536,7 @@

eachSource:
@@ -1724,7 +1724,7 @@

errorSource:
@@ -2043,7 +2043,7 @@

everySource:
@@ -2209,7 +2209,7 @@

indexSource:
@@ -2374,7 +2374,7 @@

insertAfte
Source:
@@ -2569,7 +2569,7 @@

insertBef
Source:
@@ -2769,7 +2769,7 @@

moveAfterSource:
@@ -2932,7 +2932,7 @@

moveBefore<
Source:
@@ -3095,7 +3095,7 @@

moveToSource:
@@ -3266,7 +3266,7 @@

nextSource:
@@ -3391,7 +3391,7 @@

prependSource:
@@ -3587,7 +3587,7 @@

prevSource:
@@ -3710,7 +3710,7 @@

rawSource:
@@ -3925,7 +3925,7 @@

removeSource:
@@ -4044,7 +4044,7 @@

removeAllSource:
@@ -4162,7 +4162,7 @@

removeChil
Source:
@@ -4334,7 +4334,7 @@

replaceV
Source:
@@ -4636,7 +4636,7 @@

replaceWit
Source:
@@ -4815,7 +4815,7 @@

rootSource:
@@ -4931,7 +4931,7 @@

someSource:
@@ -5272,7 +5272,7 @@

toStringSource:
@@ -5453,7 +5453,7 @@

walkSource:
@@ -5628,7 +5628,7 @@

walkAtRule
Source:
@@ -5859,7 +5859,7 @@

walkComme
Source:
@@ -6032,7 +6032,7 @@

walkDeclsSource:
@@ -6262,7 +6262,7 @@

walkRulesSource:
@@ -6486,7 +6486,7 @@

warnSource:
@@ -6545,8 +6545,8 @@

warnconst plugin = postcss.plugin('postcss-deprecated', () => { - return (css, result) => { - css.walkDecls('bad', decl => { + return (root, result) => { + root.walkDecls('bad', decl => { decl.warn(result, 'Deprecated property bad'); }); }; @@ -6831,7 +6831,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Rule.html b/Rule.html index 29717c4c3..6bc316c52 100644 --- a/Rule.html +++ b/Rule.html @@ -22,7 +22,7 @@
@@ -180,7 +180,7 @@

firstSource:
@@ -263,7 +263,7 @@

lastSource:
@@ -346,7 +346,7 @@

nodesSource:
@@ -432,7 +432,7 @@

parentSource:
@@ -784,7 +784,7 @@

sourceSource:
@@ -887,7 +887,7 @@

typeSource:
@@ -982,7 +982,7 @@

appendSource:
@@ -1178,7 +1178,7 @@

cloneSource:
@@ -1360,7 +1360,7 @@

cloneAfter<
Source:
@@ -1405,7 +1405,7 @@

cloneAfter<
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node after the current node.

@@ -1535,7 +1535,7 @@

cloneBefor
Source:
@@ -1580,7 +1580,7 @@

cloneBefor
-

hortcut to clone the node and insert the resulting cloned node +

Shortcut to clone the node and insert the resulting cloned node before the current node.

@@ -1715,7 +1715,7 @@

eachSource:
@@ -1903,7 +1903,7 @@

errorSource:
@@ -2222,7 +2222,7 @@

everySource:
@@ -2388,7 +2388,7 @@

indexSource:
@@ -2553,7 +2553,7 @@

insertAfte
Source:
@@ -2748,7 +2748,7 @@

insertBef
Source:
@@ -2948,7 +2948,7 @@

moveAfterSource:
@@ -3111,7 +3111,7 @@

moveBefore<
Source:
@@ -3274,7 +3274,7 @@

moveToSource:
@@ -3445,7 +3445,7 @@

nextSource:
@@ -3570,7 +3570,7 @@

prependSource:
@@ -3766,7 +3766,7 @@

prevSource:
@@ -3889,7 +3889,7 @@

rawSource:
@@ -4104,7 +4104,7 @@

removeSource:
@@ -4223,7 +4223,7 @@

removeAllSource:
@@ -4341,7 +4341,7 @@

removeChil
Source:
@@ -4513,7 +4513,7 @@

replaceV
Source:
@@ -4815,7 +4815,7 @@

replaceWit
Source:
@@ -4994,7 +4994,7 @@

rootSource:
@@ -5110,7 +5110,7 @@

someSource:
@@ -5276,7 +5276,7 @@

toStringSource:
@@ -5457,7 +5457,7 @@

walkSource:
@@ -5632,7 +5632,7 @@

walkAtRule
Source:
@@ -5863,7 +5863,7 @@

walkComme
Source:
@@ -6036,7 +6036,7 @@

walkDeclsSource:
@@ -6266,7 +6266,7 @@

walkRulesSource:
@@ -6490,7 +6490,7 @@

warnSource:
@@ -6549,8 +6549,8 @@

warnconst plugin = postcss.plugin('postcss-deprecated', () => { - return (css, result) => { - css.walkDecls('bad', decl => { + return (root, result) => { + root.walkDecls('bad', decl => { decl.warn(result, 'Deprecated property bad'); }); }; @@ -6835,7 +6835,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/Warning.html b/Warning.html index b365fb860..d6be4ac34 100644 --- a/Warning.html +++ b/Warning.html @@ -22,7 +22,7 @@
@@ -977,7 +977,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/at-rule.es6.html b/at-rule.es6.html index bd6b80266..7dbf7a180 100644 --- a/at-rule.es6.html +++ b/at-rule.es6.html @@ -22,7 +22,7 @@
@@ -163,7 +163,7 @@

at-rule.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/comment.es6.html b/comment.es6.html index a9ea5d84e..267d42222 100644 --- a/comment.es6.html +++ b/comment.es6.html @@ -22,7 +22,7 @@
@@ -107,7 +107,7 @@

comment.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/container.es6.html b/container.es6.html index 78f9918fe..fcab91734 100644 --- a/container.es6.html +++ b/container.es6.html @@ -22,7 +22,7 @@
@@ -74,7 +74,6 @@

container.es6

* * @extends Node * @abstract - * @ignore */ class Container extends Node { @@ -793,7 +792,7 @@

container.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/css-syntax-error.es6.html b/css-syntax-error.es6.html index dc7c1e294..746afbc30 100644 --- a/css-syntax-error.es6.html +++ b/css-syntax-error.es6.html @@ -22,7 +22,7 @@
@@ -262,7 +262,7 @@

css-syntax-error.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/declaration.es6.html b/declaration.es6.html index 21ab18cc6..3bcda53c5 100644 --- a/declaration.es6.html +++ b/declaration.es6.html @@ -22,7 +22,7 @@
@@ -150,7 +150,7 @@

declaration.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/global.html b/global.html index fe4f9f57c..7e391f1ca 100644 --- a/global.html +++ b/global.html @@ -22,7 +22,7 @@
@@ -2898,7 +2898,7 @@
Type:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/index.html b/index.html index 1d0a49893..955f9ddeb 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@
@@ -55,7 +55,7 @@

Home

Classes

Asynchronous plugins should return a Promise instance.

postcss.plugin('postcss-import', () => {
-  return (css, result) => {
+  return (root, result) => {
     return new Promise( (resolve, reject) => {
       fs.readFile('base.css', (base) => {
-        css.prepend(base);
+        root.prepend(base);
         resolve();
       });
     });
@@ -1101,7 +1101,7 @@ 

(static) plugi });

Add warnings using the Node#warn method. Send data to other plugins using the Result#messages array.

postcss.plugin('postcss-caniuse-test', () => {
-  return (css, result) => {
+  return (root, result) => {
     css.walkDecls(decl => {
       if ( !caniuse.support(decl.prop) ) {
         decl.warn(result, 'Some browsers do not support ' + decl.prop);
@@ -1769,7 +1769,7 @@ 
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/previous-map.es6.html b/previous-map.es6.html index aeedef9a2..ff759a24a 100644 --- a/previous-map.es6.html +++ b/previous-map.es6.html @@ -22,7 +22,7 @@
@@ -193,7 +193,7 @@

previous-map.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/processor.es6.html b/processor.es6.html index dc8721ca4..5471ab5c6 100644 --- a/processor.es6.html +++ b/processor.es6.html @@ -22,7 +22,7 @@
@@ -146,7 +146,7 @@

processor.es6

* throw new Error('This plugin works only with PostCSS 5'); * } */ - this.version = '5.0.21'; + this.version = '5.1.2'; /** * @member {pluginFunction[]} - Plugins added to this processor. * @@ -248,7 +248,7 @@

processor.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/result.es6.html b/result.es6.html index c750da7bf..f47261818 100644 --- a/result.es6.html +++ b/result.es6.html @@ -22,7 +22,7 @@
@@ -88,8 +88,8 @@

result.es6

* * @example * postcss.plugin('postcss-min-browser', () => { - * return (css, result) => { - * var browsers = detectMinBrowsersByCanIUse(css); + * return (root, result) => { + * var browsers = detectMinBrowsersByCanIUse(root); * result.messages.push({ * type: 'min-browser', * plugin: 'postcss-min-browser', @@ -222,7 +222,7 @@

result.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/root.es6.html b/root.es6.html index aab682ae3..135ec5435 100644 --- a/root.es6.html +++ b/root.es6.html @@ -22,7 +22,7 @@
@@ -150,7 +150,7 @@

root.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/rule.es6.html b/rule.es6.html index 8114cdf19..b450b8019 100644 --- a/rule.es6.html +++ b/rule.es6.html @@ -22,7 +22,7 @@
@@ -150,7 +150,7 @@

rule.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/vendor.es6.html b/vendor.es6.html index f37ede247..943d0a00f 100644 --- a/vendor.es6.html +++ b/vendor.es6.html @@ -22,7 +22,7 @@
@@ -101,7 +101,7 @@

vendor.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/vendor.html b/vendor.html index f2d5e1dd5..df9750ce7 100644 --- a/vendor.html +++ b/vendor.html @@ -22,7 +22,7 @@
@@ -461,7 +461,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
diff --git a/warning.es6.html b/warning.es6.html index 8854ba1dd..8a3774754 100644 --- a/warning.es6.html +++ b/warning.es6.html @@ -22,7 +22,7 @@
@@ -154,7 +154,7 @@

warning.es6


- Documentation generated by JSDoc 3.4.0 on Tue Jun 28 2016 12:03:45 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme.
From c06bafd1b016b07d9b3dd2b14778372267d0bdee Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 8 Sep 2016 11:58:36 +1000 Subject: [PATCH 11/17] Update JSDocs for 5.2 --- AtRule.html | 4 +-- Comment.html | 2 +- Container.html | 4 +-- CssSyntaxError.html | 40 +++++++++++++------------ Declaration.html | 2 +- Input.html | 2 +- LazyResult.html | 2 +- Node.html | 2 +- PreviousMap.html | 2 +- Processor.html | 2 +- Result.html | 2 +- Root.html | 4 +-- Rule.html | 4 +-- Warning.html | 2 +- at-rule.es6.html | 2 +- comment.es6.html | 2 +- container.es6.html | 4 +-- css-syntax-error.es6.html | 62 +++++++++++++++++++++++---------------- declaration.es6.html | 2 +- global.html | 2 +- index.html | 2 +- input.es6.html | 2 +- lazy-result.es6.html | 2 +- list.es6.html | 2 +- list.html | 2 +- node.es6.html | 2 +- postcss.es6.html | 2 +- postcss.html | 2 +- previous-map.es6.html | 2 +- processor.es6.html | 4 +-- result.es6.html | 2 +- root.es6.html | 2 +- rule.es6.html | 2 +- vendor.es6.html | 2 +- vendor.html | 2 +- warning.es6.html | 2 +- 36 files changed, 97 insertions(+), 85 deletions(-) diff --git a/AtRule.html b/AtRule.html index 6042dc220..bde1bb25f 100644 --- a/AtRule.html +++ b/AtRule.html @@ -3651,7 +3651,7 @@
Example
root.walkRules(rule => { selectors.push(rule.selector); }); -console.log(`Your CSS uses ${selectors.length} selectors');
+console.log(`Your CSS uses ${selectors.length} selectors`); @@ -3809,7 +3809,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Comment.html b/Comment.html index de2804cca..e4c98bfe3 100644 --- a/Comment.html +++ b/Comment.html @@ -3370,7 +3370,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Container.html b/Container.html index b2a8ebea6..24762cb4c 100644 --- a/Container.html +++ b/Container.html @@ -6072,7 +6072,7 @@
Example
root.walkRules(rule => { selectors.push(rule.selector); }); -console.log(`Your CSS uses ${selectors.length} selectors');
+console.log(`Your CSS uses ${selectors.length} selectors`);
@@ -6574,7 +6574,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/CssSyntaxError.html b/CssSyntaxError.html index 50d64589c..4abf66b78 100644 --- a/CssSyntaxError.html +++ b/CssSyntaxError.html @@ -76,7 +76,7 @@

new Css
Source:
@@ -407,7 +407,7 @@

columnSource:
@@ -486,7 +486,7 @@

fileSource:
@@ -565,7 +565,7 @@

inputSource:
@@ -648,7 +648,7 @@

lineSource:
@@ -727,7 +727,7 @@

messageSource:
@@ -806,7 +806,7 @@

nameSource:
@@ -890,7 +890,7 @@

pluginSource:
@@ -968,7 +968,7 @@

reasonSource:
@@ -1046,7 +1046,7 @@

sourceSource:
@@ -1135,7 +1135,7 @@

showSou
Source:
@@ -1190,10 +1190,12 @@

showSou

Example
-
error.showSourceCode() //=> "a {
-                       //      bad
-                       //      ^
-                       //    }"
+
error.showSourceCode() //=> "  4 | }
+                       //      5 | a {
+                       //    > 6 |   bad
+                       //        |   ^
+                       //      7 | }
+                       //      8 b {"
@@ -1315,7 +1317,7 @@

toStringSource:
@@ -1369,8 +1371,8 @@

toStringExample

error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
-                 //    a {
-                 //    ^"
+ // > 1 | a { + // | ^" @@ -1429,7 +1431,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Declaration.html b/Declaration.html index 07bb55407..db9c642b6 100644 --- a/Declaration.html +++ b/Declaration.html @@ -3558,7 +3558,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Input.html b/Input.html index c1bf50028..abe248a6a 100644 --- a/Input.html +++ b/Input.html @@ -859,7 +859,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/LazyResult.html b/LazyResult.html index b9f1438da..366012bc4 100644 --- a/LazyResult.html +++ b/LazyResult.html @@ -1323,7 +1323,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Node.html b/Node.html index 23b35da36..f496816a1 100644 --- a/Node.html +++ b/Node.html @@ -3272,7 +3272,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/PreviousMap.html b/PreviousMap.html index 5488e26c9..34ba1a5b8 100644 --- a/PreviousMap.html +++ b/PreviousMap.html @@ -561,7 +561,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Processor.html b/Processor.html index b7ecbd693..e5282cacd 100644 --- a/Processor.html +++ b/Processor.html @@ -796,7 +796,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Result.html b/Result.html index 3146da0ee..32ee09dab 100644 --- a/Result.html +++ b/Result.html @@ -1397,7 +1397,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Root.html b/Root.html index 8513e1c69..28f90ce84 100644 --- a/Root.html +++ b/Root.html @@ -6329,7 +6329,7 @@
Example
root.walkRules(rule => { selectors.push(rule.selector); }); -console.log(`Your CSS uses ${selectors.length} selectors'); +console.log(`Your CSS uses ${selectors.length} selectors`); @@ -6831,7 +6831,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Rule.html b/Rule.html index 6bc316c52..5dd444194 100644 --- a/Rule.html +++ b/Rule.html @@ -6333,7 +6333,7 @@
Example
root.walkRules(rule => { selectors.push(rule.selector); }); -console.log(`Your CSS uses ${selectors.length} selectors'); +console.log(`Your CSS uses ${selectors.length} selectors`); @@ -6835,7 +6835,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Warning.html b/Warning.html index d6be4ac34..c35071981 100644 --- a/Warning.html +++ b/Warning.html @@ -977,7 +977,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/at-rule.es6.html b/at-rule.es6.html index 7dbf7a180..10021ace3 100644 --- a/at-rule.es6.html +++ b/at-rule.es6.html @@ -163,7 +163,7 @@

at-rule.es6


- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/comment.es6.html b/comment.es6.html index 267d42222..e4ecdba82 100644 --- a/comment.es6.html +++ b/comment.es6.html @@ -107,7 +107,7 @@

comment.es6


- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/container.es6.html b/container.es6.html index fcab91734..32c8ddcd9 100644 --- a/container.es6.html +++ b/container.es6.html @@ -242,7 +242,7 @@

container.es6

* root.walkRules(rule => { * selectors.push(rule.selector); * }); - * console.log(`Your CSS uses ${selectors.length} selectors'); + * console.log(`Your CSS uses ${selectors.length} selectors`); */ walkRules(selector, callback) { if ( !callback ) { @@ -792,7 +792,7 @@

container.es6


- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/css-syntax-error.es6.html b/css-syntax-error.es6.html index 746afbc30..348a474cc 100644 --- a/css-syntax-error.es6.html +++ b/css-syntax-error.es6.html @@ -39,7 +39,8 @@

css-syntax-error.es6

import supportsColor from 'supports-color';
 
-import warnOnce from './warn-once';
+import terminalHighlight from './terminal-highlight';
+import warnOnce          from './warn-once';
 
 /**
  * The CSS parser throws this error for broken CSS.
@@ -183,36 +184,41 @@ 

css-syntax-error.es6

* and `process.env.NODE_DISABLE_COLORS`. * * @example - * error.showSourceCode() //=> "a { - * // bad - * // ^ - * // }" + * error.showSourceCode() //=> " 4 | } + * // 5 | a { + * // > 6 | bad + * // | ^ + * // 7 | } + * // 8 b {" * * @return {string} few lines of CSS source that caused the error */ showSourceCode(color) { if ( !this.source ) return ''; - let num = this.line - 1; - let lines = this.source.split('\n'); - - let prev = num > 0 ? lines[num - 1] + '\n' : ''; - let broken = lines[num]; - let next = num < lines.length - 1 ? '\n' + lines[num + 1] : ''; + let css = this.source; + if ( typeof color === 'undefined' ) color = supportsColor; + if ( color ) css = terminalHighlight(css); - let mark = '\n'; - for ( let i = 0; i < this.column - 1; i++ ) { - mark += ' '; - } + let lines = css.split(/\r?\n/); + let start = Math.max(this.line - 3, 0); + let end = Math.min(this.line + 2, lines.length); - if ( typeof color === 'undefined' ) color = supportsColor; - if ( color ) { - mark += '\x1B[1;31m^\x1B[0m'; - } else { - mark += '^'; - } + let maxWidth = String(end).length; - return '\n' + prev + broken + mark + next; + return lines.slice(start, end).map( (line, index) => { + let number = start + 1 + index; + let padded = (' ' + number).slice(-maxWidth); + let gutter = ' ' + padded + ' | '; + if ( number === this.line ) { + let spacing = + gutter.replace(/\d/g, ' ') + + line.slice(0, this.column - 1).replace(/[^\t]/g, ' '); + return '>' + gutter + line + '\n ' + spacing + '^'; + } else { + return ' ' + gutter + line; + } + }).join('\n'); } /** @@ -220,13 +226,17 @@

css-syntax-error.es6

* * @example * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block - * // a { - * // ^" + * // > 1 | a { + * // | ^" * * @return {string} error position, message and source code */ toString() { - return this.name + ': ' + this.message + this.showSourceCode(); + let code = this.showSourceCode(); + if ( code ) { + code = '\n\n' + code + '\n'; + } + return this.name + ': ' + this.message + code; } get generated() { @@ -262,7 +272,7 @@

css-syntax-error.es6


- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/declaration.es6.html b/declaration.es6.html index 3bcda53c5..2ae84ea55 100644 --- a/declaration.es6.html +++ b/declaration.es6.html @@ -150,7 +150,7 @@

declaration.es6


- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/global.html b/global.html index 7e391f1ca..225c37d71 100644 --- a/global.html +++ b/global.html @@ -2898,7 +2898,7 @@
Type:

- Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
diff --git a/index.html b/index.html index 955f9ddeb..50a60b95b 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@

Home

Classes

  • diff --git a/input.es6.html b/input.es6.html index adbd41db4..81c87e0e8 100644 --- a/input.es6.html +++ b/input.es6.html @@ -214,7 +214,7 @@

    input.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/lazy-result.es6.html b/lazy-result.es6.html index 84a9ef06d..ea02f7c8f 100644 --- a/lazy-result.es6.html +++ b/lazy-result.es6.html @@ -409,7 +409,7 @@

    lazy-result.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/list.es6.html b/list.es6.html index 0453789bb..9ad05aa7d 100644 --- a/list.es6.html +++ b/list.es6.html @@ -139,7 +139,7 @@

    list.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/list.html b/list.html index a1f6c238a..967cd5319 100644 --- a/list.html +++ b/list.html @@ -464,7 +464,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/node.es6.html b/node.es6.html index ba631557a..f3496f674 100644 --- a/node.es6.html +++ b/node.es6.html @@ -623,7 +623,7 @@

    node.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/postcss.es6.html b/postcss.es6.html index 23ba7adfe..1ea93936c 100644 --- a/postcss.es6.html +++ b/postcss.es6.html @@ -290,7 +290,7 @@

    postcss.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/postcss.html b/postcss.html index 837effefc..68777d897 100644 --- a/postcss.html +++ b/postcss.html @@ -1769,7 +1769,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/previous-map.es6.html b/previous-map.es6.html index ff759a24a..c8bab7065 100644 --- a/previous-map.es6.html +++ b/previous-map.es6.html @@ -193,7 +193,7 @@

    previous-map.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/processor.es6.html b/processor.es6.html index 5471ab5c6..1184bf573 100644 --- a/processor.es6.html +++ b/processor.es6.html @@ -146,7 +146,7 @@

    processor.es6

    * throw new Error('This plugin works only with PostCSS 5'); * } */ - this.version = '5.1.2'; + this.version = '5.2.0'; /** * @member {pluginFunction[]} - Plugins added to this processor. * @@ -248,7 +248,7 @@

    processor.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/result.es6.html b/result.es6.html index f47261818..0005ae843 100644 --- a/result.es6.html +++ b/result.es6.html @@ -222,7 +222,7 @@

    result.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/root.es6.html b/root.es6.html index 135ec5435..d69416d4a 100644 --- a/root.es6.html +++ b/root.es6.html @@ -150,7 +150,7 @@

    root.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/rule.es6.html b/rule.es6.html index b450b8019..149275b43 100644 --- a/rule.es6.html +++ b/rule.es6.html @@ -150,7 +150,7 @@

    rule.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/vendor.es6.html b/vendor.es6.html index 943d0a00f..7617715f1 100644 --- a/vendor.es6.html +++ b/vendor.es6.html @@ -101,7 +101,7 @@

    vendor.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/vendor.html b/vendor.html index df9750ce7..75fdbd9bd 100644 --- a/vendor.html +++ b/vendor.html @@ -461,7 +461,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/warning.es6.html b/warning.es6.html index 8a3774754..1a3d09679 100644 --- a/warning.es6.html +++ b/warning.es6.html @@ -154,7 +154,7 @@

    warning.es6


    - Documentation generated by JSDoc 3.4.0 on Tue Aug 30 2016 03:41:22 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme.
    From 37ff4f333363ca16db1cdf9831cfa5c563fb36c6 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 8 Sep 2016 12:01:30 +1000 Subject: [PATCH 12/17] Fix syntax error example --- AtRule.html | 2 +- Comment.html | 2 +- Container.html | 2 +- CssSyntaxError.html | 4 ++-- Declaration.html | 2 +- Input.html | 2 +- LazyResult.html | 2 +- Node.html | 2 +- PreviousMap.html | 2 +- Processor.html | 2 +- Result.html | 2 +- Root.html | 2 +- Rule.html | 2 +- Warning.html | 2 +- at-rule.es6.html | 2 +- comment.es6.html | 2 +- container.es6.html | 2 +- css-syntax-error.es6.html | 4 ++-- declaration.es6.html | 2 +- global.html | 2 +- index.html | 2 +- input.es6.html | 2 +- lazy-result.es6.html | 2 +- list.es6.html | 2 +- list.html | 2 +- node.es6.html | 2 +- postcss.es6.html | 2 +- postcss.html | 2 +- previous-map.es6.html | 2 +- processor.es6.html | 2 +- result.es6.html | 2 +- root.es6.html | 2 +- rule.es6.html | 2 +- vendor.es6.html | 2 +- vendor.html | 2 +- warning.es6.html | 2 +- 36 files changed, 38 insertions(+), 38 deletions(-) diff --git a/AtRule.html b/AtRule.html index bde1bb25f..51dcfd248 100644 --- a/AtRule.html +++ b/AtRule.html @@ -3809,7 +3809,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Comment.html b/Comment.html index e4c98bfe3..731399988 100644 --- a/Comment.html +++ b/Comment.html @@ -3370,7 +3370,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Container.html b/Container.html index 24762cb4c..ffd839073 100644 --- a/Container.html +++ b/Container.html @@ -6574,7 +6574,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/CssSyntaxError.html b/CssSyntaxError.html index 4abf66b78..2259d264d 100644 --- a/CssSyntaxError.html +++ b/CssSyntaxError.html @@ -1195,7 +1195,7 @@
    Example
    // > 6 | bad // | ^ // 7 | } - // 8 b {"
+ // 8 | b {" @@ -1431,7 +1431,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Declaration.html b/Declaration.html index db9c642b6..0e60c9f54 100644 --- a/Declaration.html +++ b/Declaration.html @@ -3558,7 +3558,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Input.html b/Input.html index abe248a6a..8442cf3f6 100644 --- a/Input.html +++ b/Input.html @@ -859,7 +859,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/LazyResult.html b/LazyResult.html index 366012bc4..32be819b2 100644 --- a/LazyResult.html +++ b/LazyResult.html @@ -1323,7 +1323,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Node.html b/Node.html index f496816a1..86e0c68ae 100644 --- a/Node.html +++ b/Node.html @@ -3272,7 +3272,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/PreviousMap.html b/PreviousMap.html index 34ba1a5b8..34db64e19 100644 --- a/PreviousMap.html +++ b/PreviousMap.html @@ -561,7 +561,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Processor.html b/Processor.html index e5282cacd..d8b189e75 100644 --- a/Processor.html +++ b/Processor.html @@ -796,7 +796,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Result.html b/Result.html index 32ee09dab..58f43f0dc 100644 --- a/Result.html +++ b/Result.html @@ -1397,7 +1397,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Root.html b/Root.html index 28f90ce84..e42263bf4 100644 --- a/Root.html +++ b/Root.html @@ -6831,7 +6831,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Rule.html b/Rule.html index 5dd444194..5a0fe1eb2 100644 --- a/Rule.html +++ b/Rule.html @@ -6835,7 +6835,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/Warning.html b/Warning.html index c35071981..f07f46159 100644 --- a/Warning.html +++ b/Warning.html @@ -977,7 +977,7 @@
Returns:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/at-rule.es6.html b/at-rule.es6.html index 10021ace3..f10583ab7 100644 --- a/at-rule.es6.html +++ b/at-rule.es6.html @@ -163,7 +163,7 @@

at-rule.es6


- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/comment.es6.html b/comment.es6.html index e4ecdba82..162b4c291 100644 --- a/comment.es6.html +++ b/comment.es6.html @@ -107,7 +107,7 @@

comment.es6


- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/container.es6.html b/container.es6.html index 32c8ddcd9..cf0048cd4 100644 --- a/container.es6.html +++ b/container.es6.html @@ -792,7 +792,7 @@

container.es6


- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/css-syntax-error.es6.html b/css-syntax-error.es6.html index 348a474cc..2e7d2d2f1 100644 --- a/css-syntax-error.es6.html +++ b/css-syntax-error.es6.html @@ -189,7 +189,7 @@

css-syntax-error.es6

* // > 6 | bad * // | ^ * // 7 | } - * // 8 b {" + * // 8 | b {" * * @return {string} few lines of CSS source that caused the error */ @@ -272,7 +272,7 @@

css-syntax-error.es6


- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/declaration.es6.html b/declaration.es6.html index 2ae84ea55..0a6d87b55 100644 --- a/declaration.es6.html +++ b/declaration.es6.html @@ -150,7 +150,7 @@

declaration.es6


- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/global.html b/global.html index 225c37d71..80b68c693 100644 --- a/global.html +++ b/global.html @@ -2898,7 +2898,7 @@
Type:

- Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
diff --git a/index.html b/index.html index 50a60b95b..5f2ee3cf0 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@

Home

Classes

  • diff --git a/input.es6.html b/input.es6.html index 81c87e0e8..3db61af18 100644 --- a/input.es6.html +++ b/input.es6.html @@ -214,7 +214,7 @@

    input.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/lazy-result.es6.html b/lazy-result.es6.html index ea02f7c8f..8e1c78309 100644 --- a/lazy-result.es6.html +++ b/lazy-result.es6.html @@ -409,7 +409,7 @@

    lazy-result.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/list.es6.html b/list.es6.html index 9ad05aa7d..6313ea09f 100644 --- a/list.es6.html +++ b/list.es6.html @@ -139,7 +139,7 @@

    list.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/list.html b/list.html index 967cd5319..3e03c37d2 100644 --- a/list.html +++ b/list.html @@ -464,7 +464,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/node.es6.html b/node.es6.html index f3496f674..8398b4d11 100644 --- a/node.es6.html +++ b/node.es6.html @@ -623,7 +623,7 @@

    node.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/postcss.es6.html b/postcss.es6.html index 1ea93936c..d9932e6c9 100644 --- a/postcss.es6.html +++ b/postcss.es6.html @@ -290,7 +290,7 @@

    postcss.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/postcss.html b/postcss.html index 68777d897..a374a8970 100644 --- a/postcss.html +++ b/postcss.html @@ -1769,7 +1769,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/previous-map.es6.html b/previous-map.es6.html index c8bab7065..9301edf19 100644 --- a/previous-map.es6.html +++ b/previous-map.es6.html @@ -193,7 +193,7 @@

    previous-map.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/processor.es6.html b/processor.es6.html index 1184bf573..dd7880175 100644 --- a/processor.es6.html +++ b/processor.es6.html @@ -248,7 +248,7 @@

    processor.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/result.es6.html b/result.es6.html index 0005ae843..759950bfd 100644 --- a/result.es6.html +++ b/result.es6.html @@ -222,7 +222,7 @@

    result.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/root.es6.html b/root.es6.html index d69416d4a..62306f27b 100644 --- a/root.es6.html +++ b/root.es6.html @@ -150,7 +150,7 @@

    root.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/rule.es6.html b/rule.es6.html index 149275b43..f4bb5b68c 100644 --- a/rule.es6.html +++ b/rule.es6.html @@ -150,7 +150,7 @@

    rule.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/vendor.es6.html b/vendor.es6.html index 7617715f1..acaf66f87 100644 --- a/vendor.es6.html +++ b/vendor.es6.html @@ -101,7 +101,7 @@

    vendor.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/vendor.html b/vendor.html index 75fdbd9bd..06f4c54e8 100644 --- a/vendor.html +++ b/vendor.html @@ -461,7 +461,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/warning.es6.html b/warning.es6.html index 1a3d09679..1e29db96c 100644 --- a/warning.es6.html +++ b/warning.es6.html @@ -154,7 +154,7 @@

    warning.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 11:57:16 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme.
    From 1d3e32c66e2abb0391ca28ce9644ab96de142a69 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Fri, 9 Sep 2016 18:43:24 +1000 Subject: [PATCH 13/17] Fix Container#some docs --- AtRule.html | 6 +++--- Comment.html | 2 +- Container.html | 6 +++--- CssSyntaxError.html | 2 +- Declaration.html | 2 +- Input.html | 2 +- LazyResult.html | 2 +- Node.html | 2 +- PreviousMap.html | 2 +- Processor.html | 2 +- Result.html | 2 +- Root.html | 6 +++--- Rule.html | 6 +++--- Warning.html | 2 +- at-rule.es6.html | 2 +- comment.es6.html | 2 +- container.es6.html | 6 +++--- css-syntax-error.es6.html | 2 +- declaration.es6.html | 2 +- global.html | 2 +- index.html | 2 +- input.es6.html | 2 +- lazy-result.es6.html | 2 +- list.es6.html | 2 +- list.html | 2 +- node.es6.html | 2 +- postcss.es6.html | 2 +- postcss.html | 2 +- previous-map.es6.html | 2 +- processor.es6.html | 2 +- result.es6.html | 2 +- root.es6.html | 2 +- rule.es6.html | 2 +- vendor.es6.html | 2 +- vendor.html | 2 +- warning.es6.html | 2 +- 36 files changed, 46 insertions(+), 46 deletions(-) diff --git a/AtRule.html b/AtRule.html index 51dcfd248..f773138dc 100644 --- a/AtRule.html +++ b/AtRule.html @@ -2668,7 +2668,7 @@

    someconst hasPrefix = rule.every(i => i.prop[0] === '-'); +
    const hasPrefix = rule.some(i => i.prop[0] === '-');
    @@ -2738,7 +2738,7 @@
    Returns:
    -

    is every child pass condition

    +

    is some child pass condition

    @@ -3809,7 +3809,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Comment.html b/Comment.html index 731399988..c050913a8 100644 --- a/Comment.html +++ b/Comment.html @@ -3370,7 +3370,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Container.html b/Container.html index ffd839073..fa0c1a42c 100644 --- a/Container.html +++ b/Container.html @@ -4933,7 +4933,7 @@

    someconst hasPrefix = rule.every(i => i.prop[0] === '-'); +
    const hasPrefix = rule.some(i => i.prop[0] === '-');
    @@ -5003,7 +5003,7 @@
    Returns:
    -

    is every child pass condition

    +

    is some child pass condition

    @@ -6574,7 +6574,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/CssSyntaxError.html b/CssSyntaxError.html index 2259d264d..2ad7f1912 100644 --- a/CssSyntaxError.html +++ b/CssSyntaxError.html @@ -1431,7 +1431,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Declaration.html b/Declaration.html index 0e60c9f54..1c0be8648 100644 --- a/Declaration.html +++ b/Declaration.html @@ -3558,7 +3558,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Input.html b/Input.html index 8442cf3f6..8d0260fa5 100644 --- a/Input.html +++ b/Input.html @@ -859,7 +859,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/LazyResult.html b/LazyResult.html index 32be819b2..c38b2dec3 100644 --- a/LazyResult.html +++ b/LazyResult.html @@ -1323,7 +1323,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Node.html b/Node.html index 86e0c68ae..daa1b8ce0 100644 --- a/Node.html +++ b/Node.html @@ -3272,7 +3272,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/PreviousMap.html b/PreviousMap.html index 34db64e19..eaec00e1a 100644 --- a/PreviousMap.html +++ b/PreviousMap.html @@ -561,7 +561,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Processor.html b/Processor.html index d8b189e75..dd75b4a82 100644 --- a/Processor.html +++ b/Processor.html @@ -796,7 +796,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Result.html b/Result.html index 58f43f0dc..5bc35cbba 100644 --- a/Result.html +++ b/Result.html @@ -1397,7 +1397,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Root.html b/Root.html index e42263bf4..061e83c4e 100644 --- a/Root.html +++ b/Root.html @@ -4990,7 +4990,7 @@

    someconst hasPrefix = rule.every(i => i.prop[0] === '-'); +
    const hasPrefix = rule.some(i => i.prop[0] === '-');
    @@ -5060,7 +5060,7 @@
    Returns:
    -

    is every child pass condition

    +

    is some child pass condition

    @@ -6831,7 +6831,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Rule.html b/Rule.html index 5a0fe1eb2..18d097c01 100644 --- a/Rule.html +++ b/Rule.html @@ -5169,7 +5169,7 @@

    someconst hasPrefix = rule.every(i => i.prop[0] === '-'); +
    const hasPrefix = rule.some(i => i.prop[0] === '-');
    @@ -5239,7 +5239,7 @@
    Returns:
    -

    is every child pass condition

    +

    is some child pass condition

    @@ -6835,7 +6835,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/Warning.html b/Warning.html index f07f46159..ee3d39d0d 100644 --- a/Warning.html +++ b/Warning.html @@ -977,7 +977,7 @@
    Returns:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/at-rule.es6.html b/at-rule.es6.html index f10583ab7..e854d1459 100644 --- a/at-rule.es6.html +++ b/at-rule.es6.html @@ -163,7 +163,7 @@

    at-rule.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/comment.es6.html b/comment.es6.html index 162b4c291..10db5054c 100644 --- a/comment.es6.html +++ b/comment.es6.html @@ -107,7 +107,7 @@

    comment.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/container.es6.html b/container.es6.html index cf0048cd4..b43c07c42 100644 --- a/container.es6.html +++ b/container.es6.html @@ -588,10 +588,10 @@

    container.es6

    * * @param {childCondition} condition - iterator returns true or false. * - * @return {boolean} is every child pass condition + * @return {boolean} is some child pass condition * * @example - * const hasPrefix = rule.every(i => i.prop[0] === '-'); + * const hasPrefix = rule.some(i => i.prop[0] === '-'); */ some(condition) { return this.nodes.some(condition); @@ -792,7 +792,7 @@

    container.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/css-syntax-error.es6.html b/css-syntax-error.es6.html index 2e7d2d2f1..7f97c8b0f 100644 --- a/css-syntax-error.es6.html +++ b/css-syntax-error.es6.html @@ -272,7 +272,7 @@

    css-syntax-error.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/declaration.es6.html b/declaration.es6.html index 0a6d87b55..b5070ad64 100644 --- a/declaration.es6.html +++ b/declaration.es6.html @@ -150,7 +150,7 @@

    declaration.es6


    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/global.html b/global.html index 80b68c693..5538d6cae 100644 --- a/global.html +++ b/global.html @@ -2898,7 +2898,7 @@
    Type:

    - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
    diff --git a/index.html b/index.html index 5f2ee3cf0..56ce7a8a1 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@

    Home

    Classes

    • diff --git a/input.es6.html b/input.es6.html index 3db61af18..ba8f6fcad 100644 --- a/input.es6.html +++ b/input.es6.html @@ -214,7 +214,7 @@

      input.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/lazy-result.es6.html b/lazy-result.es6.html index 8e1c78309..8ee5ba1b9 100644 --- a/lazy-result.es6.html +++ b/lazy-result.es6.html @@ -409,7 +409,7 @@

      lazy-result.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/list.es6.html b/list.es6.html index 6313ea09f..8500bcda3 100644 --- a/list.es6.html +++ b/list.es6.html @@ -139,7 +139,7 @@

      list.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/list.html b/list.html index 3e03c37d2..652de8559 100644 --- a/list.html +++ b/list.html @@ -464,7 +464,7 @@
      Returns:

      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/node.es6.html b/node.es6.html index 8398b4d11..22e538150 100644 --- a/node.es6.html +++ b/node.es6.html @@ -623,7 +623,7 @@

      node.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/postcss.es6.html b/postcss.es6.html index d9932e6c9..25664dd79 100644 --- a/postcss.es6.html +++ b/postcss.es6.html @@ -290,7 +290,7 @@

      postcss.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/postcss.html b/postcss.html index a374a8970..eb1a56f9f 100644 --- a/postcss.html +++ b/postcss.html @@ -1769,7 +1769,7 @@
      Returns:

      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/previous-map.es6.html b/previous-map.es6.html index 9301edf19..e5844552c 100644 --- a/previous-map.es6.html +++ b/previous-map.es6.html @@ -193,7 +193,7 @@

      previous-map.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/processor.es6.html b/processor.es6.html index dd7880175..71243a97b 100644 --- a/processor.es6.html +++ b/processor.es6.html @@ -248,7 +248,7 @@

      processor.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/result.es6.html b/result.es6.html index 759950bfd..4ce2e342a 100644 --- a/result.es6.html +++ b/result.es6.html @@ -222,7 +222,7 @@

      result.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/root.es6.html b/root.es6.html index 62306f27b..a30eaa567 100644 --- a/root.es6.html +++ b/root.es6.html @@ -150,7 +150,7 @@

      root.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/rule.es6.html b/rule.es6.html index f4bb5b68c..429d9c980 100644 --- a/rule.es6.html +++ b/rule.es6.html @@ -150,7 +150,7 @@

      rule.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/vendor.es6.html b/vendor.es6.html index acaf66f87..a1316aace 100644 --- a/vendor.es6.html +++ b/vendor.es6.html @@ -101,7 +101,7 @@

      vendor.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/vendor.html b/vendor.html index 06f4c54e8..7ce80af18 100644 --- a/vendor.html +++ b/vendor.html @@ -461,7 +461,7 @@
      Returns:

      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      diff --git a/warning.es6.html b/warning.es6.html index 1e29db96c..cf33167dd 100644 --- a/warning.es6.html +++ b/warning.es6.html @@ -154,7 +154,7 @@

      warning.es6


      - Documentation generated by JSDoc 3.4.0 on Thu Sep 08 2016 12:00:27 GMT+1000 (VLAT) using the docdash theme. + Documentation generated by JSDoc 3.4.0 on Fri Sep 09 2016 18:42:34 GMT+1000 (VLAT) using the docdash theme.
      From 87bedee962c4795fa098a5394637fbf321cb9e19 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Mon, 26 Sep 2016 16:18:00 +0300 Subject: [PATCH 14/17] Typo --- AtRule.html | 36 ++++++++++++++++++++---------------- Comment.html | 2 +- Container.html | 36 ++++++++++++++++++++---------------- CssSyntaxError.html | 2 +- Declaration.html | 2 +- Input.html | 2 +- LazyResult.html | 6 +++--- Node.html | 2 +- PreviousMap.html | 4 ++-- Processor.html | 2 +- Result.html | 2 +- Root.html | 36 ++++++++++++++++++++---------------- Rule.html | 36 ++++++++++++++++++++---------------- Warning.html | 2 +- at-rule.es6.html | 2 +- comment.es6.html | 2 +- container.es6.html | 27 ++++++++++++++------------- css-syntax-error.es6.html | 2 +- declaration.es6.html | 2 +- global.html | 2 +- index.html | 2 +- input.es6.html | 2 +- lazy-result.es6.html | 6 +++--- list.es6.html | 6 +++--- list.html | 6 +++--- node.es6.html | 2 +- postcss.es6.html | 2 +- postcss.html | 2 +- previous-map.es6.html | 4 ++-- processor.es6.html | 4 ++-- result.es6.html | 2 +- root.es6.html | 2 +- rule.es6.html | 2 +- vendor.es6.html | 2 +- vendor.html | 2 +- warning.es6.html | 2 +- 36 files changed, 136 insertions(+), 119 deletions(-) diff --git a/AtRule.html b/AtRule.html index f773138dc..5a7f557ec 100644 --- a/AtRule.html +++ b/AtRule.html @@ -186,7 +186,7 @@

      firstSource:
      @@ -269,7 +269,7 @@

      lastSource:
      @@ -432,7 +432,7 @@

      nodesSource:
      @@ -1095,7 +1095,7 @@

      everySource:
      @@ -1261,7 +1261,7 @@

      indexSource:
      @@ -2307,7 +2307,7 @@

      replaceV
      Source:
      @@ -2469,13 +2469,16 @@

      Properties
      - prop + props string +| + +Array.<string> @@ -2509,8 +2512,8 @@
      Properties

      string that’s used - to narrow down values and speed up - the regexp search

      + to narrow down values and speed up + the regexp search

      @@ -2544,11 +2547,12 @@
      Properties

      string to replace pattern - or callback that returns a new value. - The callback will receive - the same arguments as those passed - to a function parameter - of String#replace.

      + or callback that returns a new + value. + The callback will receive + the same arguments as those + passed to a function parameter + of String#replace.

      @@ -2609,7 +2613,7 @@

      someSource:
      @@ -3809,7 +3813,7 @@
      Returns:

      diff --git a/Comment.html b/Comment.html index c050913a8..b55e024ae 100644 --- a/Comment.html +++ b/Comment.html @@ -3370,7 +3370,7 @@
      Returns:

      diff --git a/Container.html b/Container.html index fa0c1a42c..29a536b01 100644 --- a/Container.html +++ b/Container.html @@ -175,7 +175,7 @@

      firstSource:
      @@ -253,7 +253,7 @@

      lastSource:
      @@ -331,7 +331,7 @@

      nodesSource:
      @@ -2031,7 +2031,7 @@

      everySource:
      @@ -2192,7 +2192,7 @@

      indexSource:
      @@ -4287,7 +4287,7 @@

      replaceV
      Source:
      @@ -4444,13 +4444,16 @@

      Properties
      - prop + props string +| + +Array.<string> @@ -4484,8 +4487,8 @@
      Properties

      string that’s used - to narrow down values and speed up - the regexp search

      + to narrow down values and speed up + the regexp search

      @@ -4519,11 +4522,12 @@
      Properties

      string to replace pattern - or callback that returns a new value. - The callback will receive - the same arguments as those passed - to a function parameter - of String#replace.

      + or callback that returns a new + value. + The callback will receive + the same arguments as those + passed to a function parameter + of String#replace.

      @@ -4879,7 +4883,7 @@

      someSource:
      @@ -6574,7 +6578,7 @@
      Returns:

      diff --git a/CssSyntaxError.html b/CssSyntaxError.html index 2ad7f1912..771d1fd13 100644 --- a/CssSyntaxError.html +++ b/CssSyntaxError.html @@ -1431,7 +1431,7 @@
      Returns:

      diff --git a/Declaration.html b/Declaration.html index 1c0be8648..1b8e722bc 100644 --- a/Declaration.html +++ b/Declaration.html @@ -3558,7 +3558,7 @@
      Returns:

      diff --git a/Input.html b/Input.html index 8d0260fa5..850cf891d 100644 --- a/Input.html +++ b/Input.html @@ -859,7 +859,7 @@
      Returns:

      diff --git a/LazyResult.html b/LazyResult.html index c38b2dec3..e6e921bd9 100644 --- a/LazyResult.html +++ b/LazyResult.html @@ -854,7 +854,7 @@
      Parameters:
      -

      callback will be execited on any error

      +

      callback will be executed on any error

      @@ -1043,7 +1043,7 @@
      Parameters:
      -

      callback will be execited on any error

      +

      callback will be executed on any error

      @@ -1323,7 +1323,7 @@
      Returns:

      diff --git a/Node.html b/Node.html index daa1b8ce0..bca812333 100644 --- a/Node.html +++ b/Node.html @@ -3272,7 +3272,7 @@
      Returns:

      diff --git a/PreviousMap.html b/PreviousMap.html index eaec00e1a..eaa842ba0 100644 --- a/PreviousMap.html +++ b/PreviousMap.html @@ -417,7 +417,7 @@
      Returns:
      -

      object woth source map information

      +

      object with source map information

      @@ -561,7 +561,7 @@
      Returns:

      diff --git a/Processor.html b/Processor.html index dd75b4a82..97f34612d 100644 --- a/Processor.html +++ b/Processor.html @@ -796,7 +796,7 @@
      Returns:

      diff --git a/Result.html b/Result.html index 5bc35cbba..f31842e97 100644 --- a/Result.html +++ b/Result.html @@ -1397,7 +1397,7 @@
      Returns:

      diff --git a/Root.html b/Root.html index 061e83c4e..57b7c19a8 100644 --- a/Root.html +++ b/Root.html @@ -179,7 +179,7 @@

      firstSource:
      @@ -262,7 +262,7 @@

      lastSource:
      @@ -345,7 +345,7 @@

      nodesSource:
      @@ -2043,7 +2043,7 @@

      everySource:
      @@ -2209,7 +2209,7 @@

      indexSource:
      @@ -4334,7 +4334,7 @@

      replaceV
      Source:
      @@ -4496,13 +4496,16 @@

      Properties
      - prop + props string +| + +Array.<string> @@ -4536,8 +4539,8 @@
      Properties

      string that’s used - to narrow down values and speed up - the regexp search

      + to narrow down values and speed up + the regexp search

      @@ -4571,11 +4574,12 @@
      Properties

      string to replace pattern - or callback that returns a new value. - The callback will receive - the same arguments as those passed - to a function parameter - of String#replace.

      + or callback that returns a new + value. + The callback will receive + the same arguments as those + passed to a function parameter + of String#replace.

      @@ -4931,7 +4935,7 @@

      someSource:
      @@ -6831,7 +6835,7 @@
      Returns:

      diff --git a/Rule.html b/Rule.html index 18d097c01..eaac5cd6c 100644 --- a/Rule.html +++ b/Rule.html @@ -180,7 +180,7 @@

      firstSource:
      @@ -263,7 +263,7 @@

      lastSource:
      @@ -346,7 +346,7 @@

      nodesSource:
      @@ -2222,7 +2222,7 @@

      everySource:
      @@ -2388,7 +2388,7 @@

      indexSource:
      @@ -4513,7 +4513,7 @@

      replaceV
      Source:
      @@ -4675,13 +4675,16 @@

      Properties
      - prop + props string +| + +Array.<string> @@ -4715,8 +4718,8 @@
      Properties

      string that’s used - to narrow down values and speed up - the regexp search

      + to narrow down values and speed up + the regexp search

      @@ -4750,11 +4753,12 @@
      Properties

      string to replace pattern - or callback that returns a new value. - The callback will receive - the same arguments as those passed - to a function parameter - of String#replace.

      + or callback that returns a new + value. + The callback will receive + the same arguments as those + passed to a function parameter + of String#replace.

      @@ -5110,7 +5114,7 @@

      someSource:
      @@ -6835,7 +6839,7 @@
      Returns:

      diff --git a/Warning.html b/Warning.html index ee3d39d0d..70114b8bc 100644 --- a/Warning.html +++ b/Warning.html @@ -977,7 +977,7 @@
      Returns:

      diff --git a/at-rule.es6.html b/at-rule.es6.html index e854d1459..2f906771d 100644 --- a/at-rule.es6.html +++ b/at-rule.es6.html @@ -163,7 +163,7 @@

      at-rule.es6


      diff --git a/comment.es6.html b/comment.es6.html index 10db5054c..6ca439b6b 100644 --- a/comment.es6.html +++ b/comment.es6.html @@ -107,7 +107,7 @@

      comment.es6


      diff --git a/container.es6.html b/container.es6.html index b43c07c42..3b2a4e0c2 100644 --- a/container.es6.html +++ b/container.es6.html @@ -531,18 +531,19 @@

      container.es6

      * This method is useful if you are using a custom unit or function * and need to iterate through all values. * - * @param {string|RegExp} pattern - replace pattern - * @param {object} opts - options to speed up the search - * @param {string} opts.prop - an array of property names - * @param {string} opts.fast - string that’s used - * to narrow down values and speed up - * the regexp search - * @param {function|string} callback - string to replace pattern - * or callback that returns a new value. - * The callback will receive - * the same arguments as those passed - * to a function parameter - * of `String#replace`. + * @param {string|RegExp} pattern - replace pattern + * @param {object} opts - options to speed up the search + * @param {string|string[]} opts.props - an array of property names + * @param {string} opts.fast - string that’s used + * to narrow down values and speed up + the regexp search + * @param {function|string} callback - string to replace pattern + * or callback that returns a new + * value. + * The callback will receive + * the same arguments as those + * passed to a function parameter + * of `String#replace`. * * @return {Node} this node for methods chain * @@ -792,7 +793,7 @@

      container.es6


      diff --git a/css-syntax-error.es6.html b/css-syntax-error.es6.html index 7f97c8b0f..1953e9716 100644 --- a/css-syntax-error.es6.html +++ b/css-syntax-error.es6.html @@ -272,7 +272,7 @@

      css-syntax-error.es6


      diff --git a/declaration.es6.html b/declaration.es6.html index b5070ad64..87e02d02d 100644 --- a/declaration.es6.html +++ b/declaration.es6.html @@ -150,7 +150,7 @@

      declaration.es6


      diff --git a/global.html b/global.html index 5538d6cae..9cac203f4 100644 --- a/global.html +++ b/global.html @@ -2898,7 +2898,7 @@
      Type:

      diff --git a/index.html b/index.html index 56ce7a8a1..2c9f03111 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@

      Home

      Classes

@@ -2017,7 +2017,7 @@

removeAllSource:
@@ -2135,7 +2135,7 @@

removeChil
Source:
@@ -2307,7 +2307,7 @@

replaceV
Source:
@@ -2613,7 +2613,7 @@

someSource:
@@ -2779,7 +2779,7 @@

walkSource:
@@ -2954,7 +2954,7 @@

walkAtRule
Source:
@@ -3185,7 +3185,7 @@

walkComme
Source:
@@ -3358,7 +3358,7 @@

walkDeclsSource:
@@ -3588,7 +3588,7 @@

walkRulesSource:
@@ -3813,7 +3813,7 @@
Returns:

diff --git a/Comment.html b/Comment.html index b55e024ae..12eedbd64 100644 --- a/Comment.html +++ b/Comment.html @@ -22,7 +22,7 @@
@@ -71,7 +71,7 @@

new CommentSource:
@@ -174,7 +174,7 @@

parentSource:
@@ -257,7 +257,7 @@

rawsSource:
@@ -343,7 +343,7 @@

sourceSource:
@@ -446,7 +446,7 @@

textSource:
@@ -519,7 +519,7 @@

typeSource:
@@ -602,7 +602,7 @@

Methods

-

clone(overridesopt) → {Node}

+

after(add) → {Node}

@@ -614,7 +614,7 @@

cloneSource:
@@ -625,7 +625,7 @@

cloneInherited From:
@@ -659,9 +659,8 @@

clone -

Returns a clone of the node.

-

The resulting cloned node and its (cloned) children will have -a clean parent and code style properties.

+

Insert new node after current node to current node’s parent.

+

Just alias for node.parent.insertAfter(node, add).

@@ -674,10 +673,7 @@

cloneExample

-
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
-cloned.raws.before  //=> undefined
-cloned.parent       //=> undefined
-cloned.toString()   //=> -moz-transform: scale(0)
+
decl.after('color: black');
@@ -695,8 +691,6 @@
Parameters:
Type - Attributes - @@ -709,33 +703,32 @@
Parameters:
- overrides + add +Node +| + object +| +string +| - - +Array.<Node> - - - - <optional>
- - + + - - -

new properties to override in the clone.

+

new node

@@ -759,7 +752,7 @@
Returns:
-

clone of the node

+

this node for methods chain.

@@ -784,7 +777,7 @@
Returns:
-

cloneAfter(overridesopt) → {Node}

+

before(add) → {Node}

@@ -796,7 +789,7 @@

cloneAfter<
Source:
@@ -807,7 +800,7 @@

cloneAfter<
Inherited From:
@@ -841,8 +834,8 @@

cloneAfter<
-

Shortcut to clone the node and insert the resulting cloned node -after the current node.

+

Insert new node before current node to current node’s parent.

+

Just alias for node.parent.insertBefore(node, add).

@@ -853,6 +846,11 @@

cloneAfter< +

Example
+ +
decl.before('content: ""');
+ +
Parameters:
@@ -868,8 +866,6 @@
Parameters:
Type - Attributes - @@ -882,33 +878,32 @@
Parameters:
- overrides + add +Node +| + object +| +string +| - - +Array.<Node> - - - - <optional>
- - + + - - -

new properties to override in the clone.

+

new node

@@ -932,9 +927,7 @@
Returns:
-
    -
  • new node
  • -
+

this node for methods chain.

@@ -959,7 +952,7 @@
Returns:
-

cloneBefore(overridesopt) → {Node}

+

clone(overridesopt) → {Node}

@@ -971,7 +964,7 @@

cloneBefor
Source:
@@ -982,7 +975,7 @@

cloneBefor
Inherited From:
@@ -1016,8 +1009,9 @@

cloneBefor
-

Shortcut to clone the node and insert the resulting cloned node -before the current node.

+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

@@ -1030,7 +1024,10 @@

cloneBefor

Example
-
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
@@ -1112,9 +1109,7 @@
Returns:
-
    -
  • new node
  • -
+

clone of the node

@@ -1139,7 +1134,7 @@
Returns:
-

error(message, optsopt) → {CssSyntaxError}

+

cloneAfter(overridesopt) → {Node}

@@ -1151,7 +1146,7 @@

errorSource:
@@ -1162,7 +1157,7 @@

errorInherited From:
@@ -1196,13 +1191,8 @@

error -

Returns a CssSyntaxError instance containing the original position -of the node in the source, showing line and column numbers and also -a small excerpt to facilitate debugging.

-

If present, an input source map will be used to get the original position -of the source, even from a previous compilation step -(e.g., from Sass compilation).

-

This method produces very useful error messages.

+

Shortcut to clone the node and insert the resulting cloned node +after the current node.

@@ -1213,18 +1203,6 @@

errorExample

- -
if ( !variables[name] ) {
-  throw decl.error('Unknown variable ' + name, { word: name });
-  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
-  //   color: $black
-  // a
-  //          ^
-  //   background: white
-}
- -
Parameters:
@@ -1254,38 +1232,7 @@
Parameters:
- message - - - - - -string - - - - - - - - - - - - - - - - - -

error description

- - - - - - - opts + overrides @@ -1311,105 +1258,7 @@
Parameters:
-

options

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
plugin - - -string - - - -

plugin name that created this error. - PostCSS will set it automatically.

word - - -string - - - -

a word inside a node’s string that should - be highlighted as the source of the error

index - - -number - - - -

an index inside a node’s string that should - be highlighted as the source of the error

- - +

new properties to override in the clone.

@@ -1433,7 +1282,9 @@
Returns:
-

error object to throw it

+
    +
  • new node
  • +
@@ -1444,7 +1295,7 @@
Returns:
-CssSyntaxError +Node
@@ -1458,7 +1309,7 @@
Returns:
-

moveAfter(otherNode) → {Node}

+

cloneBefore(overridesopt) → {Node}

@@ -1470,7 +1321,7 @@

moveAfterSource:
@@ -1481,7 +1332,7 @@

moveAfterInherited From:
@@ -1515,10 +1366,8 @@

moveAfter -

Removes the node from its current parent and inserts it into -a new parent after otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Shortcut to clone the node and insert the resulting cloned node +before the current node.

@@ -1529,6 +1378,11 @@

moveAfterExample

+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ +
Parameters:
@@ -1544,6 +1398,8 @@
Parameters:
Type + Attributes + @@ -1556,23 +1412,33 @@
Parameters:
- otherNode + overrides -Node +object + + + <optional>
+ + + + + -

node that will be after current node

+ + +

new properties to override in the clone.

@@ -1596,7 +1462,9 @@
Returns:
-

current node to methods chain

+
    +
  • new node
  • +
@@ -1621,7 +1489,7 @@
Returns:
-

moveBefore(otherNode) → {Node}

+

error(message, optsopt) → {CssSyntaxError}

@@ -1633,7 +1501,7 @@

moveBefore<
Source:
@@ -1644,7 +1512,7 @@

moveBefore<
Inherited From:
@@ -1678,10 +1546,13 @@

moveBefore<
-

Removes the node from its current parent and inserts it into -a new parent before otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

@@ -1692,6 +1563,18 @@

moveBefore< +

Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ +
Parameters:
@@ -1707,6 +1590,8 @@
Parameters:
Type + Attributes + @@ -1719,183 +1604,144 @@
Parameters:
- otherNode + message -Node +string + + + + + + + + -

node that will be before current node

+

error description

- - - - - - - + + + opts + + + + +object + + + + + + <optional>
+ + + + + + -
Returns:
+

options

+
Properties
+ + + + -
-

current node to methods chain

-
- - - -
-
- Type -
-
+
-Node - - - - - - + - - - -

moveTo(newParent) → {Node}

- - - - - - -
- - -
Source:
-
- - - - - - - -
Inherited From:
-
- - - - - - - - - - - - - - - - - - - - - + - +
+ + + - - - - - - -
-

Removes the node from its current parent and inserts it -at the end of newParent.

-

This will clean the before and after code Node#raws data -from the node and replace them with the indentation style of newParent. -It will also clean the between property -if newParent is in another Root.

-
- + + + + + + + + + -
Example
-
atrule.moveTo(atrule.root());
- - + + + + -
Parameters:
- + @@ -1930,7 +1783,7 @@
Returns:
-

current node to methods chain

+

error object to throw it

@@ -1941,7 +1794,7 @@
Returns:
-Node +CssSyntaxError
@@ -1967,7 +1820,7 @@

nextSource:
@@ -2092,7 +1945,7 @@

prevSource:
@@ -2215,7 +2068,7 @@

rawSource:
@@ -2430,7 +2283,7 @@

removeSource:
@@ -2549,7 +2402,7 @@

replaceWit
Source:
@@ -2728,7 +2581,7 @@

rootSource:
@@ -2844,7 +2697,7 @@

toStringSource:
@@ -3025,7 +2878,7 @@

warnSource:
@@ -3370,7 +3223,7 @@
Returns:

diff --git a/Container.html b/Container.html index 29a536b01..46fa73674 100644 --- a/Container.html +++ b/Container.html @@ -22,7 +22,7 @@
@@ -72,7 +72,7 @@

(abstract) n
Source:
@@ -175,7 +175,7 @@

firstSource:
@@ -253,7 +253,7 @@

lastSource:
@@ -331,7 +331,7 @@

nodesSource:
@@ -412,7 +412,7 @@

parentSource:
@@ -495,7 +495,7 @@

rawsSource:
@@ -603,7 +603,7 @@

sourceSource:
@@ -706,7 +706,7 @@

typeSource:
@@ -789,7 +789,7 @@

Methods

-

append(…children) → {Node}

+

after(add) → {Node}

@@ -801,7 +801,7 @@

appendSource:
@@ -810,6 +810,11 @@

appendInherited From: +
+ @@ -841,7 +846,8 @@

append -

Inserts new nodes to the start of the container.

+

Insert new node after current node to current node’s parent.

+

Just alias for node.parent.insertAfter(node, add).

@@ -854,17 +860,7 @@

appendExample

-
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
-const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
-rule.append(decl1, decl2);
-
-root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
-root.append({ selector: 'a' });                       // rule
-rule.append({ prop: 'color', value: 'black' });       // declaration
-rule.append({ text: 'Comment' })                      // comment
-
-root.append('a {}');
-root.first.append('color: black; z-index: 1');
+
decl.after('color: black');
@@ -882,8 +878,6 @@
Parameters:

- - @@ -896,7 +890,7 @@
Parameters:
- + - - - + @@ -955,7 +939,7 @@
Returns:
-

this node for methods chain

+

this node for methods chain.

@@ -980,7 +964,7 @@
Returns:
-

clone(overridesopt) → {Node}

+

append(…children) → {Node}

@@ -992,7 +976,7 @@

cloneSource:
@@ -1001,11 +985,6 @@

cloneInherited From: -
- @@ -1037,9 +1016,7 @@

clone -

Returns a clone of the node.

-

The resulting cloned node and its (cloned) children will have -a clean parent and code style properties.

+

Inserts new nodes to the end of the container.

@@ -1052,10 +1029,17 @@

cloneExample

-
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
-cloned.raws.before  //=> undefined
-cloned.parent       //=> undefined
-cloned.toString()   //=> -moz-transform: scale(0)
+
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.append(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
@@ -1087,13 +1071,22 @@
Parameters:

- + - + @@ -1137,7 +1130,7 @@
Returns:
-

clone of the node

+

this node for methods chain

@@ -1162,7 +1155,7 @@
Returns:
-

cloneAfter(overridesopt) → {Node}

+

before(add) → {Node}

@@ -1174,7 +1167,7 @@

cloneAfter<
Source:
@@ -1185,7 +1178,7 @@

cloneAfter<
Inherited From:
@@ -1219,8 +1212,8 @@

cloneAfter<
-

Shortcut to clone the node and insert the resulting cloned node -after the current node.

+

Insert new node before current node to current node’s parent.

+

Just alias for node.parent.insertBefore(node, add).

@@ -1231,6 +1224,11 @@

cloneAfter< +

Example
+ +
decl.before('content: ""');
+ +
Parameters:
@@ -1246,8 +1244,6 @@
Parameters:
- - @@ -1260,33 +1256,32 @@
Parameters:
- + - - - - + @@ -1310,9 +1305,7 @@
Returns:
-
    -
  • new node
  • -
+

this node for methods chain.

@@ -1337,7 +1330,7 @@
Returns:
-

cloneBefore(overridesopt) → {Node}

+

clone(overridesopt) → {Node}

@@ -1349,7 +1342,7 @@

cloneBefor
Source:
@@ -1360,7 +1353,7 @@

cloneBefor
Inherited From:
@@ -1394,8 +1387,9 @@

cloneBefor
-

Shortcut to clone the node and insert the resulting cloned node -before the current node.

+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

@@ -1408,7 +1402,10 @@

cloneBefor

Example
-
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
@@ -1490,9 +1487,7 @@
Returns:
-
    -
  • new node
  • -
+

clone of the node

@@ -1517,7 +1512,7 @@
Returns:
-

each(callback) → {false|undefined}

+

cloneAfter(overridesopt) → {Node}

@@ -1529,7 +1524,7 @@

eachSource:
@@ -1538,6 +1533,11 @@

eachInherited From: +
+ @@ -1569,15 +1569,8 @@

each -

Iterates through the container’s immediate children, -calling callback for each child.

-

Returning false in the callback will break iteration.

-

This method only iterates through the container’s immediate children. -If you need to recursively iterate through all the container’s descendant -nodes, use Container#walk.

-

Unlike the for {}-cycle or Array#forEach this iterator is safe -if you are mutating the array of child nodes during iteration. -PostCSS will adjust the current index to match the mutations.

+

Shortcut to clone the node and insert the resulting cloned node +after the current node.

@@ -1588,23 +1581,6 @@

eachconst root = postcss.parse('a { color: black; z-index: 1 }'); -const rule = root.first; - -for ( let decl of rule.nodes ) { - decl.cloneBefore({ prop: '-webkit-' + decl.prop }); - // Cycle will be infinite, because cloneBefore moves the current node - // to the next index -} - -rule.each(decl => { - decl.cloneBefore({ prop: '-webkit-' + decl.prop }); - // Will be executed only for color and z-index -}); - -
Parameters:
@@ -1620,6 +1596,8 @@
Parameters:

+ + @@ -1632,23 +1610,33 @@
Parameters:
- + + + - + @@ -1672,7 +1660,9 @@
Returns:
-

returns false if iteration was broke

+
    +
  • new node
  • +
@@ -1683,10 +1673,7 @@
Returns:
-false -| - -undefined +Node
@@ -1700,7 +1687,7 @@
Returns:
-

error(message, optsopt) → {CssSyntaxError}

+

cloneBefore(overridesopt) → {Node}

@@ -1712,7 +1699,7 @@

errorSource:
@@ -1723,7 +1710,7 @@

errorInherited From:
@@ -1757,13 +1744,8 @@

error -

Returns a CssSyntaxError instance containing the original position -of the node in the source, showing line and column numbers and also -a small excerpt to facilitate debugging.

-

If present, an input source map will be used to get the original position -of the source, even from a previous compilation step -(e.g., from Sass compilation).

-

This method produces very useful error messages.

+

Shortcut to clone the node and insert the resulting cloned node +before the current node.

@@ -1776,14 +1758,7 @@

errorExample

-
if ( !variables[name] ) {
-  throw decl.error('Unknown variable ' + name, { word: name });
-  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
-  //   color: $black
-  // a
-  //          ^
-  //   background: white
-}
+
decl.cloneBefore({ prop: '-moz-' + decl.prop });
@@ -1815,13 +1790,13 @@
Parameters:

- + + - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
plugin + + +string + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string - - - - - - - + + - + - + - - - + + - - + + + + + + +
NameTypeDescription

a word inside a node’s string that should + be highlighted as the source of the error

newParentindex -Container +number @@ -1905,8 +1751,15 @@
Parameters:
-

container node where the current node - will be moved

an index inside a node’s string that should + be highlighted as the source of the error

+ +
TypeAttributes
childrenadd @@ -918,20 +912,10 @@
Parameters:
- - - - - - <repeatable>
- -

new nodes

new node

overrideschildren +Node +| + object +| + +string +| + +Array.<Node> @@ -1102,18 +1095,18 @@
Parameters:
- <optional>
- + <repeatable>
+

new properties to override in the clone.

new nodes

TypeAttributes
overridesadd +Node +| + object +| + +string +| +Array.<Node> - - - - <optional>
- - - +

new properties to override in the clone.

new node

TypeAttributes
callbackoverrides -childIterator +object + + <optional>
+ + + + + +

iterator receives each node and index

new properties to override in the clone.

messageoverrides -string +object @@ -1830,6 +1805,8 @@
Parameters:
+ <optional>
+ @@ -1839,143 +1816,12 @@
Parameters:
-

error description

new properties to override in the clone.

opts - - -object - - - - - - <optional>
- - - - - -

options

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
plugin - - -string - - - -

plugin name that created this error. - PostCSS will set it automatically.

word - - -string - - - -

a word inside a node’s string that should - be highlighted as the source of the error

index - - -number - - - -

an index inside a node’s string that should - be highlighted as the source of the error

- -
+ + @@ -1994,7 +1840,9 @@
Returns:
-

error object to throw it

+
    +
  • new node
  • +
@@ -2005,7 +1853,7 @@
Returns:
-CssSyntaxError +Node
@@ -2019,7 +1867,7 @@
Returns:
-

every(condition) → {boolean}

+

each(callback) → {false|undefined}

@@ -2031,7 +1879,7 @@

everySource:
@@ -2071,8 +1919,15 @@

every -

Returns true if callback returns true -for all of the container’s children.

+

Iterates through the container’s immediate children, +calling callback for each child.

+

Returning false in the callback will break iteration.

+

This method only iterates through the container’s immediate children. +If you need to recursively iterate through all the container’s descendant +nodes, use Container#walk.

+

Unlike the for {}-cycle or Array#forEach this iterator is safe +if you are mutating the array of child nodes during iteration. +PostCSS will adjust the current index to match the mutations.

@@ -2085,7 +1940,19 @@

everyExample

-
const noPrefixes = rule.every(i => i.prop[0] !== '-');
+
const root = postcss.parse('a { color: black; z-index: 1 }');
+const rule = root.first;
+
+for ( let decl of rule.nodes ) {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Cycle will be infinite, because cloneBefore moves the current node
+    // to the next index
+}
+
+rule.each(decl => {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Will be executed only for color and z-index
+});
@@ -2115,13 +1982,13 @@
Parameters:
- condition + callback -childCondition +childIterator @@ -2131,7 +1998,7 @@
Parameters:
-

iterator returns true or false.

+

iterator receives each node and index

@@ -2155,7 +2022,7 @@
Returns:
-

is every child pass condition

+

returns false if iteration was broke

@@ -2166,7 +2033,10 @@
Returns:
-boolean +false +| + +undefined
@@ -2180,7 +2050,7 @@
Returns:
-

index(child) → {number}

+

error(message, optsopt) → {CssSyntaxError}

@@ -2192,7 +2062,7 @@

indexSource:
@@ -2201,6 +2071,11 @@

indexInherited From: +
+ @@ -2232,7 +2107,13 @@

index -

Returns a child’s index within the Container#nodes array.

+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

@@ -2245,7 +2126,14 @@

indexExample

-
rule.index( rule.nodes[2] ) //=> 2
+
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
@@ -2263,6 +2151,8 @@
Parameters:
Type + Attributes + @@ -2275,138 +2165,66 @@
Parameters:
- child + message -Node +string + + - - -

child of the current container.

- - - - - - - - - - - - - - - - - - - -
Returns:
- - -
-

child index

-
- - - -
-
- Type -
-
- -number - - -
-
- - - + - + + - - -

insertAfter(exist, add) → {Node}

- - - - - - -
- - -
Source:
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-

Insert new node after old node within the container.

-
+ +

error description

+ + + + + opts + + + + +object + + + + + + <optional>
+ + + + + + -
Parameters:
- +

options

+
Properties
+ @@ -2430,16 +2248,13 @@
Parameters:
- + + - + -Array.<Node> + + + + + + + + + + + + + + + + + + + + +
existplugin -Node -| - -number +string @@ -2449,29 +2264,45 @@
Parameters:
-

child or child’s index

plugin name that created this error. + PostCSS will set it automatically.

addword -Node -| +string -object -| -string -| + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number @@ -2481,7 +2312,15 @@
Parameters:
-

new node

an index inside a node’s string that should + be highlighted as the source of the error

+ + @@ -2505,7 +2344,7 @@
Returns:
-

this node for methods chain

+

error object to throw it

@@ -2516,7 +2355,7 @@
Returns:
-Node +CssSyntaxError
@@ -2530,7 +2369,7 @@
Returns:
-

insertBefore(exist, add) → {Node}

+

every(condition) → {boolean}

@@ -2542,7 +2381,7 @@

insertBef
Source:
@@ -2582,7 +2421,8 @@

insertBef
-

Insert new node before old node within the container.

+

Returns true if callback returns true +for all of the container’s children.

@@ -2595,7 +2435,7 @@

insertBef

Example
-
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
+
const noPrefixes = rule.every(i => i.prop[0] !== '-');
@@ -2625,48 +2465,13 @@
Parameters:
- exist - - - - - -Node -| - -number - - - - - - - - - -

child or child’s index.

- - - - - - - add + condition -Node -| - -object -| - -string -| - -Array.<Node> +childCondition @@ -2676,7 +2481,7 @@
Parameters:
-

new node

+

iterator returns true or false.

@@ -2700,7 +2505,7 @@
Returns:
-

this node for methods chain

+

is every child pass condition

@@ -2711,7 +2516,7 @@
Returns:
-Node +boolean
@@ -2725,7 +2530,7 @@
Returns:
-

moveAfter(otherNode) → {Node}

+

index(child) → {number}

@@ -2737,7 +2542,7 @@

moveAfterSource:
@@ -2746,11 +2551,6 @@

moveAfterInherited From: -
- @@ -2782,10 +2582,7 @@

moveAfter -

Removes the node from its current parent and inserts it into -a new parent after otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Returns a child’s index within the Container#nodes array.

@@ -2796,6 +2593,11 @@

moveAfterExample

+ +
rule.index( rule.nodes[2] ) //=> 2
+ +
Parameters:
@@ -2823,7 +2625,7 @@
Parameters:
- otherNode + child @@ -2839,7 +2641,7 @@
Parameters:
-

node that will be after current node

+

child of the current container.

@@ -2863,7 +2665,7 @@
Returns:
-

current node to methods chain

+

child index

@@ -2874,7 +2676,7 @@
Returns:
-Node +number
@@ -2888,7 +2690,7 @@
Returns:
-

moveBefore(otherNode) → {Node}

+

insertAfter(exist, add) → {Node}

@@ -2900,7 +2702,7 @@

moveBefore<
Source:
@@ -2909,11 +2711,6 @@

moveBefore< -
Inherited From:
-
- @@ -2945,10 +2742,7 @@

moveBefore<
-

Removes the node from its current parent and inserts it into -a new parent before otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Insert new node after old node within the container.

@@ -2986,13 +2780,48 @@

Parameters:
- otherNode + exist + + + + + +Node +| + +number + + + + + + + + + +

child or child’s index

+ + + + + + + add Node +| + +object +| + +string +| + +Array.<Node> @@ -3002,7 +2831,7 @@
Parameters:
-

node that will be before current node

+

new node

@@ -3026,7 +2855,7 @@
Returns:
-

current node to methods chain

+

this node for methods chain

@@ -3051,7 +2880,7 @@
Returns:
-

moveTo(newParent) → {Node}

+

insertBefore(exist, add) → {Node}

@@ -3063,7 +2892,7 @@

moveToSource:
@@ -3072,11 +2901,6 @@

moveToInherited From: -
- @@ -3108,12 +2932,7 @@

moveTo -

Removes the node from its current parent and inserts it -at the end of newParent.

-

This will clean the before and after code Node#raws data -from the node and replace them with the indentation style of newParent. -It will also clean the between property -if newParent is in another Root.

+

Insert new node before old node within the container.

@@ -3126,7 +2945,7 @@

moveToExample

-
atrule.moveTo(atrule.root());
+
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
@@ -3156,13 +2975,48 @@
Parameters:
- newParent + exist -Container +Node +| + +number + + + + + + + + + +

child or child’s index.

+ + + + + + + add + + + + + +Node +| + +object +| + +string +| + +Array.<Node> @@ -3172,8 +3026,7 @@
Parameters:
-

container node where the current node - will be moved

+

new node

@@ -3197,7 +3050,7 @@
Returns:
-

current node to methods chain

+

this node for methods chain

@@ -3234,7 +3087,7 @@

nextSource:
@@ -3359,7 +3212,7 @@

prependSource:
@@ -3399,7 +3252,7 @@

prepend -

Inserts new nodes to the end of the container.

+

Inserts new nodes to the start of the container.

@@ -3550,7 +3403,7 @@

prevSource:
@@ -3673,7 +3526,7 @@

rawSource:
@@ -3888,7 +3741,7 @@

removeSource:
@@ -3897,10 +3750,8 @@

removeOverrides: -

@@ -1717,6 +1565,11 @@

moveAfterExample

+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ +
Parameters:
@@ -1732,6 +1585,8 @@
Parameters:
Type + Attributes + @@ -1744,23 +1599,33 @@
Parameters:
- otherNode + overrides -Node +object + + + <optional>
+ + + + + + + -

node that will be after current node

+

new properties to override in the clone.

@@ -1784,7 +1649,9 @@
Returns:
-

current node to methods chain

+
    +
  • new node
  • +
@@ -1809,7 +1676,7 @@
Returns:
-

moveBefore(otherNode) → {Node}

+

error(message, optsopt) → {CssSyntaxError}

@@ -1821,7 +1688,7 @@

moveBefore<
Source:
@@ -1832,7 +1699,7 @@

moveBefore<
Inherited From:
@@ -1866,10 +1733,13 @@

moveBefore<
-

Removes the node from its current parent and inserts it into -a new parent before otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

@@ -1880,6 +1750,18 @@

moveBefore< +

Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ +
Parameters:
@@ -1895,6 +1777,8 @@
Parameters:
Type + Attributes + @@ -1907,183 +1791,144 @@
Parameters:
- otherNode + message -Node +string + + + + + + + + -

node that will be before current node

+

error description

- - - - - - - + + + opts + + + + +object + + + + + + <optional>
+ + + + + + -
Returns:
+

options

+
Properties
+ + + + -
-

current node to methods chain

-
- - - -
-
- Type -
-
+
-Node - - - - - - + - - - - -

moveTo(newParent) → {Node}

- - - - - - -
- - -
Source:
-
- - - - - - - -
Inherited From:
-
- - - - - - - - - - - - - - - - - - - - + - +
+ + + - - - - - - -
-

Removes the node from its current parent and inserts it -at the end of newParent.

-

This will clean the before and after code Node#raws data -from the node and replace them with the indentation style of newParent. -It will also clean the between property -if newParent is in another Root.

-
- + + + + + + + + + -
Example
-
atrule.moveTo(atrule.root());
- - + + + + -
Parameters:
- + @@ -2118,7 +1970,7 @@
Returns:
-

current node to methods chain

+

error object to throw it

@@ -2129,7 +1981,7 @@
Returns:
-Node +CssSyntaxError
@@ -2155,7 +2007,7 @@

nextSource:
@@ -2280,7 +2132,7 @@

prevSource:
@@ -2403,7 +2255,7 @@

rawSource:
@@ -2618,7 +2470,7 @@

removeSource:
@@ -2737,7 +2589,7 @@

replaceWit
Source:
@@ -2916,7 +2768,7 @@

rootSource:
@@ -3032,7 +2884,7 @@

toStringSource:
@@ -3213,7 +3065,7 @@

warnSource:
@@ -3558,7 +3410,7 @@
Returns:

diff --git a/Input.html b/Input.html index 850cf891d..73c39a1e8 100644 --- a/Input.html +++ b/Input.html @@ -22,7 +22,7 @@
@@ -69,7 +69,7 @@

new InputSource:
@@ -259,7 +259,7 @@

cssSource:
@@ -338,7 +338,7 @@

fileSource:
@@ -418,7 +418,7 @@

fromSource:
@@ -501,7 +501,7 @@

idSource:
@@ -583,7 +583,7 @@

mapSource:
@@ -673,7 +673,7 @@

originSource:
@@ -859,7 +859,7 @@
Returns:

diff --git a/LazyResult.html b/LazyResult.html index e6e921bd9..63a2095f2 100644 --- a/LazyResult.html +++ b/LazyResult.html @@ -22,7 +22,7 @@
@@ -70,7 +70,7 @@

new LazyRes
Source:
@@ -167,7 +167,7 @@

contentSource:
@@ -252,7 +252,7 @@

cssSource:
@@ -337,7 +337,7 @@

mapSource:
@@ -422,7 +422,7 @@

messagesSource:
@@ -507,7 +507,7 @@

optsSource:
@@ -580,7 +580,7 @@

processorSource:
@@ -654,7 +654,7 @@

rootSource:
@@ -749,7 +749,7 @@

catchSource:
@@ -915,7 +915,7 @@

thenSource:
@@ -1104,7 +1104,7 @@

toStringSource:
@@ -1215,7 +1215,7 @@

warningsSource:
@@ -1323,7 +1323,7 @@
Returns:

diff --git a/Node.html b/Node.html index bca812333..be8acb218 100644 --- a/Node.html +++ b/Node.html @@ -22,7 +22,7 @@
@@ -69,7 +69,7 @@

(abstract) new No
Source:
@@ -222,7 +222,7 @@

parentSource:
@@ -300,7 +300,7 @@

rawsSource:
@@ -403,7 +403,7 @@

sourceSource:
@@ -501,7 +501,7 @@

typeSource:
@@ -579,7 +579,7 @@

Methods

-

clone(overridesopt) → {Node}

+

after(add) → {Node}

@@ -591,7 +591,7 @@

cloneSource:
@@ -631,9 +631,8 @@

clone -

Returns a clone of the node.

-

The resulting cloned node and its (cloned) children will have -a clean parent and code style properties.

+

Insert new node after current node to current node’s parent.

+

Just alias for node.parent.insertAfter(node, add).

@@ -646,10 +645,7 @@

cloneExample

-
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
-cloned.raws.before  //=> undefined
-cloned.parent       //=> undefined
-cloned.toString()   //=> -moz-transform: scale(0)
+
decl.after('color: black');
@@ -667,8 +663,6 @@
Parameters:

- - @@ -681,33 +675,32 @@
Parameters:
- + +Array.<Node> - - - - - + @@ -731,7 +724,7 @@
Returns:
-

clone of the node

+

this node for methods chain.

@@ -756,7 +749,7 @@
Returns:
-

cloneAfter(overridesopt) → {Node}

+

before(add) → {Node}

@@ -768,7 +761,7 @@

cloneAfter<
Source:
@@ -808,8 +801,8 @@

cloneAfter<
-

Shortcut to clone the node and insert the resulting cloned node -after the current node.

+

Insert new node before current node to current node’s parent.

+

Just alias for node.parent.insertBefore(node, add).

@@ -820,6 +813,11 @@

cloneAfter< +

Example
+ +
decl.before('content: ""');
+ +
Parameters:
@@ -835,8 +833,6 @@
Parameters:
- - @@ -849,33 +845,32 @@
Parameters:
- + +Array.<Node> - - - - - + @@ -899,9 +894,7 @@
Returns:
-
    -
  • new node
  • -
+

this node for methods chain.

@@ -926,7 +919,7 @@
Returns:
-

cloneBefore(overridesopt) → {Node}

+

clone(overridesopt) → {Node}

@@ -938,7 +931,7 @@

cloneBefor
Source:
@@ -978,8 +971,9 @@

cloneBefor
-

Shortcut to clone the node and insert the resulting cloned node -before the current node.

+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

@@ -992,7 +986,10 @@

cloneBefor

Example
-
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
@@ -1074,9 +1071,7 @@
Returns:
-
    -
  • new node
  • -
+

clone of the node

@@ -1101,7 +1096,7 @@
Returns:
-

error(message, optsopt) → {CssSyntaxError}

+

cloneAfter(overridesopt) → {Node}

@@ -1113,7 +1108,7 @@

errorSource:
@@ -1153,13 +1148,8 @@

error -

Returns a CssSyntaxError instance containing the original position -of the node in the source, showing line and column numbers and also -a small excerpt to facilitate debugging.

-

If present, an input source map will be used to get the original position -of the source, even from a previous compilation step -(e.g., from Sass compilation).

-

This method produces very useful error messages.

+

Shortcut to clone the node and insert the resulting cloned node +after the current node.

@@ -1170,18 +1160,6 @@

errorExample

- -
if ( !variables[name] ) {
-  throw decl.error('Unknown variable ' + name, { word: name });
-  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
-  //   color: $black
-  // a
-  //          ^
-  //   background: white
-}
- -
Parameters:
@@ -1211,38 +1189,7 @@
Parameters:

- - - - - - - - - - - - - - - - - - - + + @@ -1390,7 +1239,9 @@
Returns:
-

error object to throw it

+
    +
  • new node
  • +
@@ -1401,7 +1252,7 @@
Returns:
-CssSyntaxError +Node
@@ -1415,7 +1266,7 @@
Returns:
-

moveAfter(otherNode) → {Node}

+

cloneBefore(overridesopt) → {Node}

@@ -1427,7 +1278,7 @@

moveAfterSource:
@@ -1467,10 +1318,8 @@

moveAfter -

Removes the node from its current parent and inserts it into -a new parent after otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Shortcut to clone the node and insert the resulting cloned node +before the current node.

@@ -1481,6 +1330,11 @@

moveAfterExample

+ +
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+ +
Parameters:
@@ -1496,6 +1350,8 @@
Parameters:

+ + @@ -1508,23 +1364,33 @@
Parameters:
- + + - + + + @@ -1548,7 +1414,9 @@
Returns:
-

current node to methods chain

+
    +
  • new node
  • +
@@ -1573,7 +1441,7 @@
Returns:
-

moveBefore(otherNode) → {Node}

+

error(message, optsopt) → {CssSyntaxError}

@@ -1585,7 +1453,7 @@

moveBefore<
Source:
@@ -1625,10 +1493,13 @@

moveBefore<
-

Removes the node from its current parent and inserts it into -a new parent before otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

@@ -1639,6 +1510,18 @@

moveBefore< +

Example
+ +
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
+ +
Parameters:
@@ -1654,6 +1537,8 @@
Parameters:
+ + @@ -1666,178 +1551,144 @@
Parameters:
- + + + - + - -
NameTypeDescription
plugin + + +string + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string - - - - - - - + + - + - + - - - + + - - + + + + + + +
NameTypeDescription

a word inside a node’s string that should + be highlighted as the source of the error

newParentindex -Container +number @@ -2093,8 +1938,15 @@
Parameters:
-

container node where the current node - will be moved

an index inside a node’s string that should + be highlighted as the source of the error

+ +
TypeAttributes
overridesadd +Node +| + object +| +string +| - - - - <optional>
- - + +

new properties to override in the clone.

new node

TypeAttributes
overridesadd +Node +| + object +| +string +| - - - - <optional>
- - + +

new properties to override in the clone.

new node

message - - -string - - - - - - - - - -

error description

optsoverrides @@ -1268,105 +1215,7 @@
Parameters:
-

options

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
plugin - - -string - - - -

plugin name that created this error. - PostCSS will set it automatically.

word - - -string - - - -

a word inside a node’s string that should - be highlighted as the source of the error

index - - -number - - - -

an index inside a node’s string that should - be highlighted as the source of the error

- -

new properties to override in the clone.

TypeAttributes
otherNodeoverrides -Node +object + + <optional>
+ + + + +

node that will be after current node

new properties to override in the clone.

TypeAttributes
otherNodemessage -Node +string + + + + + +

node that will be before current node

error description

- - - - - + + + opts + + + + +object + + + + + + <optional>
+ + + + + + -
Returns:
+

options

+
Properties
+ + + + -
-

current node to methods chain

-
- - - -
-
- Type -
-
+
-Node - - - - - - + - - - -

moveTo(newParent) → {Node}

- - - - - - -
- - -
Source:
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - + - +
+ + + - - - - - - -
-

Removes the node from its current parent and inserts it -at the end of newParent.

-

This will clean the before and after code Node#raws data -from the node and replace them with the indentation style of newParent. -It will also clean the between property -if newParent is in another Root.

-
- + + + + + + + + + -
Example
-
atrule.moveTo(atrule.root());
- - + + + + -
Parameters:
- + @@ -1872,7 +1730,7 @@
Returns:
-

current node to methods chain

+

error object to throw it

@@ -1883,7 +1741,7 @@
Returns:
-Node +CssSyntaxError
@@ -1909,7 +1767,7 @@

nextSource:
@@ -2029,7 +1887,7 @@

prevSource:
@@ -2147,7 +2005,7 @@

rawSource:
@@ -2357,7 +2215,7 @@

removeSource:
@@ -2471,7 +2329,7 @@

replaceWit
Source:
@@ -2645,7 +2503,7 @@

rootSource:
@@ -2756,7 +2614,7 @@

toStringSource:
@@ -2932,7 +2790,7 @@

warnSource:
@@ -3272,7 +3130,7 @@
Returns:

diff --git a/PreviousMap.html b/PreviousMap.html index eaa842ba0..c14fe16ad 100644 --- a/PreviousMap.html +++ b/PreviousMap.html @@ -22,7 +22,7 @@
@@ -72,7 +72,7 @@

new Previo
Source:
@@ -262,7 +262,7 @@

inlineSource:
@@ -345,7 +345,7 @@

consumerSource:
@@ -454,7 +454,7 @@

withConten
Source:
@@ -561,7 +561,7 @@

Returns:

diff --git a/Processor.html b/Processor.html index 97f34612d..3d83062f2 100644 --- a/Processor.html +++ b/Processor.html @@ -22,7 +22,7 @@
@@ -70,7 +70,7 @@

new Processo
Source:
@@ -222,7 +222,7 @@

pluginsSource:
@@ -301,7 +301,7 @@

versionSource:
@@ -391,7 +391,7 @@

processSource:
@@ -611,7 +611,7 @@

useSource:
@@ -796,7 +796,7 @@
Returns:

diff --git a/Result.html b/Result.html index f31842e97..ee5bb5ce4 100644 --- a/Result.html +++ b/Result.html @@ -22,7 +22,7 @@
@@ -71,7 +71,7 @@

new ResultSource:
@@ -268,7 +268,7 @@

contentSource:
@@ -347,7 +347,7 @@

cssSource:
@@ -425,7 +425,7 @@

mapSource:
@@ -510,7 +510,7 @@

messagesSource:
@@ -600,7 +600,7 @@

optsSource:
@@ -680,7 +680,7 @@

processorSource:
@@ -763,7 +763,7 @@

rootSource:
@@ -851,7 +851,7 @@

toStringSource:
@@ -962,7 +962,7 @@

warnSource:
@@ -1282,7 +1282,7 @@

warningsSource:
@@ -1397,7 +1397,7 @@
Returns:

diff --git a/Root.html b/Root.html index 57b7c19a8..1f0b38191 100644 --- a/Root.html +++ b/Root.html @@ -22,7 +22,7 @@
@@ -69,7 +69,7 @@

new RootSource:
@@ -179,7 +179,7 @@

firstSource:
@@ -262,7 +262,7 @@

lastSource:
@@ -345,7 +345,7 @@

nodesSource:
@@ -431,7 +431,7 @@

parentSource:
@@ -514,7 +514,7 @@

rawsSource:
@@ -605,7 +605,7 @@

sourceSource:
@@ -708,7 +708,7 @@

typeSource:
@@ -791,7 +791,7 @@

Methods

-

append(…children) → {Node}

+

after(add) → {Node}

@@ -803,7 +803,7 @@

appendSource:
@@ -814,7 +814,7 @@

appendInherited From:
@@ -848,7 +848,8 @@

append -

Inserts new nodes to the start of the container.

+

Insert new node after current node to current node’s parent.

+

Just alias for node.parent.insertAfter(node, add).

@@ -861,17 +862,7 @@

appendExample

-
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
-const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
-rule.append(decl1, decl2);
-
-root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
-root.append({ selector: 'a' });                       // rule
-rule.append({ prop: 'color', value: 'black' });       // declaration
-rule.append({ text: 'Comment' })                      // comment
-
-root.append('a {}');
-root.first.append('color: black; z-index: 1');
+
decl.after('color: black');
@@ -889,8 +880,6 @@
Parameters:

- - @@ -903,7 +892,7 @@
Parameters:
- + - - - + @@ -962,7 +941,7 @@
Returns:
-

this node for methods chain

+

this node for methods chain.

@@ -987,7 +966,7 @@
Returns:
-

clone(overridesopt) → {Node}

+

append(…children) → {Node}

@@ -999,7 +978,7 @@

cloneSource:
@@ -1010,7 +989,7 @@

cloneInherited From:
@@ -1044,9 +1023,7 @@

clone -

Returns a clone of the node.

-

The resulting cloned node and its (cloned) children will have -a clean parent and code style properties.

+

Inserts new nodes to the end of the container.

@@ -1059,10 +1036,17 @@

cloneExample

-
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
-cloned.raws.before  //=> undefined
-cloned.parent       //=> undefined
-cloned.toString()   //=> -moz-transform: scale(0)
+
const decl1 = postcss.decl({ prop: 'color', value: 'black' });
+const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
+rule.append(decl1, decl2);
+
+root.append({ name: 'charset', params: '"UTF-8"' });  // at-rule
+root.append({ selector: 'a' });                       // rule
+rule.append({ prop: 'color', value: 'black' });       // declaration
+rule.append({ text: 'Comment' })                      // comment
+
+root.append('a {}');
+root.first.append('color: black; z-index: 1');
@@ -1094,13 +1078,22 @@
Parameters:

- + - + @@ -1144,7 +1137,7 @@
Returns:
-

clone of the node

+

this node for methods chain

@@ -1169,7 +1162,7 @@
Returns:
-

cloneAfter(overridesopt) → {Node}

+

before(add) → {Node}

@@ -1181,7 +1174,7 @@

cloneAfter<
Source:
@@ -1192,7 +1185,7 @@

cloneAfter<
Inherited From:
@@ -1226,8 +1219,8 @@

cloneAfter<
-

Shortcut to clone the node and insert the resulting cloned node -after the current node.

+

Insert new node before current node to current node’s parent.

+

Just alias for node.parent.insertBefore(node, add).

@@ -1238,6 +1231,11 @@

cloneAfter< +

Example
+ +
decl.before('content: ""');
+ +
Parameters:
@@ -1253,8 +1251,6 @@
Parameters:
- - @@ -1267,33 +1263,32 @@
Parameters:
- + +Array.<Node> - - - - - + @@ -1317,9 +1312,7 @@
Returns:
-
    -
  • new node
  • -
+

this node for methods chain.

@@ -1344,7 +1337,7 @@
Returns:
-

cloneBefore(overridesopt) → {Node}

+

clone(overridesopt) → {Node}

@@ -1356,7 +1349,7 @@

cloneBefor
Source:
@@ -1367,7 +1360,7 @@

cloneBefor
Inherited From:
@@ -1401,8 +1394,9 @@

cloneBefor
-

Shortcut to clone the node and insert the resulting cloned node -before the current node.

+

Returns a clone of the node.

+

The resulting cloned node and its (cloned) children will have +a clean parent and code style properties.

@@ -1415,7 +1409,10 @@

cloneBefor

Example
-
decl.cloneBefore({ prop: '-moz-' + decl.prop });
+
const cloned = decl.clone({ prop: '-moz-' + decl.prop });
+cloned.raws.before  //=> undefined
+cloned.parent       //=> undefined
+cloned.toString()   //=> -moz-transform: scale(0)
@@ -1497,9 +1494,7 @@
Returns:
-
    -
  • new node
  • -
+

clone of the node

@@ -1524,7 +1519,7 @@
Returns:
-

each(callback) → {false|undefined}

+

cloneAfter(overridesopt) → {Node}

@@ -1536,7 +1531,7 @@

eachSource:
@@ -1547,7 +1542,7 @@

eachInherited From:
@@ -1581,15 +1576,8 @@

each -

Iterates through the container’s immediate children, -calling callback for each child.

-

Returning false in the callback will break iteration.

-

This method only iterates through the container’s immediate children. -If you need to recursively iterate through all the container’s descendant -nodes, use Container#walk.

-

Unlike the for {}-cycle or Array#forEach this iterator is safe -if you are mutating the array of child nodes during iteration. -PostCSS will adjust the current index to match the mutations.

+

Shortcut to clone the node and insert the resulting cloned node +after the current node.

@@ -1600,23 +1588,6 @@

eachconst root = postcss.parse('a { color: black; z-index: 1 }'); -const rule = root.first; - -for ( let decl of rule.nodes ) { - decl.cloneBefore({ prop: '-webkit-' + decl.prop }); - // Cycle will be infinite, because cloneBefore moves the current node - // to the next index -} - -rule.each(decl => { - decl.cloneBefore({ prop: '-webkit-' + decl.prop }); - // Will be executed only for color and z-index -}); - -
Parameters:
@@ -1632,6 +1603,8 @@
Parameters:

+ + @@ -1644,23 +1617,33 @@
Parameters:
- + + + - + @@ -1684,7 +1667,9 @@
Returns:
-

returns false if iteration was broke

+
    +
  • new node
  • +
@@ -1695,10 +1680,7 @@
Returns:
-false -| - -undefined +Node
@@ -1712,7 +1694,7 @@
Returns:
-

error(message, optsopt) → {CssSyntaxError}

+

cloneBefore(overridesopt) → {Node}

@@ -1724,7 +1706,7 @@

errorSource:
@@ -1735,7 +1717,7 @@

errorInherited From:
@@ -1769,13 +1751,8 @@

error -

Returns a CssSyntaxError instance containing the original position -of the node in the source, showing line and column numbers and also -a small excerpt to facilitate debugging.

-

If present, an input source map will be used to get the original position -of the source, even from a previous compilation step -(e.g., from Sass compilation).

-

This method produces very useful error messages.

+

Shortcut to clone the node and insert the resulting cloned node +before the current node.

@@ -1788,14 +1765,7 @@

errorExample

-
if ( !variables[name] ) {
-  throw decl.error('Unknown variable ' + name, { word: name });
-  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
-  //   color: $black
-  // a
-  //          ^
-  //   background: white
-}
+
decl.cloneBefore({ prop: '-moz-' + decl.prop });
@@ -1827,13 +1797,13 @@
Parameters:

- + + + +
NameTypeDescription
plugin + + +string + +

plugin name that created this error. + PostCSS will set it automatically.

word + + +string - - - - - - - + + - + - + - - - + + - - + + + + + + +
NameTypeDescription

a word inside a node’s string that should + be highlighted as the source of the error

newParentindex -Container +number @@ -1847,8 +1698,15 @@
Parameters:
-

container node where the current node - will be moved

an index inside a node’s string that should + be highlighted as the source of the error

+ +
TypeAttributes
childrenadd @@ -925,20 +914,10 @@
Parameters:
- - - - - - <repeatable>
- -

new nodes

new node

overrideschildren +Node +| + object +| + +string +| + +Array.<Node> @@ -1109,18 +1102,18 @@
Parameters:
- <optional>
- + <repeatable>
+

new properties to override in the clone.

new nodes

TypeAttributes
overridesadd +Node +| + object +| +string +| - - - - <optional>
- - + +

new properties to override in the clone.

new node

TypeAttributes
callbackoverrides -childIterator +object + + <optional>
+ + + + + +

iterator receives each node and index

new properties to override in the clone.

messageoverrides -string +object @@ -1842,6 +1812,8 @@
Parameters:
+ <optional>
+ @@ -1851,162 +1823,33 @@
Parameters:
-

error description

new properties to override in the clone.

- - - opts - - - - -object - - - - - - <optional>
- - - - - - -

options

-
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
plugin - - -string - - - -

plugin name that created this error. - PostCSS will set it automatically.

word - - -string - - - -

a word inside a node’s string that should - be highlighted as the source of the error

index - - -number - - - -

an index inside a node’s string that should - be highlighted as the source of the error

- - - - - - - - - - - - - - - - - - - - - -
Returns:
+
Returns:
-

error object to throw it

+
    +
  • new node
  • +
@@ -2017,7 +1860,7 @@
Returns:
-CssSyntaxError +Node
@@ -2031,7 +1874,7 @@
Returns:
-

every(condition) → {boolean}

+

each(callback) → {false|undefined}

@@ -2043,7 +1886,7 @@

everySource:
@@ -2054,7 +1897,7 @@

everyInherited From:
@@ -2088,8 +1931,15 @@

every -

Returns true if callback returns true -for all of the container’s children.

+

Iterates through the container’s immediate children, +calling callback for each child.

+

Returning false in the callback will break iteration.

+

This method only iterates through the container’s immediate children. +If you need to recursively iterate through all the container’s descendant +nodes, use Container#walk.

+

Unlike the for {}-cycle or Array#forEach this iterator is safe +if you are mutating the array of child nodes during iteration. +PostCSS will adjust the current index to match the mutations.

@@ -2102,7 +1952,19 @@

everyExample

-
const noPrefixes = rule.every(i => i.prop[0] !== '-');
+
const root = postcss.parse('a { color: black; z-index: 1 }');
+const rule = root.first;
+
+for ( let decl of rule.nodes ) {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Cycle will be infinite, because cloneBefore moves the current node
+    // to the next index
+}
+
+rule.each(decl => {
+    decl.cloneBefore({ prop: '-webkit-' + decl.prop });
+    // Will be executed only for color and z-index
+});
@@ -2132,13 +1994,13 @@
Parameters:
- condition + callback -childCondition +childIterator @@ -2148,7 +2010,7 @@
Parameters:
-

iterator returns true or false.

+

iterator receives each node and index

@@ -2172,7 +2034,7 @@
Returns:
-

is every child pass condition

+

returns false if iteration was broke

@@ -2183,7 +2045,10 @@
Returns:
-boolean +false +| + +undefined
@@ -2197,7 +2062,7 @@
Returns:
-

index(child) → {number}

+

error(message, optsopt) → {CssSyntaxError}

@@ -2209,7 +2074,7 @@

indexSource:
@@ -2220,7 +2085,7 @@

indexInherited From:
@@ -2254,7 +2119,13 @@

index -

Returns a child’s index within the Container#nodes array.

+

Returns a CssSyntaxError instance containing the original position +of the node in the source, showing line and column numbers and also +a small excerpt to facilitate debugging.

+

If present, an input source map will be used to get the original position +of the source, even from a previous compilation step +(e.g., from Sass compilation).

+

This method produces very useful error messages.

@@ -2267,7 +2138,14 @@

indexExample

-
rule.index( rule.nodes[2] ) //=> 2
+
if ( !variables[name] ) {
+  throw decl.error('Unknown variable ' + name, { word: name });
+  // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+  //   color: $black
+  // a
+  //          ^
+  //   background: white
+}
@@ -2285,6 +2163,8 @@
Parameters:
Type + Attributes + @@ -2297,143 +2177,66 @@
Parameters:
- child + message -Node +string + + - - -

child of the current container.

- - - - - - - - - - - - - - - - - - - -
Returns:
- - -
-

child index

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - -

insertAfter(exist, add) → {Node}

- - - - - - -
- - -
Source:
-
- - - - - - - -
Inherited From:
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - + + + + -
-

Insert new node after old node within the container.

-
+ +

error description

+ + + + + opts + + + + +object + + + + + + <optional>
+ + + + + + -
Parameters:
- +

options

+
Properties
+ @@ -2457,16 +2260,13 @@
Parameters:
- + + - + -Array.<Node> + + + + + + + + + + + + + + + + + + + + +
existplugin -Node -| - -number +string @@ -2476,29 +2276,45 @@
Parameters:
-

child or child’s index

plugin name that created this error. + PostCSS will set it automatically.

addword -Node -| +string -object -| -string -| + +

a word inside a node’s string that should + be highlighted as the source of the error

index + + +number @@ -2508,7 +2324,15 @@
Parameters:
-

new node

an index inside a node’s string that should + be highlighted as the source of the error

+ + @@ -2532,7 +2356,7 @@
Returns:
-

this node for methods chain

+

error object to throw it

@@ -2543,7 +2367,7 @@
Returns:
-Node +CssSyntaxError
@@ -2557,7 +2381,7 @@
Returns:
-

insertBefore(exist, add) → {Node}

+

every(condition) → {boolean}

@@ -2569,7 +2393,7 @@

insertBef
Source:
@@ -2580,7 +2404,7 @@

insertBef
Inherited From:
@@ -2614,7 +2438,8 @@

insertBef
-

Insert new node before old node within the container.

+

Returns true if callback returns true +for all of the container’s children.

@@ -2627,7 +2452,7 @@

insertBef

Example
-
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
+
const noPrefixes = rule.every(i => i.prop[0] !== '-');
@@ -2657,48 +2482,13 @@
Parameters:
- exist - - - - - -Node -| - -number - - - - - - - - - -

child or child’s index.

- - - - - - - add + condition -Node -| - -object -| - -string -| - -Array.<Node> +childCondition @@ -2708,7 +2498,7 @@
Parameters:
-

new node

+

iterator returns true or false.

@@ -2732,7 +2522,7 @@
Returns:
-

this node for methods chain

+

is every child pass condition

@@ -2743,7 +2533,7 @@
Returns:
-Node +boolean
@@ -2757,7 +2547,7 @@
Returns:
-

moveAfter(otherNode) → {Node}

+

index(child) → {number}

@@ -2769,7 +2559,7 @@

moveAfterSource:
@@ -2780,7 +2570,7 @@

moveAfterInherited From:
@@ -2814,10 +2604,7 @@

moveAfter -

Removes the node from its current parent and inserts it into -a new parent after otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Returns a child’s index within the Container#nodes array.

@@ -2828,6 +2615,11 @@

moveAfterExample

+ +
rule.index( rule.nodes[2] ) //=> 2
+ +
Parameters:
@@ -2855,7 +2647,7 @@
Parameters:
- otherNode + child @@ -2871,7 +2663,7 @@
Parameters:
-

node that will be after current node

+

child of the current container.

@@ -2895,7 +2687,7 @@
Returns:
-

current node to methods chain

+

child index

@@ -2906,7 +2698,7 @@
Returns:
-Node +number
@@ -2920,7 +2712,7 @@
Returns:
-

moveBefore(otherNode) → {Node}

+

insertAfter(exist, add) → {Node}

@@ -2932,7 +2724,7 @@

moveBefore<
Source:
@@ -2943,7 +2735,7 @@

moveBefore<
Inherited From:
@@ -2977,10 +2769,7 @@

moveBefore<
-

Removes the node from its current parent and inserts it into -a new parent before otherNode.

-

This will also clean the node’s code style properties just as it would -in Node#moveTo.

+

Insert new node after old node within the container.

@@ -3018,13 +2807,48 @@

Parameters:
- otherNode + exist + + + + + +Node +| + +number + + + + + + + + + +

child or child’s index

+ + + + + + + add Node +| + +object +| + +string +| + +Array.<Node> @@ -3034,7 +2858,7 @@
Parameters:
-

node that will be before current node

+

new node

@@ -3058,7 +2882,7 @@
Returns:
-

current node to methods chain

+

this node for methods chain

@@ -3083,7 +2907,7 @@
Returns:
-

moveTo(newParent) → {Node}

+

insertBefore(exist, add) → {Node}

@@ -3095,7 +2919,7 @@

moveToSource:
@@ -3106,7 +2930,7 @@

moveToInherited From:
@@ -3140,12 +2964,7 @@

moveTo -

Removes the node from its current parent and inserts it -at the end of newParent.

-

This will clean the before and after code Node#raws data -from the node and replace them with the indentation style of newParent. -It will also clean the between property -if newParent is in another Root.

+

Insert new node before old node within the container.

@@ -3158,7 +2977,7 @@

moveToExample

-
atrule.moveTo(atrule.root());
+
rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
@@ -3188,13 +3007,48 @@
Parameters:
- newParent + exist -Container +Node +| + +number + + + + + + + + + +

child or child’s index.

+ + + + + + + add + + + + + +Node +| + +object +| + +string +| + +Array.<Node> @@ -3204,8 +3058,7 @@
Parameters:
-

container node where the current node - will be moved

+

new node

@@ -3229,7 +3082,7 @@
Returns:
-

current node to methods chain

+

this node for methods chain

@@ -3266,7 +3119,7 @@

nextSource:
@@ -3391,7 +3244,7 @@

prependSource:
@@ -3436,7 +3289,7 @@

prepend -

Inserts new nodes to the end of the container.

+

Inserts new nodes to the start of the container.

@@ -3587,7 +3440,7 @@

prevSource:
@@ -3710,7 +3563,7 @@

rawSource:
@@ -3925,7 +3778,7 @@

removeSource:
@@ -3934,11 +3787,9 @@

removeOverrides: -