first import
This commit is contained in:
5
sites/all/libraries/lessphp/.travis.yml
Normal file
5
sites/all/libraries/lessphp/.travis.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
language: php
|
||||
script: phpunit tests
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
660
sites/all/libraries/lessphp/LICENSE
Normal file
660
sites/all/libraries/lessphp/LICENSE
Normal file
@@ -0,0 +1,660 @@
|
||||
For ease of distribution, lessphp 0.2.0 is under a dual license.
|
||||
You are free to pick which one suits your needs.
|
||||
|
||||
|
||||
|
||||
|
||||
MIT LICENSE
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright (c) 2010 Leaf Corcoran, http://leafo.net/lessphp
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
|
||||
GPL VERSION 3
|
||||
|
||||
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
7
sites/all/libraries/lessphp/Makefile
Normal file
7
sites/all/libraries/lessphp/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
test:
|
||||
phpunit --colors tests
|
||||
|
||||
release:
|
||||
./package.sh
|
||||
|
96
sites/all/libraries/lessphp/README.md
Normal file
96
sites/all/libraries/lessphp/README.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# lessphp v0.3.8
|
||||
### <http://leafo.net/lessphp>
|
||||
|
||||
[](http://travis-ci.org/leafo/lessphp)
|
||||
|
||||
`lessphp` is a compiler for LESS written in PHP. The documentation is great,
|
||||
so check it out: <http://leafo.net/lessphp/docs/>.
|
||||
|
||||
Here's a quick tutorial:
|
||||
|
||||
### How to use in your PHP project
|
||||
|
||||
The only file required is `lessc.inc.php`, so copy that to your include directory.
|
||||
|
||||
The typical flow of **lessphp** is to create a new instance of `lessc`,
|
||||
configure it how you like, then tell it to compile something using one built in
|
||||
compile methods.
|
||||
|
||||
The `compile` method compiles a string of LESS code to CSS.
|
||||
|
||||
```php
|
||||
<?php
|
||||
require "lessc.inc.php";
|
||||
|
||||
$less = new lessc;
|
||||
echo $less->compile(".block { padding: 3 + 4px }");
|
||||
```
|
||||
|
||||
The `compileFile` method reads and compiles a file. It will either return the
|
||||
result or write it to the path specified by an optional second argument.
|
||||
|
||||
```php
|
||||
<?php
|
||||
echo $less->compileFile("input.less");
|
||||
```
|
||||
|
||||
The `compileChecked` method is like `compileFile`, but it only compiles if the output
|
||||
file doesn't exist or it's older than the input file:
|
||||
|
||||
```php
|
||||
<?php
|
||||
$less->checkedCompile("input.less", "output.css");
|
||||
```
|
||||
|
||||
If there any problem compiling your code, an exception is thrown with a helpful message:
|
||||
|
||||
```php
|
||||
<?php
|
||||
try {
|
||||
$less->compile("invalid LESS } {");
|
||||
} catch (exception $e) {
|
||||
echo "fatal error: " . $e->getMessage();
|
||||
}
|
||||
```
|
||||
|
||||
The `lessc` object can be configured through an assortment of instance methods.
|
||||
Some possible configuration options include [changing the output format][1],
|
||||
[setting variables from PHP][2], and [controlling the preservation of
|
||||
comments][3], writing [custom functions][4] and much more. It's all described
|
||||
in [the documentation][0].
|
||||
|
||||
|
||||
[0]: http://leafo.net/lessphp/docs/
|
||||
[1]: http://leafo.net/lessphp/docs/#output_formatting
|
||||
[2]: http://leafo.net/lessphp/docs/#setting_variables_from_php
|
||||
[3]: http://leafo.net/lessphp/docs/#preserving_comments
|
||||
[4]: http://leafo.net/lessphp/docs/#custom_functions
|
||||
|
||||
|
||||
### How to use from the command line
|
||||
|
||||
An additional script has been included to use the compiler from the command
|
||||
line. In the simplest invocation, you specify an input file and the compiled
|
||||
css is written to standard out:
|
||||
|
||||
$ plessc input.less > output.css
|
||||
|
||||
Using the -r flag, you can specify LESS code directly as an argument or, if
|
||||
the argument is left off, from standard in:
|
||||
|
||||
$ plessc -r "my less code here"
|
||||
|
||||
Finally, by using the -w flag you can watch a specified input file and have it
|
||||
compile as needed to the output file:
|
||||
|
||||
$ plessc -w input-file output-file
|
||||
|
||||
Errors from watch mode are written to standard out.
|
||||
|
||||
The -f flag sets the [output formatter][1]. For example, to compress the
|
||||
output run this:
|
||||
|
||||
$ plessc -f=compressed myfile.less
|
||||
|
||||
For more help, run `plessc --help`
|
||||
|
20
sites/all/libraries/lessphp/composer.json
Normal file
20
sites/all/libraries/lessphp/composer.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "leafo/lessphp",
|
||||
"type": "library",
|
||||
"description": "lessphp is a compiler for LESS written in PHP.",
|
||||
"homepage": "http://leafo.net/lessphp/",
|
||||
"license": [
|
||||
"MIT",
|
||||
"GPL-3.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Leaf Corcoran",
|
||||
"email": "leafot@gmail.com",
|
||||
"homepage": "http://leafo.net"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"classmap": ["lessc.inc.php"]
|
||||
}
|
||||
}
|
1291
sites/all/libraries/lessphp/docs/docs.md
Normal file
1291
sites/all/libraries/lessphp/docs/docs.md
Normal file
File diff suppressed because it is too large
Load Diff
3359
sites/all/libraries/lessphp/lessc.inc.php
Normal file
3359
sites/all/libraries/lessphp/lessc.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
250
sites/all/libraries/lessphp/plessc
Normal file
250
sites/all/libraries/lessphp/plessc
Normal file
@@ -0,0 +1,250 @@
|
||||
#!/usr/bin/php -q
|
||||
<?php
|
||||
// Command line utility to compile LESS to STDOUT
|
||||
// Leaf Corcoran <leafot@gmail.com>, 2012
|
||||
|
||||
$exe = array_shift($argv); // remove filename
|
||||
|
||||
$HELP = <<<EOT
|
||||
Usage: $exe [options] input-file [output-file]
|
||||
|
||||
Options include:
|
||||
|
||||
-h, --help Show this message
|
||||
-v Print the version
|
||||
-f=format Set the output format, includes "default", "compressed"
|
||||
-c Keep /* */ comments in output
|
||||
-r Read from STDIN instead of input-file
|
||||
-w Watch input-file, and compile to output-file if it is changed
|
||||
-T Dump formatted parse tree
|
||||
-X Dump raw parse tree
|
||||
|
||||
|
||||
EOT;
|
||||
|
||||
$opts = getopt('hvrwncXTf:', array('help'));
|
||||
while (count($argv) > 0 && preg_match('/^-([-hvrwncXT]$|[f]=)/', $argv[0])) {
|
||||
array_shift($argv);
|
||||
}
|
||||
|
||||
function has() {
|
||||
global $opts;
|
||||
foreach (func_get_args() as $arg) {
|
||||
if (isset($opts[$arg])) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (has("h", "help")) {
|
||||
exit($HELP);
|
||||
}
|
||||
|
||||
error_reporting(E_ALL);
|
||||
$path = realpath(dirname(__FILE__)).'/';
|
||||
|
||||
require $path."lessc.inc.php";
|
||||
|
||||
$VERSION = lessc::$VERSION;
|
||||
|
||||
$fa = "Fatal Error: ";
|
||||
function err($msg) {
|
||||
fwrite(STDERR, $msg."\n");
|
||||
}
|
||||
|
||||
if (php_sapi_name() != "cli") {
|
||||
err($fa.$argv[0]." must be run in the command line.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
function make_less($fname = null) {
|
||||
global $opts;
|
||||
$l = new lessc($fname);
|
||||
|
||||
if (has("f")) {
|
||||
$format = $opts["f"];
|
||||
if ($format != "default") $l->setFormatter($format);
|
||||
}
|
||||
|
||||
if (has("c")) {
|
||||
$l->setPreserveComments(true);
|
||||
}
|
||||
|
||||
return $l;
|
||||
}
|
||||
|
||||
function process($data, $import = null) {
|
||||
global $fa;
|
||||
|
||||
$l = make_less();
|
||||
if ($import) $l->importDir = $import;
|
||||
|
||||
try {
|
||||
echo $l->parse($data);
|
||||
exit(0);
|
||||
} catch (exception $ex) {
|
||||
err($fa."\n".str_repeat('=', 20)."\n".
|
||||
$ex->getMessage());
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (has("v")) {
|
||||
exit($VERSION."\n");
|
||||
}
|
||||
|
||||
if (has("r")) {
|
||||
if (!empty($argv)) {
|
||||
$data = $argv[0];
|
||||
} else {
|
||||
$data = "";
|
||||
while (!feof(STDIN)) {
|
||||
$data .= fread(STDIN, 8192);
|
||||
}
|
||||
}
|
||||
exit(process($data));
|
||||
}
|
||||
|
||||
if (has("w")) {
|
||||
// need two files
|
||||
if (!is_file($in = array_shift($argv)) ||
|
||||
null == $out = array_shift($argv))
|
||||
{
|
||||
err($fa.$exe." -w infile outfile");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo "Watching ".$in.
|
||||
(has("n") ? ' with notifications' : '').
|
||||
", press Ctrl + c to exit.\n";
|
||||
|
||||
$cache = $in;
|
||||
$last_action = 0;
|
||||
while (true) {
|
||||
clearstatcache();
|
||||
|
||||
// check if anything has changed since last fail
|
||||
$updated = false;
|
||||
if (is_array($cache)) {
|
||||
foreach ($cache['files'] as $fname=>$_) {
|
||||
if (filemtime($fname) > $last_action) {
|
||||
$updated = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else $updated = true;
|
||||
|
||||
// try to compile it
|
||||
if ($updated) {
|
||||
$last_action = time();
|
||||
|
||||
try {
|
||||
$cache = lessc::cexecute($cache);
|
||||
echo "Writing updated file: ".$out."\n";
|
||||
if (!file_put_contents($out, $cache['compiled'])) {
|
||||
err($fa."Could not write to file ".$out);
|
||||
exit(1);
|
||||
}
|
||||
} catch (exception $ex) {
|
||||
echo "\nFatal Error:\n".str_repeat('=', 20)."\n".
|
||||
$ex->getMessage()."\n\n";
|
||||
|
||||
if (has("n")) {
|
||||
`notify-send -u critical "compile failed" "{$ex->getMessage()}"`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!$fname = array_shift($argv)) {
|
||||
echo $HELP;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
function dumpValue($node, $depth = 0) {
|
||||
if (is_object($node)) {
|
||||
$indent = str_repeat(" ", $depth);
|
||||
$out = array();
|
||||
foreach ($node->props as $prop) {
|
||||
$out[] = $indent . dumpValue($prop, $depth + 1);
|
||||
}
|
||||
$out = implode("\n", $out);
|
||||
if (!empty($node->tags)) {
|
||||
$out = "+ ".implode(", ", $node->tags)."\n".$out;
|
||||
}
|
||||
return $out;
|
||||
} elseif (is_array($node)) {
|
||||
if (empty($node)) return "[]";
|
||||
$type = $node[0];
|
||||
if ($type == "block")
|
||||
return dumpValue($node[1], $depth);
|
||||
|
||||
$out = array();
|
||||
foreach ($node as $value) {
|
||||
$out[] = dumpValue($value, $depth);
|
||||
}
|
||||
return "{ ".implode(", ", $out)." }";
|
||||
} else {
|
||||
if (is_string($node) && preg_match("/[\s,]/", $node)) {
|
||||
return '"'.$node.'"';
|
||||
}
|
||||
return $node; // normal value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function stripValue($o, $toStrip) {
|
||||
if (is_array($o) || is_object($o)) {
|
||||
$isObject = is_object($o);
|
||||
$o = (array)$o;
|
||||
foreach ($toStrip as $removeKey) {
|
||||
if (!empty($o[$removeKey])) {
|
||||
$o[$removeKey] = "*stripped*";
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($o as $k => $v) {
|
||||
$o[$k] = stripValue($v, $toStrip);
|
||||
}
|
||||
|
||||
if ($isObject) {
|
||||
$o = (object)$o;
|
||||
}
|
||||
}
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
function dumpWithoutParent($o, $alsoStrip=array()) {
|
||||
$toStrip = array_merge(array("parent"), $alsoStrip);
|
||||
print_r(stripValue($o, $toStrip));
|
||||
}
|
||||
|
||||
try {
|
||||
$less = make_less($fname);
|
||||
if (has("T", "X")) {
|
||||
$parser = new lessc_parser($less, $fname);
|
||||
$tree = $parser->parse(file_get_contents($fname));
|
||||
if (has("X"))
|
||||
$out = print_r($tree, 1);
|
||||
else
|
||||
$out = dumpValue($tree)."\n";
|
||||
} else {
|
||||
$out = $less->parse();
|
||||
}
|
||||
|
||||
if (!$fout = array_shift($argv)) {
|
||||
echo $out;
|
||||
} else {
|
||||
file_put_contents($fout, $out);
|
||||
}
|
||||
|
||||
} catch (exception $ex) {
|
||||
err($fa.$ex->getMessage());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
189
sites/all/libraries/lessphp/tests/ApiTest.php
Normal file
189
sites/all/libraries/lessphp/tests/ApiTest.php
Normal file
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . "/../lessc.inc.php";
|
||||
|
||||
class ApiTest extends PHPUnit_Framework_TestCase {
|
||||
public function setUp() {
|
||||
$this->less = new lessc();
|
||||
$this->less->importDir = array(__DIR__ . "/inputs/test-imports");
|
||||
}
|
||||
|
||||
public function testPreserveComments() {
|
||||
$input = <<<EOD
|
||||
// what is going on?
|
||||
|
||||
/** what the heck **/
|
||||
|
||||
/**
|
||||
|
||||
Here is a block comment
|
||||
|
||||
**/
|
||||
|
||||
|
||||
// this is a comment
|
||||
|
||||
/*hello*/div /*yeah*/ { //surew
|
||||
border: 1px solid red; // world
|
||||
/* another property */
|
||||
color: url('http://mage-page.com');
|
||||
string: "hello /* this is not a comment */";
|
||||
world: "// neither is this";
|
||||
string: 'hello /* this is not a comment */' /*what if this is a comment */;
|
||||
world: '// neither is this' // hell world;
|
||||
;
|
||||
what-ever: 100px;
|
||||
background: url(/*this is not a comment?*/); // uhh what happens here
|
||||
}
|
||||
EOD;
|
||||
|
||||
|
||||
$outputWithComments = <<<EOD
|
||||
/** what the heck **/
|
||||
/**
|
||||
|
||||
Here is a block comment
|
||||
|
||||
**/
|
||||
/*hello*/
|
||||
/*yeah*/
|
||||
div /*yeah*/ {
|
||||
/* another property */
|
||||
border: 1px solid red;
|
||||
color: url('http://mage-page.com');
|
||||
string: "hello /* this is not a comment */";
|
||||
world: "// neither is this";
|
||||
/*what if this is a comment */
|
||||
string: 'hello /* this is not a comment */';
|
||||
world: '// neither is this';
|
||||
what-ever: 100px;
|
||||
/*this is not a comment?*/
|
||||
background: url();
|
||||
}
|
||||
EOD;
|
||||
|
||||
$outputWithoutComments = <<<EOD
|
||||
div {
|
||||
border: 1px solid red;
|
||||
color: url('http://mage-page.com');
|
||||
string: "hello /* this is not a comment */";
|
||||
world: "// neither is this";
|
||||
string: 'hello /* this is not a comment */';
|
||||
world: '// neither is this';
|
||||
what-ever: 100px;
|
||||
background: url(/*this is not a comment?*/);
|
||||
}
|
||||
EOD;
|
||||
|
||||
$this->assertEquals($this->compile($input), trim($outputWithoutComments));
|
||||
$this->less->setPreserveComments(true);
|
||||
$this->assertEquals($this->compile($input), trim($outputWithComments));
|
||||
}
|
||||
|
||||
public function testOldInterface() {
|
||||
$this->less = new lessc(__DIR__ . "/inputs/hi.less");
|
||||
$out = $this->less->parse(array("hello" => "10px"));
|
||||
$this->assertEquals(trim($out), trim('
|
||||
div:before {
|
||||
content: "hi!";
|
||||
}'));
|
||||
|
||||
}
|
||||
|
||||
public function testInjectVars() {
|
||||
$out = $this->less->parse(".magic { color: @color; width: @base - 200; }",
|
||||
array(
|
||||
'color' => 'red',
|
||||
'base' => '960px'
|
||||
));
|
||||
|
||||
$this->assertEquals(trim($out), trim("
|
||||
.magic {
|
||||
color: red;
|
||||
width: 760px;
|
||||
}"));
|
||||
|
||||
}
|
||||
|
||||
public function testDisableImport() {
|
||||
$this->less->importDisabled = true;
|
||||
$this->assertEquals(
|
||||
"/* import disabled */",
|
||||
$this->compile("@import 'file3';"));
|
||||
}
|
||||
|
||||
public function testUserFunction() {
|
||||
$this->less->registerFunction("add-two", function($list) {
|
||||
list($a, $b) = $list[2];
|
||||
return $a[1] + $b[1];
|
||||
});
|
||||
|
||||
$this->assertEquals(
|
||||
$this->compile("result: add-two(10, 20);"),
|
||||
"result: 30;");
|
||||
|
||||
return $this->less;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testUserFunction
|
||||
*/
|
||||
public function testUnregisterFunction($less) {
|
||||
$less->unregisterFunction("add-two");
|
||||
|
||||
$this->assertEquals(
|
||||
$this->compile("result: add-two(10, 20);"),
|
||||
"result: add-two(10,20);");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function testFormatters() {
|
||||
$src = "
|
||||
div, pre {
|
||||
color: blue;
|
||||
span, .big, hello.world {
|
||||
height: 20px;
|
||||
color:#ffffff + #000;
|
||||
}
|
||||
}";
|
||||
|
||||
$this->less->setFormatter("compressed");
|
||||
$this->assertEquals(
|
||||
$this->compile($src), "div,pre{color:blue;}div span,div .big,div hello.world,pre span,pre .big,pre hello.world{height:20px;color:#fff;}");
|
||||
|
||||
// TODO: fix the output order of tags
|
||||
$this->less->setFormatter("lessjs");
|
||||
$this->assertEquals(
|
||||
$this->compile($src),
|
||||
"div,
|
||||
pre {
|
||||
color: blue;
|
||||
}
|
||||
div span,
|
||||
div .big,
|
||||
div hello.world,
|
||||
pre span,
|
||||
pre .big,
|
||||
pre hello.world {
|
||||
height: 20px;
|
||||
color: #ffffff;
|
||||
}");
|
||||
|
||||
$this->less->setFormatter("classic");
|
||||
$this->assertEquals(
|
||||
$this->compile($src),
|
||||
trim("div, pre { color:blue; }
|
||||
div span, div .big, div hello.world, pre span, pre .big, pre hello.world {
|
||||
height:20px;
|
||||
color:#ffffff;
|
||||
}
|
||||
"));
|
||||
|
||||
}
|
||||
|
||||
public function compile($str) {
|
||||
return trim($this->less->parse($str));
|
||||
}
|
||||
|
||||
}
|
71
sites/all/libraries/lessphp/tests/InputTest.php
Normal file
71
sites/all/libraries/lessphp/tests/InputTest.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . "/../lessc.inc.php";
|
||||
|
||||
// Runs all the tests in inputs/ and compares their output to ouputs/
|
||||
|
||||
function _dump($value) {
|
||||
fwrite(STDOUT, print_r($value, true));
|
||||
}
|
||||
|
||||
function _quote($str) {
|
||||
return preg_quote($str, "/");
|
||||
}
|
||||
|
||||
class InputTest extends PHPUnit_Framework_TestCase {
|
||||
protected static $inputDir = "inputs";
|
||||
protected static $outputDir = "outputs";
|
||||
|
||||
public function setUp() {
|
||||
$this->less = new lessc();
|
||||
$this->less->importDir = array(__DIR__ . "/" . self::$inputDir . "/test-imports");
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider fileNameProvider
|
||||
*/
|
||||
public function testInputFile($inFname) {
|
||||
if ($pattern = getenv("BUILD")) {
|
||||
return $this->buildInput($inFname);
|
||||
}
|
||||
|
||||
$outFname = self::outputNameFor($inFname);
|
||||
|
||||
if (!is_readable($outFname)) {
|
||||
$this->fail("$outFname is missing, ".
|
||||
"consider building tests with BUILD=true");
|
||||
}
|
||||
|
||||
$input = file_get_contents($inFname);
|
||||
$output = file_get_contents($outFname);
|
||||
|
||||
$this->assertEquals($output, $this->less->parse($input));
|
||||
}
|
||||
|
||||
public function fileNameProvider() {
|
||||
return array_map(function($a) { return array($a); },
|
||||
self::findInputNames());
|
||||
}
|
||||
|
||||
// only run when env is set
|
||||
public function buildInput($inFname) {
|
||||
$css = $this->less->parse(file_get_contents($inFname));
|
||||
file_put_contents(self::outputNameFor($inFname), $css);
|
||||
}
|
||||
|
||||
static public function findInputNames($pattern="*.less") {
|
||||
$files = glob(__DIR__ . "/" . self::$inputDir . "/" . $pattern);
|
||||
return array_filter($files, "is_file");
|
||||
}
|
||||
|
||||
static public function outputNameFor($input) {
|
||||
$front = _quote(__DIR__ . "/");
|
||||
$out = preg_replace("/^$front/", "", $input);
|
||||
|
||||
$in = _quote(self::$inputDir . "/");
|
||||
$out = preg_replace("/$in/", self::$outputDir . "/", $out);
|
||||
$out = preg_replace("/.less$/", ".css", $out);
|
||||
|
||||
return __DIR__ . "/" . $out;
|
||||
}
|
||||
}
|
13
sites/all/libraries/lessphp/tests/README.md
Normal file
13
sites/all/libraries/lessphp/tests/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
lessphp uses [phpunit](https://github.com/sebastianbergmann/phpunit/) for it's tests
|
||||
|
||||
`InputTest.php` iterates through all the less files in `inputs/`, compiles them,
|
||||
then compares the result with the respective file in `outputs/`.
|
||||
|
||||
From the root you can run `make` to run all the tests.
|
||||
|
||||
## bootstrap.sh
|
||||
|
||||
Clones twitter bootsrap, compiles it with lessc and lessphp, cleans up results
|
||||
with sort.php, and outputs diff. To run it, you need to have git and lessc
|
||||
installed.
|
||||
|
38
sites/all/libraries/lessphp/tests/bootstrap.sh
Normal file
38
sites/all/libraries/lessphp/tests/bootstrap.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "This script clones Twitter Bootstrap, compiles it with lessc and lessphp,"
|
||||
echo "cleans up results with sort.php, and outputs diff. To run it, you need to"
|
||||
echo "have git and lessc installed."
|
||||
echo ""
|
||||
|
||||
if [ -z "$input" ]; then
|
||||
input="bootstrap/less/bootstrap.less"
|
||||
fi
|
||||
dest=$(basename "$input")
|
||||
dest="${dest%.*}"
|
||||
|
||||
if [ -z "$@" ]; then
|
||||
diff_tool="diff -b -u -t -B"
|
||||
else
|
||||
diff_tool=$@
|
||||
fi
|
||||
|
||||
mkdir -p tmp
|
||||
|
||||
if [ ! -d 'bootstrap/' ]; then
|
||||
echo ">> Cloning bootstrap to bootstrap/"
|
||||
git clone https://github.com/twitter/bootstrap
|
||||
fi
|
||||
|
||||
echo ">> lessc compilation ($input)"
|
||||
lessc "$input" "tmp/$dest.lessc.css"
|
||||
|
||||
echo ">> lessphp compilation ($input)"
|
||||
../plessc "$input" "tmp/$dest.lessphp.css"
|
||||
echo ">> Cleanup and convert"
|
||||
|
||||
php sort.php "tmp/$dest.lessc.css" > "tmp/$dest.lessc.clean.css"
|
||||
php sort.php "tmp/$dest.lessphp.css" > "tmp/$dest.lessphp.clean.css"
|
||||
|
||||
echo ">> Doing diff"
|
||||
$diff_tool "tmp/$dest.lessc.clean.css" "tmp/$dest.lessphp.clean.css"
|
@@ -0,0 +1,36 @@
|
||||
/* accessors */
|
||||
|
||||
#defaults {
|
||||
@width: 960px;
|
||||
@color: black;
|
||||
.something {
|
||||
@space: 10px;
|
||||
@hello {
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.article { color: #294366; }
|
||||
|
||||
.comment {
|
||||
width: #defaults[@width];
|
||||
color: .article['color'];
|
||||
padding: #defaults > .something[@space];
|
||||
}
|
||||
|
||||
.wow {
|
||||
height: .comment['width'];
|
||||
background-color: .comment['color'];
|
||||
color: #defaults > .something > @hello['color'];
|
||||
|
||||
padding: #defaults > non-existant['padding'];
|
||||
margin: #defaults > .something['non-existant'];
|
||||
}
|
||||
|
||||
.mix {
|
||||
#defaults;
|
||||
font-size: .something[@space];
|
||||
}
|
||||
|
||||
|
77
sites/all/libraries/lessphp/tests/inputs/arity.less
Normal file
77
sites/all/libraries/lessphp/tests/inputs/arity.less
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
// simple arity
|
||||
|
||||
.hello(@a) {
|
||||
color: one;
|
||||
}
|
||||
|
||||
.hello(@a, @b) {
|
||||
color: two;
|
||||
}
|
||||
|
||||
.hello(@a, @b, @c) {
|
||||
color: three;
|
||||
}
|
||||
|
||||
|
||||
.world(@a, @b, @c) {
|
||||
color: three;
|
||||
}
|
||||
|
||||
.world(@a, @b) {
|
||||
color: two;
|
||||
}
|
||||
|
||||
.world(@a) {
|
||||
color: one;
|
||||
}
|
||||
|
||||
.one {
|
||||
.hello(1);
|
||||
.world(1);
|
||||
}
|
||||
|
||||
.two {
|
||||
.hello(1, 1);
|
||||
.world(1, 1);
|
||||
}
|
||||
|
||||
.three {
|
||||
.hello(1, 1, 1);
|
||||
.world(1, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
// arity with default values
|
||||
|
||||
.foo(@a, @b: cool) {
|
||||
color: two;
|
||||
}
|
||||
|
||||
.foo(@a, @b: cool, @c: yeah) {
|
||||
color: three;
|
||||
}
|
||||
|
||||
|
||||
.baz(@a, @b, @c: yeah) {
|
||||
color: three;
|
||||
}
|
||||
|
||||
.baz(@a, @b: cool) {
|
||||
color: two;
|
||||
}
|
||||
|
||||
|
||||
.multi-foo {
|
||||
.foo(1);
|
||||
.foo(1, 1);
|
||||
.foo(1,1,1);
|
||||
}
|
||||
|
||||
.multi-baz {
|
||||
.baz(1);
|
||||
.baz(1, 1);
|
||||
.baz(1,1,1);
|
||||
}
|
||||
|
||||
|
41
sites/all/libraries/lessphp/tests/inputs/attributes.less
Normal file
41
sites/all/libraries/lessphp/tests/inputs/attributes.less
Normal file
@@ -0,0 +1,41 @@
|
||||
* { color: blue; }
|
||||
E { color: blue; }
|
||||
E[foo] { color: blue; }
|
||||
[foo] { color: blue; }
|
||||
[foo] .helloWorld { color: blue; }
|
||||
[foo].helloWorld { color: blue; }
|
||||
E[foo="barbar"] { color: blue; }
|
||||
E[foo~="hello#$@%@$#^"] { color: blue; }
|
||||
E[foo^="color: green;"] { color: blue; }
|
||||
E[foo$="239023"] { color: blue; }
|
||||
E[foo*="29302"] { color: blue; }
|
||||
E[foo|="239032"] { color: blue; }
|
||||
E:root { color: blue; }
|
||||
|
||||
E:nth-child(odd) { color: blue; }
|
||||
E:nth-child(2n+1) { color: blue; }
|
||||
E:nth-child(5) { color: blue; }
|
||||
E:nth-last-child(-n+2) { color: blue; }
|
||||
E:nth-of-type(2n) { color: blue; }
|
||||
E:nth-last-of-type(n) { color: blue; }
|
||||
|
||||
E:first-child { color: blue; }
|
||||
E:last-child { color: blue; }
|
||||
E:first-of-type { color: blue; }
|
||||
E:last-of-type { color: blue; }
|
||||
E:only-child { color: blue; }
|
||||
E:only-of-type { color: blue; }
|
||||
E:empty { color: blue; }
|
||||
|
||||
E:lang(en) { color: blue; }
|
||||
E::first-line { color: blue; }
|
||||
E::before { color: blue; }
|
||||
|
||||
E#id { color: blue; }
|
||||
E:not(:link) { color: blue; }
|
||||
|
||||
E F { color: blue; }
|
||||
E > F { color: blue; }
|
||||
E + F { color: blue; }
|
||||
E ~ F { color: blue; }
|
||||
|
65
sites/all/libraries/lessphp/tests/inputs/builtins.less
Normal file
65
sites/all/libraries/lessphp/tests/inputs/builtins.less
Normal file
@@ -0,0 +1,65 @@
|
||||
// builtin
|
||||
|
||||
@something: "hello world";
|
||||
@color: #112233;
|
||||
@color2: rgba(44,55,66, .6);
|
||||
|
||||
body {
|
||||
color: @something;
|
||||
|
||||
@num: 7 / 6;
|
||||
height: @num + 4;
|
||||
height: floor(@num) + 4px;
|
||||
height: ceil(@num) + 4px;
|
||||
|
||||
@num2: 2 / 3;
|
||||
width: @num2;
|
||||
width: round(@num2);
|
||||
width: floor(@num2);
|
||||
width: ceil(@num2);
|
||||
width: round(10px / 3);
|
||||
|
||||
color: rgbahex(@color);
|
||||
color: rgbahex(@color2);
|
||||
color: argb(@color2);
|
||||
}
|
||||
|
||||
|
||||
format {
|
||||
@r: 32;
|
||||
format: %("rgb(%d, %d, %d)", @r, 128, 64);
|
||||
format-string: %("hello %s", "world");
|
||||
format-multiple: %("hello %s %d", "earth", 2);
|
||||
format-url-encode: %('red is %A', #ff0000);
|
||||
eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));
|
||||
}
|
||||
|
||||
|
||||
#functions {
|
||||
str: isstring("hello");
|
||||
str: isstring(one, two);
|
||||
|
||||
num: isnumber(2323px);
|
||||
num: isnumber(2323);
|
||||
num: isnumber(4/5);
|
||||
num: isnumber("hello");
|
||||
|
||||
col: iscolor(red);
|
||||
col: iscolor(hello);
|
||||
col: iscolor(rgba(0,0,0,0.3));
|
||||
col: iscolor(#fff);
|
||||
|
||||
key: iskeyword(hello);
|
||||
key: iskeyword(3D);
|
||||
|
||||
px: ispixel(10px);
|
||||
px: ispixel(10);
|
||||
|
||||
per: ispercentage(10%);
|
||||
per: ispercentage(10);
|
||||
|
||||
em: isem(10em);
|
||||
em: isem(10);
|
||||
}
|
||||
|
||||
|
139
sites/all/libraries/lessphp/tests/inputs/colors.less
Normal file
139
sites/all/libraries/lessphp/tests/inputs/colors.less
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
body {
|
||||
color: hsl(34, 50%, 40%);
|
||||
color: hsla(34, 50%, 40%, 0.3);
|
||||
|
||||
lighten: lighten(#efefef, 10%);
|
||||
lighten: lighten(rgb(23, 53, 231), 22%);
|
||||
lighten: lighten(rgba(212, 103, 88, 0.5), 10%);
|
||||
|
||||
darken: darken(#efefef, 10%);
|
||||
darken: darken(rgb(23, 53, 231), 22%);
|
||||
darken: darken(rgba(23, 53, 231, 0.5), 10%);
|
||||
|
||||
saturate: saturate(#efefef, 10%);
|
||||
saturate: saturate(rgb(23, 53, 231), 22%);
|
||||
saturate: saturate(rgba(23, 53, 231, 0.5), 10%);
|
||||
|
||||
desaturate: desaturate(#efefef, 10%);
|
||||
desaturate: desaturate(rgb(23, 53, 231), 22%);
|
||||
desaturate: desaturate(rgba(23, 53, 231, 0.5), 10%);
|
||||
|
||||
spin: spin(#efefef, 12);
|
||||
spin: spin(rgb(23, 53, 231), 15);
|
||||
spin: spin(rgba(23, 53, 231, 0.5), 19);
|
||||
|
||||
spin: spin(#efefef, -12);
|
||||
spin: spin(rgb(23, 53, 231), -15);
|
||||
spin: spin(rgba(23, 53, 231, 0.5), -19);
|
||||
|
||||
one: fadein(#abcdef, 10%);
|
||||
one: fadeout(#abcdef, -10%);
|
||||
|
||||
two: fadeout(#029f23, 10%);
|
||||
two: fadein(#029f23, -10%);
|
||||
|
||||
|
||||
three: fadein(rgba(1,2,3, 0.5), 10%);
|
||||
three: fadeout(rgba(1,2,3, 0.5), -10%);
|
||||
|
||||
four: fadeout(rgba(1,2,3, 0), 10%);
|
||||
four: fadein(rgba(1,2,3, 0), -10%);
|
||||
|
||||
hue: hue(rgb(34,20,40));
|
||||
sat: saturation(rgb(34,20,40));
|
||||
lit: lightness(rgb(34,20,40));
|
||||
|
||||
@old: #34fa03;
|
||||
@new: hsl(hue(@old), 45%, 90%);
|
||||
what: @new;
|
||||
|
||||
zero: saturate(#123456, -100%);
|
||||
zero: saturate(#123456, 100%);
|
||||
zero: saturate(#000000, 100%);
|
||||
zero: saturate(#ffffff, 100%);
|
||||
|
||||
zero: lighten(#123456, -100%);
|
||||
zero: lighten(#123456, 100%);
|
||||
zero: lighten(#000000, 100%);
|
||||
zero: lighten(#ffffff, 100%);
|
||||
|
||||
zero: spin(#123456, -100);
|
||||
zero: spin(#123456, 100);
|
||||
zero: spin(#000000, 100);
|
||||
zero: spin(#ffffff, 100);
|
||||
}
|
||||
|
||||
|
||||
alpha {
|
||||
// g: alpha(red);
|
||||
g: alpha(rgba(0,0,0,0));
|
||||
g: alpha(rgb(155,55,0));
|
||||
}
|
||||
|
||||
fade {
|
||||
f: fade(red, 50%);
|
||||
f: fade(#fff, 20%);
|
||||
f: fade(rgba(34,23,64,0.4), 50%);
|
||||
}
|
||||
|
||||
@a: rgb(255,255,255);
|
||||
@b: rgb(0,0,0);
|
||||
|
||||
.mix {
|
||||
color: mix(@a, @b, 50%);
|
||||
color: mix(rgba(5,3,1,0.3), rgba(6,3,2, 0.8), 50%);
|
||||
}
|
||||
|
||||
.percent {
|
||||
per: percentage(0.5);
|
||||
}
|
||||
|
||||
// color keywords
|
||||
|
||||
.colorz {
|
||||
color: whitesmoke - 10;
|
||||
color: spin(red, 34);
|
||||
color: spin(blah);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// purposfuly whacky to match less.js
|
||||
|
||||
@color: #fcf8e3;
|
||||
|
||||
body {
|
||||
start: @color;
|
||||
spin: spin(@color, -10); // #fcf4e3
|
||||
chained: darken(spin(@color, -10), 3%); // gives #fbeed5, should be #fbefd5
|
||||
direct: darken(#fcf4e3, 3%); // #fbefd5
|
||||
}
|
||||
|
||||
// spin around
|
||||
pre {
|
||||
@errorBackground: #f2dede;
|
||||
spin: spin(@errorBackground, -10);
|
||||
}
|
||||
|
||||
dd {
|
||||
@white: #fff;
|
||||
background-color: mix(@white, darken(@white, 10%), 60%);
|
||||
}
|
||||
|
||||
// math
|
||||
|
||||
.ops {
|
||||
c: red * 0.3;
|
||||
c: green / 2;
|
||||
c: purple % 7;
|
||||
c: 4 * salmon;
|
||||
c: 1 + salmon;
|
||||
|
||||
c: 132 / red;
|
||||
c: 132 - red;
|
||||
c: 132- red;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -0,0 +1,39 @@
|
||||
|
||||
@mixin {
|
||||
height: 22px;
|
||||
ul {
|
||||
height: 20px;
|
||||
li {
|
||||
@color: red;
|
||||
height: 10px;
|
||||
div span, link {
|
||||
margin: 10px;
|
||||
color: @color;
|
||||
}
|
||||
}
|
||||
|
||||
div, p {
|
||||
border: 1px;
|
||||
&.hello {
|
||||
color: green;
|
||||
}
|
||||
|
||||
:what {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
b {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
body {
|
||||
@mixin;
|
||||
}
|
15
sites/all/libraries/lessphp/tests/inputs/directives.less
Normal file
15
sites/all/libraries/lessphp/tests/inputs/directives.less
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
@hello: "utf-8";
|
||||
@charset @hello;
|
||||
|
||||
@-moz-document url-prefix(){
|
||||
div {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
@page :left { margin-left: 4cm; }
|
||||
@page :right { margin-left: 3cm; }
|
||||
@page { margin: 2cm }
|
||||
|
||||
|
20
sites/all/libraries/lessphp/tests/inputs/escape.less
Normal file
20
sites/all/libraries/lessphp/tests/inputs/escape.less
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
body {
|
||||
@hello: "world";
|
||||
border: e("this is simple");
|
||||
border: e(this is simple); // bug in lessjs
|
||||
border: e("this is simple", "cool lad");
|
||||
border: e(1232);
|
||||
border: e(@hello);
|
||||
border: e("one" + 'more'); // no string addition lessjs
|
||||
border: e(); // syntax error lessjs
|
||||
|
||||
line-height: ~"eating rice";
|
||||
line-height: ~"string cheese";
|
||||
line-height: a b c ~"string me" d e f;
|
||||
line-height: ~"string @{hello}";
|
||||
}
|
||||
|
||||
.class {
|
||||
filter: ~"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png')";
|
||||
}
|
28
sites/all/libraries/lessphp/tests/inputs/font_family.less
Normal file
28
sites/all/libraries/lessphp/tests/inputs/font_family.less
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
@font-directory: 'fonts/';
|
||||
@some-family: Gentium;
|
||||
|
||||
@font-face: maroon; // won't collide with @font-face { }
|
||||
|
||||
@font-face {
|
||||
font-family: Graublau Sans Web;
|
||||
src: url(@{font-directory}GraublauWeb.otf) format("opentype");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: @some-family;
|
||||
src: url('@{font-directory}Gentium.ttf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: @some-family;
|
||||
src: url("@{font-directory}GentiumItalic.ttf");
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: @some-family;
|
||||
crazy: @font-face;
|
||||
}
|
||||
|
||||
|
88
sites/all/libraries/lessphp/tests/inputs/guards.less
Normal file
88
sites/all/libraries/lessphp/tests/inputs/guards.less
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
.simple(@hi) when (@hi) {
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
|
||||
.something(@hi) when (@hi = cool) {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.another(@x) when (@x > 10) {
|
||||
color: green;
|
||||
}
|
||||
|
||||
|
||||
.flipped(@x) when (@x =< 10) {
|
||||
color: teal;
|
||||
}
|
||||
|
||||
.yeah(@arg) when (isnumber(@arg)) {
|
||||
color: purple;
|
||||
}
|
||||
|
||||
|
||||
.yeah(@arg) when (ispixel(@arg)) {
|
||||
color: silver;
|
||||
}
|
||||
|
||||
|
||||
.hello(@arg) when not (@arg) {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
dd {
|
||||
.simple(true);
|
||||
.simple(2344px);
|
||||
}
|
||||
|
||||
b {
|
||||
.something(cool);
|
||||
.something(birthday);
|
||||
}
|
||||
|
||||
img {
|
||||
.another(12);
|
||||
.another(2);
|
||||
|
||||
.flipped(12);
|
||||
.flipped(2);
|
||||
}
|
||||
|
||||
body {
|
||||
.yeah("world");
|
||||
.yeah(232px);
|
||||
.yeah(232);
|
||||
|
||||
.hello(true);
|
||||
}
|
||||
|
||||
.something(@x) when (@x) and (@y), not (@x = what) {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
div {
|
||||
@y: true;
|
||||
.something(true);
|
||||
|
||||
}
|
||||
|
||||
pre {
|
||||
.something(what);
|
||||
}
|
||||
|
||||
|
||||
.coloras(@g) when (iscolor(@g)) {
|
||||
color: true @g;
|
||||
}
|
||||
|
||||
link {
|
||||
.coloras(red);
|
||||
.coloras(10px);
|
||||
.coloras(ffjref);
|
||||
.coloras(#fff);
|
||||
.coloras(#fffddd);
|
||||
.coloras(rgb(0,0,0));
|
||||
.coloras(rgba(0,0,0, .34));
|
||||
}
|
||||
|
6
sites/all/libraries/lessphp/tests/inputs/hacks.less
Normal file
6
sites/all/libraries/lessphp/tests/inputs/hacks.less
Normal file
@@ -0,0 +1,6 @@
|
||||
// css hacks
|
||||
|
||||
:root .alert-message, :root .btn {
|
||||
border-radius: 0 \0;
|
||||
}
|
||||
|
5
sites/all/libraries/lessphp/tests/inputs/hi.less
Normal file
5
sites/all/libraries/lessphp/tests/inputs/hi.less
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
div:before {
|
||||
content: "hi!";
|
||||
}
|
||||
|
12
sites/all/libraries/lessphp/tests/inputs/ie.less
Normal file
12
sites/all/libraries/lessphp/tests/inputs/ie.less
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
foo {
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#c0ff3300, endColorstr=#ff000000);
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#c0ff3300, endColorstr=#ff000000);
|
||||
}
|
||||
|
||||
|
||||
foo {
|
||||
filter: alpha(opacity=20);
|
||||
filter: alpha(opacity=20, enabled=true);
|
||||
filter: blaznicate(foo=bar, baz=bang bip, bart=#fa4600);
|
||||
}
|
56
sites/all/libraries/lessphp/tests/inputs/import.less
vendored
Normal file
56
sites/all/libraries/lessphp/tests/inputs/import.less
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
@import 'file1.less'; // file found and imported
|
||||
|
||||
@import "not-found";
|
||||
|
||||
@import "something.css" media;
|
||||
@import url("something.css") media;
|
||||
@import url(something.css) media, screen, print;
|
||||
|
||||
@color: maroon;
|
||||
|
||||
@import url(file2); // found and imported
|
||||
|
||||
body {
|
||||
line-height: 10em;
|
||||
@colors;
|
||||
}
|
||||
|
||||
div {
|
||||
@color: fuchsia;
|
||||
@import "file2";
|
||||
}
|
||||
|
||||
|
||||
.mixin-import() {
|
||||
@import "file3";
|
||||
}
|
||||
|
||||
.one {
|
||||
.mixin-import();
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.two {
|
||||
.mixin-import();
|
||||
}
|
||||
|
||||
|
||||
#merge-import-mixins {
|
||||
@import "a";
|
||||
@import "b";
|
||||
div { .just-a-class; }
|
||||
}
|
||||
|
||||
|
||||
@import "inner/file1";
|
||||
|
||||
|
||||
// test bubbling variables up from imports, while preserving order
|
||||
|
||||
pre {
|
||||
color: @someValue;
|
||||
}
|
||||
|
||||
@import "file3";
|
||||
|
52
sites/all/libraries/lessphp/tests/inputs/keyframes.less
Normal file
52
sites/all/libraries/lessphp/tests/inputs/keyframes.less
Normal file
@@ -0,0 +1,52 @@
|
||||
@keyframes 'bounce' {
|
||||
from {
|
||||
top: 100px;
|
||||
animation-timing-function: ease-out;
|
||||
}
|
||||
|
||||
25% {
|
||||
top: 50px;
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
|
||||
50% {
|
||||
top: 100px;
|
||||
animation-timing-function: ease-out;
|
||||
}
|
||||
|
||||
75% {
|
||||
top: 75px;
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
|
||||
to {
|
||||
top: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes flowouttoleft {
|
||||
0% { -webkit-transform: translateX(0) scale(1); }
|
||||
60%, 70% { -webkit-transform: translateX(0) scale(.7); }
|
||||
100% { -webkit-transform: translateX(-100%) scale(.7); }
|
||||
}
|
||||
|
||||
div {
|
||||
animation-name: 'diagonal-slide';
|
||||
animation-duration: 5s;
|
||||
animation-iteration-count: 10;
|
||||
}
|
||||
|
||||
@keyframes 'diagonal-slide' {
|
||||
|
||||
from {
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
left: 100px;
|
||||
top: 100px;
|
||||
}
|
||||
|
||||
}
|
||||
|
121
sites/all/libraries/lessphp/tests/inputs/math.less
Normal file
121
sites/all/libraries/lessphp/tests/inputs/math.less
Normal file
@@ -0,0 +1,121 @@
|
||||
|
||||
.unary {
|
||||
// all operators are parsable as unary operators, anything
|
||||
// but - throws an error right now though,
|
||||
|
||||
// this gives two numbers
|
||||
sub: 10 -5;
|
||||
// add: 10 +5; // error
|
||||
// div: 10 /5; // error
|
||||
// mul: 10 *5; // error
|
||||
}
|
||||
|
||||
.spaces {
|
||||
// we can make the parser do math by leaving out the
|
||||
// space after the first value, or putting spaces on both sides
|
||||
|
||||
sub: 10-5;
|
||||
sub: 10 - 5;
|
||||
|
||||
add: 10+5;
|
||||
add: 10 + 5;
|
||||
|
||||
// div: 10/5; // this wont work, read on
|
||||
div: 10 / 5;
|
||||
|
||||
mul: 10*5;
|
||||
mul: 10 * 5;
|
||||
}
|
||||
|
||||
// these properties have divison not in parenthases
|
||||
.supress-division {
|
||||
border-radius: 10px / 10px;
|
||||
border-radius: 10px/10px;
|
||||
border-radius: hello (10px/10px) world;
|
||||
@x: 10px;
|
||||
font: @x/30 sans-serif;
|
||||
font: 10px / 20px sans-serif;
|
||||
font: 10px/20px sans-serif;
|
||||
border-radius:0 15px 15px 15px / 0 50% 50% 50%;
|
||||
}
|
||||
|
||||
|
||||
.parens {
|
||||
// if you are unsure, then just wrap the expression in parentheses and it will
|
||||
// always evaluate.
|
||||
|
||||
// notice we no longer have unary operators, and these will evaluate
|
||||
sub: (10 -5);
|
||||
add: (10 +5);
|
||||
div: (10 /5);
|
||||
div: (10/5); // no longer interpreted as the shorthand
|
||||
mul: (10 *5);
|
||||
}
|
||||
|
||||
.keyword-names {
|
||||
// watch out when doing math with keywords, - is a valid keyword character
|
||||
@a: 100;
|
||||
@b: 25;
|
||||
@a-: "hello";
|
||||
height: @a-@b; // here we get "hello" 25, not 75
|
||||
}
|
||||
|
||||
|
||||
.negation {
|
||||
hello: -(1px);
|
||||
hello: 0-(1px);
|
||||
|
||||
@something: 10;
|
||||
hello: -@something;
|
||||
}
|
||||
|
||||
|
||||
// and now here are the tests
|
||||
|
||||
.test {
|
||||
single: (5);
|
||||
single: 5+(5);
|
||||
single: (5)+((5));
|
||||
|
||||
parens: (5 +(5)) -2;
|
||||
// parens: ((5 +(5)) -2); // FAILS - fixme
|
||||
|
||||
math: (5 + 5)*(2 / 1);
|
||||
math: (5+5)*(2/1);
|
||||
|
||||
width: 2 * (4 * (2 + (1 + 6))) - 1;
|
||||
height: ((2+3)*(2+3) / (9-4)) + 1;
|
||||
padding: (2px + 4px) 1em 2px 2;
|
||||
|
||||
@var: (2 * 2);
|
||||
padding: (2 * @var) 4 4 (@var * 1px);
|
||||
width: (@var * @var) * 6;
|
||||
height: (7 * 7) + (8 * 8);
|
||||
margin: 4 * (5 + 5) / 2 - (@var * 2);
|
||||
}
|
||||
|
||||
.percents {
|
||||
color: 100 * 10%;
|
||||
color: 10% * 100;
|
||||
color: 10% * 10%;
|
||||
|
||||
color: 100px * 10%; // lessjs makes this px
|
||||
color: 10% * 100px; // lessjs makes this %
|
||||
|
||||
color: 20% + 10%;
|
||||
color: 20% - 10%;
|
||||
|
||||
color: 20% / 10%;
|
||||
}
|
||||
|
||||
.misc {
|
||||
x: 10px * 4em;
|
||||
y: 10 * 4em;
|
||||
}
|
||||
|
||||
|
||||
.cond {
|
||||
y: 10 < 10;
|
||||
y: 10 >= 10;
|
||||
}
|
||||
|
64
sites/all/libraries/lessphp/tests/inputs/media.less
Normal file
64
sites/all/libraries/lessphp/tests/inputs/media.less
Normal file
@@ -0,0 +1,64 @@
|
||||
@media screen, 3D {
|
||||
P { color: green; }
|
||||
}
|
||||
@media print {
|
||||
body { font-size: 10pt }
|
||||
}
|
||||
@media screen {
|
||||
body { font-size: 13px }
|
||||
}
|
||||
@media screen, print {
|
||||
body { line-height: 1.2 }
|
||||
}
|
||||
|
||||
@media all and (min-width: 0px) {
|
||||
body { line-height: 1.2 }
|
||||
}
|
||||
|
||||
@media all and (min-width: 0) {
|
||||
body { line-height: 1.2 }
|
||||
}
|
||||
|
||||
@media
|
||||
screen and (min-width: 102.5em) and (max-width: 117.9375em),
|
||||
screen and (min-width: 150em) {
|
||||
body { color: blue }
|
||||
}
|
||||
|
||||
|
||||
@media screen and (min-height: 100px + 10px) {
|
||||
body { color: red; }
|
||||
}
|
||||
|
||||
@cool: 100px;
|
||||
|
||||
@media screen and (height: @cool) and (width: @cool + 10), (size: @cool + 20) {
|
||||
body { color: red; }
|
||||
}
|
||||
|
||||
|
||||
// media bubbling
|
||||
|
||||
@media test {
|
||||
div {
|
||||
height: 20px;
|
||||
@media (hello) {
|
||||
color: red;
|
||||
|
||||
pre {
|
||||
color: orange;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// should not cross boundary
|
||||
@media yeah {
|
||||
@page {
|
||||
@media cool {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
93
sites/all/libraries/lessphp/tests/inputs/misc.less
Normal file
93
sites/all/libraries/lessphp/tests/inputs/misc.less
Normal file
@@ -0,0 +1,93 @@
|
||||
|
||||
@color: #fff;
|
||||
@base_path: "/assets/images/";
|
||||
@images: @base_path + "test/";
|
||||
.topbar { background: url(@{images}topbar.png); }
|
||||
.hello { test: empty-function(@images, 40%, to(@color)); }
|
||||
|
||||
.css3 {
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 90%,
|
||||
from(#E9A000), to(#A37000));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Here is a block comment
|
||||
|
||||
**/
|
||||
|
||||
|
||||
// this is a comment
|
||||
|
||||
.test, /*hello*/.world {
|
||||
border: 1px solid red; // world
|
||||
/* another property */
|
||||
color: url(http://mage-page.com);
|
||||
string: "hello /* this is not a comment */";
|
||||
world: "// neither is this";
|
||||
string: 'hello /* this is not a comment */' /*what if this is a comment */;
|
||||
world: '// neither is this' // hell world;
|
||||
;
|
||||
what-/*something?*/ever: 100px;
|
||||
background: url(/*no comment here*/);
|
||||
}
|
||||
|
||||
|
||||
.urls {
|
||||
@var: "http://google.com";
|
||||
background: url(@var);
|
||||
background: url(@{var});
|
||||
background: url("@{var}");
|
||||
}
|
||||
|
||||
.mix(@arg) { color: @arg; }
|
||||
@aaa: aaa;
|
||||
@bbb: bbb;
|
||||
// make sure the opening selector isn't too greedy
|
||||
.cool {.mix("@{aaa}, @{bbb}")}
|
||||
.cool();
|
||||
|
||||
.cool("{hello");
|
||||
.cool('{hello');
|
||||
|
||||
|
||||
// merging of mixins
|
||||
.span-17 { float: left; }
|
||||
.span-17 { width: 660px; }
|
||||
|
||||
.x {.span-17;}
|
||||
|
||||
.hi {
|
||||
pre {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.hi {
|
||||
pre {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
|
||||
.rad {
|
||||
.hi;
|
||||
}
|
||||
|
||||
|
||||
hello {
|
||||
numbers: 1.0 0.1 .1 1.;
|
||||
numbers: 1.0s 0.1s .1s 1.s;
|
||||
numbers: -1.0s -0.1s -.1s -1.s;
|
||||
numbers: -1.0 -0.1 -.1 -1.;
|
||||
}
|
||||
|
||||
|
||||
#string {
|
||||
hello: 'what\'s going on here';
|
||||
hello: 'blah blag @{ blah blah';
|
||||
|
||||
join: 3434 + "hello";
|
||||
join: 3434 + hello;
|
||||
}
|
||||
|
@@ -0,0 +1,40 @@
|
||||
|
||||
@outer: 10px;
|
||||
@class(@var:22px, @car: 400px + @outer) {
|
||||
margin: @var;
|
||||
height: @car;
|
||||
}
|
||||
|
||||
@group {
|
||||
@f(@color) {
|
||||
color: @color;
|
||||
}
|
||||
.cool {
|
||||
border-bottom: 1px solid green;
|
||||
}
|
||||
}
|
||||
|
||||
.class(@width:200px) {
|
||||
padding: @width;
|
||||
}
|
||||
|
||||
body {
|
||||
.class(2.0em);
|
||||
@group > @f(red);
|
||||
@class(10px, 10px + 2);
|
||||
@group > .cool;
|
||||
}
|
||||
|
||||
|
||||
@lots(@a: 10px, @b: 20px, @c: 30px, @d: 40px, @e: 4px, @f:3px, @g:2px, @h: 1px) {
|
||||
padding: @a @b @c @d;
|
||||
margin: @e @f @g @h;
|
||||
}
|
||||
|
||||
.skip_args {
|
||||
@class(,12px);
|
||||
@lots(,,,88px,,12px);
|
||||
@group > @f(red,,,,);
|
||||
@group > @f(red);
|
||||
}
|
||||
|
@@ -0,0 +1,100 @@
|
||||
|
||||
@tester {
|
||||
p, div { height: 10px; }
|
||||
}
|
||||
|
||||
#test1 {
|
||||
div { color: red; }
|
||||
@tester;
|
||||
}
|
||||
|
||||
|
||||
@cool {
|
||||
a,b,i { width: 1px; }
|
||||
}
|
||||
|
||||
#test2 {
|
||||
b { color: red; }
|
||||
@cool;
|
||||
}
|
||||
|
||||
#test3 {
|
||||
@cool;
|
||||
b { color: red; }
|
||||
}
|
||||
|
||||
@cooler {
|
||||
a { margin: 1px; }
|
||||
}
|
||||
|
||||
#test4 {
|
||||
a, div, html { color: blue; }
|
||||
@cooler;
|
||||
}
|
||||
|
||||
@hi {
|
||||
img, strong { float: right; }
|
||||
}
|
||||
|
||||
#test5 {
|
||||
img, strong { padding: 2px; }
|
||||
@hi;
|
||||
}
|
||||
|
||||
@nested {
|
||||
div, span {
|
||||
a {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#test6 {
|
||||
div, span {
|
||||
a {
|
||||
line-height: 10px;
|
||||
}
|
||||
}
|
||||
@nested;
|
||||
}
|
||||
|
||||
@broken-nesting {
|
||||
div, span {
|
||||
strong, b {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#test7 {
|
||||
div {
|
||||
strong {
|
||||
margin: 1px;
|
||||
}
|
||||
}
|
||||
@broken-nesting;
|
||||
}
|
||||
|
||||
|
||||
@another-nest {
|
||||
a,b {
|
||||
i {
|
||||
color: red;
|
||||
}
|
||||
|
||||
s {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#test8 {
|
||||
a, b {
|
||||
i,s {
|
||||
background: red;
|
||||
}
|
||||
}
|
||||
@another-nest;
|
||||
}
|
||||
|
159
sites/all/libraries/lessphp/tests/inputs/mixins.less
Normal file
159
sites/all/libraries/lessphp/tests/inputs/mixins.less
Normal file
@@ -0,0 +1,159 @@
|
||||
|
||||
@rounded-corners {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.bold {
|
||||
@font-size: 20px;
|
||||
font-size: @font-size;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
body #window {
|
||||
@rounded-corners;
|
||||
.bold;
|
||||
line-height: @font-size * 1.5;
|
||||
}
|
||||
|
||||
#bundle {
|
||||
.button {
|
||||
display: block;
|
||||
border: 1px solid black;
|
||||
background-color: grey;
|
||||
&:hover { background-color: white }
|
||||
}
|
||||
}
|
||||
#header a {
|
||||
color: orange;
|
||||
#bundle > .button; // mixin the button class
|
||||
}
|
||||
|
||||
div {
|
||||
@abstract {
|
||||
hello: world;
|
||||
b {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
|
||||
@abstract > b;
|
||||
@abstract;
|
||||
}
|
||||
|
||||
@poop {
|
||||
big: baby;
|
||||
}
|
||||
|
||||
body {
|
||||
div;
|
||||
}
|
||||
|
||||
// not using > to list mixins
|
||||
|
||||
.hello {
|
||||
.world {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
|
||||
.foobar {
|
||||
.hello .world;
|
||||
}
|
||||
|
||||
|
||||
.butter {
|
||||
.this .one .isnt .found;
|
||||
}
|
||||
|
||||
|
||||
// arguments
|
||||
|
||||
.spam(@something: 100, @dad: land) {
|
||||
@wow: 23434;
|
||||
foo: @arguments;
|
||||
bar: @arguments;
|
||||
}
|
||||
|
||||
.eggs {
|
||||
.spam(1px, 2px);
|
||||
.spam();
|
||||
}
|
||||
|
||||
.first(@one, @two, @three, @four: cool) {
|
||||
cool: @arguments;
|
||||
}
|
||||
|
||||
#hello {
|
||||
.first(one, two, three);
|
||||
}
|
||||
|
||||
#hello-important {
|
||||
.first(one, two, three) !important;
|
||||
}
|
||||
|
||||
.rad(@name) {
|
||||
cool: @arguments;
|
||||
}
|
||||
|
||||
#world {
|
||||
@hello: "world";
|
||||
.rad("@{hello}");
|
||||
}
|
||||
|
||||
.second(@x, @y:skip, @z: me) {
|
||||
things: @arguments;
|
||||
}
|
||||
|
||||
#another {
|
||||
.second(red, blue, green);
|
||||
.second(red blue green);
|
||||
}
|
||||
|
||||
|
||||
.another(@x, @y:skip, @z:me) {
|
||||
.cool {
|
||||
color: @arguments;
|
||||
}
|
||||
}
|
||||
|
||||
#day {
|
||||
.another(one,two, three);
|
||||
.another(one two three);
|
||||
}
|
||||
|
||||
|
||||
.to-be-important() {
|
||||
color: red;
|
||||
@color: red;
|
||||
height: 20px;
|
||||
|
||||
pre {
|
||||
color: @color;
|
||||
}
|
||||
}
|
||||
|
||||
.mix-suffix {
|
||||
.to-be-important() !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#search-all {
|
||||
.red() {
|
||||
color:#f00 !important;
|
||||
}
|
||||
}
|
||||
|
||||
#search-all {
|
||||
.green() {
|
||||
color: #0f0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.search-test {
|
||||
#search-all > .red();
|
||||
#search-all > .green();
|
||||
}
|
||||
|
||||
|
60
sites/all/libraries/lessphp/tests/inputs/nested.less
Normal file
60
sites/all/libraries/lessphp/tests/inputs/nested.less
Normal file
@@ -0,0 +1,60 @@
|
||||
#header {
|
||||
color: black;
|
||||
|
||||
.navigation {
|
||||
font-size: 12px;
|
||||
.border {
|
||||
.outside {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
.logo {
|
||||
width: 300px;
|
||||
&:hover { text-decoration: none }
|
||||
}
|
||||
}
|
||||
|
||||
a { b { ul { li { color: green; } } } }
|
||||
|
||||
this { will { not { show { } } } }
|
||||
|
||||
.cool {
|
||||
div & { color: green; }
|
||||
p & span { color: yellow; }
|
||||
}
|
||||
|
||||
another {
|
||||
.cool;
|
||||
}
|
||||
|
||||
b {
|
||||
& .something {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
&.something {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
|
||||
.foo {
|
||||
.bar, .baz {
|
||||
& .qux {
|
||||
display: block;
|
||||
}
|
||||
.qux & {
|
||||
display: inline;
|
||||
}
|
||||
.qux & .biz {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
b {
|
||||
hello [x="&yeah"] {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
167
sites/all/libraries/lessphp/tests/inputs/pattern_matching.less
Normal file
167
sites/all/libraries/lessphp/tests/inputs/pattern_matching.less
Normal file
@@ -0,0 +1,167 @@
|
||||
|
||||
.demo (light, @color) {
|
||||
color: lighten(@color, 10%);
|
||||
}
|
||||
.demo (@_, @color) {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@switch: light;
|
||||
|
||||
.class {
|
||||
.demo(@switch, #888);
|
||||
}
|
||||
|
||||
// by arity
|
||||
|
||||
.mixin () {
|
||||
zero: 0;
|
||||
}
|
||||
.mixin (@a: 1px) {
|
||||
one: 1;
|
||||
}
|
||||
.mixin (@a) {
|
||||
one-req: 1;
|
||||
}
|
||||
.mixin (@a: 1px, @b: 2px) {
|
||||
two: 2;
|
||||
}
|
||||
|
||||
.mixin (@a, @b, @c) {
|
||||
three-req: 3;
|
||||
}
|
||||
|
||||
.mixin (@a: 1px, @b: 2px, @c: 3px) {
|
||||
three: 3;
|
||||
}
|
||||
|
||||
.zero {
|
||||
.mixin();
|
||||
}
|
||||
|
||||
.one {
|
||||
.mixin(1);
|
||||
}
|
||||
|
||||
.two {
|
||||
.mixin(1, 2);
|
||||
}
|
||||
|
||||
.three {
|
||||
.mixin(1, 2, 3);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
.mixout ('left') {
|
||||
left: 1;
|
||||
}
|
||||
|
||||
.mixout ('right') {
|
||||
right: 1;
|
||||
}
|
||||
|
||||
.left {
|
||||
.mixout('left');
|
||||
}
|
||||
.right {
|
||||
.mixout('right');
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
.border (@side, @width) {
|
||||
color: black;
|
||||
.border-side(@side, @width);
|
||||
}
|
||||
.border-side (left, @w) {
|
||||
border-left: @w;
|
||||
}
|
||||
.border-side (right, @w) {
|
||||
border-right: @w;
|
||||
}
|
||||
|
||||
.border-right {
|
||||
.border(right, 4px);
|
||||
}
|
||||
.border-left {
|
||||
.border(left, 4px);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
|
||||
.border-radius (@r) {
|
||||
both: @r * 10;
|
||||
}
|
||||
.border-radius (@r, left) {
|
||||
left: @r;
|
||||
}
|
||||
.border-radius (@r, right) {
|
||||
right: @r;
|
||||
}
|
||||
|
||||
.only-right {
|
||||
.border-radius(33, right);
|
||||
}
|
||||
.only-left {
|
||||
.border-radius(33, left);
|
||||
}
|
||||
.left-right {
|
||||
.border-radius(33);
|
||||
}
|
||||
|
||||
.hola(hello, @hello...) {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
#hola {
|
||||
.hola(hello, world);
|
||||
.hola(jello, world);
|
||||
}
|
||||
|
||||
.resty(@hello, @world, @the_rest...) {
|
||||
padding: @hello @world;
|
||||
rest: @the_rest;
|
||||
}
|
||||
|
||||
#nnn {
|
||||
.body(10, 10, 10, 10, 10);
|
||||
.body(10, 10, 10);
|
||||
.body(10, 10);
|
||||
.body(10);
|
||||
.body();
|
||||
}
|
||||
|
||||
.defaults(@aa, @bb:e343, @cc: "heah", ...) {
|
||||
height: @aa;
|
||||
}
|
||||
|
||||
#defaults_1 {
|
||||
.defaults();
|
||||
.defaults(one);
|
||||
.defaults(two, one);
|
||||
.defaults(three, two, one);
|
||||
.defaults(four, three, two, one);
|
||||
}
|
||||
|
||||
|
||||
.thing() { color: green; }
|
||||
.thing(...) { color: blue; }
|
||||
.thing { color: red; }
|
||||
|
||||
#aa {
|
||||
.thing();
|
||||
}
|
||||
|
||||
#bb {
|
||||
.thing;
|
||||
}
|
||||
|
||||
|
||||
#cc {
|
||||
.thing(1);
|
||||
}
|
||||
|
||||
|
||||
|
40
sites/all/libraries/lessphp/tests/inputs/scopes.less
Normal file
40
sites/all/libraries/lessphp/tests/inputs/scopes.less
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
@a: 10;
|
||||
@some {
|
||||
@b: @a + 10;
|
||||
div {
|
||||
@c: @b + 10;
|
||||
other {
|
||||
@d: @c + 10;
|
||||
world {
|
||||
@e: @d + 10;
|
||||
height: @e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
@some;
|
||||
}
|
||||
|
||||
@some;
|
||||
|
||||
.test(@x: 10) {
|
||||
height: @x;
|
||||
.test(@y: 11) {
|
||||
height: @y;
|
||||
.test(@z: 12) {
|
||||
height: @z;
|
||||
}
|
||||
.test;
|
||||
}
|
||||
.test;
|
||||
}
|
||||
|
||||
pre {
|
||||
.test;
|
||||
}
|
||||
|
@@ -0,0 +1,29 @@
|
||||
|
||||
@color: blue;
|
||||
|
||||
(~"something @{color}"), world {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.div {
|
||||
@color: red;
|
||||
(3434) {
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
(~"cool @{color}") {
|
||||
height: 4000px;
|
||||
}
|
||||
}
|
||||
|
||||
.heck(@a) { color: @a+10 }
|
||||
|
||||
.spanX (@index) when (@index > 0) {
|
||||
(~".span@{index}") { .heck(@index) }
|
||||
.spanX(@index - 1);
|
||||
}
|
||||
.spanX (0) {}
|
||||
|
||||
.spanX (5);
|
||||
|
||||
|
120
sites/all/libraries/lessphp/tests/inputs/site_demos.less
Normal file
120
sites/all/libraries/lessphp/tests/inputs/site_demos.less
Normal file
@@ -0,0 +1,120 @@
|
||||
// these are the demos from the lessphp homepage
|
||||
|
||||
default {
|
||||
@base: 24px;
|
||||
@border-color: #B2B;
|
||||
|
||||
.underline { border-bottom: 1px solid green }
|
||||
|
||||
#header {
|
||||
color: black;
|
||||
border: 1px solid @border-color + #222222;
|
||||
|
||||
.navigation {
|
||||
font-size: @base / 2;
|
||||
a {
|
||||
.underline;
|
||||
}
|
||||
}
|
||||
.logo {
|
||||
width: 300px;
|
||||
&:hover { text-decoration: none }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variables {
|
||||
@a: 2;
|
||||
@x: @a * @a;
|
||||
@y: @x + 1;
|
||||
@z: @x * 2 + @y;
|
||||
|
||||
@nice-blue: #5B83AD;
|
||||
@light-blue: @nice-blue + #111;
|
||||
|
||||
@b: @a * 10;
|
||||
@c: #888;
|
||||
@fonts: "Trebuchet MS", Verdana, sans-serif;
|
||||
|
||||
.variables {
|
||||
width: @z + 1cm; // 14cm
|
||||
height: @b + @x + 0px; // 24px
|
||||
color: @c;
|
||||
background: @light-blue;
|
||||
font-family: @fonts;
|
||||
}
|
||||
}
|
||||
|
||||
mixins {
|
||||
.bordered {
|
||||
border-top: dotted 1px black;
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
#menu a {
|
||||
color: #111;
|
||||
.bordered;
|
||||
}
|
||||
|
||||
.post a {
|
||||
color: red;
|
||||
.bordered;
|
||||
}
|
||||
}
|
||||
|
||||
nested-rules {
|
||||
#header {
|
||||
color: black;
|
||||
|
||||
.navigation {
|
||||
font-size: 12px;
|
||||
}
|
||||
.logo {
|
||||
width: 300px;
|
||||
&:hover { text-decoration: none }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespaces {
|
||||
#bundle {
|
||||
.button {
|
||||
display: block;
|
||||
border: 1px solid black;
|
||||
background-color: grey;
|
||||
&:hover { background-color: white }
|
||||
}
|
||||
}
|
||||
#header a {
|
||||
color: orange;
|
||||
#bundle > .button; // mixin the button class
|
||||
}
|
||||
}
|
||||
|
||||
mixin-functions {
|
||||
@outer: 10px;
|
||||
@class(@var:22px, @car: 400px + @outer) {
|
||||
margin: @var;
|
||||
height: @car;
|
||||
}
|
||||
|
||||
@group {
|
||||
@f(@color) {
|
||||
color: @color;
|
||||
}
|
||||
.cool {
|
||||
border-bottom: 1px solid green;
|
||||
}
|
||||
}
|
||||
|
||||
.class(@width:200px) {
|
||||
padding: @width;
|
||||
}
|
||||
|
||||
body {
|
||||
.class(2.0em);
|
||||
@group > @f(red);
|
||||
@class(10px, 10px + 2);
|
||||
@group > .cool;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,6 @@
|
||||
.just-a-class { background: red; }
|
||||
|
||||
.some-mixin() {
|
||||
height: 200px;
|
||||
}
|
||||
|
12
sites/all/libraries/lessphp/tests/inputs/test-imports/b.less
Normal file
12
sites/all/libraries/lessphp/tests/inputs/test-imports/b.less
Normal file
@@ -0,0 +1,12 @@
|
||||
.just-a-class { background: blue; }
|
||||
|
||||
.hello {
|
||||
.some-mixin();
|
||||
}
|
||||
|
||||
|
||||
@media cool {
|
||||
color: red;
|
||||
.some-mixin();
|
||||
}
|
||||
|
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* This is a test import file
|
||||
*/
|
||||
|
||||
@colors {
|
||||
div.bright {
|
||||
color: red;
|
||||
}
|
||||
|
||||
div.sad {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,6 @@
|
||||
|
||||
b {
|
||||
color: @color;
|
||||
padding: 16px;
|
||||
}
|
||||
|
@@ -0,0 +1,7 @@
|
||||
|
||||
h2 {
|
||||
background: url("../images/logo.png") no-repeat;
|
||||
}
|
||||
|
||||
@someValue: hello-from-file-3;
|
||||
|
@@ -0,0 +1,6 @@
|
||||
|
||||
.inner {
|
||||
content: "inner/file1.less"
|
||||
}
|
||||
|
||||
@import "file2"; // should get the one in inner
|
@@ -0,0 +1,4 @@
|
||||
|
||||
.inner {
|
||||
content: "inner/file2.less"
|
||||
}
|
45
sites/all/libraries/lessphp/tests/inputs/variables.less
Normal file
45
sites/all/libraries/lessphp/tests/inputs/variables.less
Normal file
@@ -0,0 +1,45 @@
|
||||
@a: 2;
|
||||
@x: @a * @a;
|
||||
@y: @x + 1;
|
||||
@z: @y + @x * 2;
|
||||
@m: @z % @y;
|
||||
|
||||
@nice-blue: #5B83AD;
|
||||
@light-blue: @nice-blue + #111;
|
||||
|
||||
@rgb-color: rgb(20%, 15%, 80%);
|
||||
@rgba-color: rgba(23,68,149,0.5);
|
||||
|
||||
@b: @a * 10px;
|
||||
@c: #888;
|
||||
@fonts: "Trebuchet MS", Verdana, sans-serif;
|
||||
|
||||
.variables {
|
||||
width: @z + 1cm; // 14cm
|
||||
height: @b + @x + 0px; // 24px
|
||||
margin-top: -@b; // -20px
|
||||
margin-bottom: 10 - -@b; // 30px
|
||||
@d: @c + #001;
|
||||
color: @d;
|
||||
background: @light-blue;
|
||||
font-family: @fonts;
|
||||
margin: @m + 0px; // 3px
|
||||
font: 10px/12px serif;
|
||||
font: 120%/120% serif;
|
||||
}
|
||||
|
||||
.external {
|
||||
color: @c;
|
||||
border: 1px solid @rgb-color;
|
||||
background: @rgba-color;
|
||||
padding: @nonexistant + 4px;
|
||||
}
|
||||
|
||||
@hello: 44px;
|
||||
@something: "hello";
|
||||
@cool: something;
|
||||
|
||||
color: @@something;
|
||||
color: @@@cool;
|
||||
|
||||
|
14
sites/all/libraries/lessphp/tests/outputs/accessors.css
Normal file
14
sites/all/libraries/lessphp/tests/outputs/accessors.css
Normal file
@@ -0,0 +1,14 @@
|
||||
.article { color:#294366; }
|
||||
.comment {
|
||||
width:960px;
|
||||
color:#294366;
|
||||
padding:10px;
|
||||
}
|
||||
.wow {
|
||||
height:960px;
|
||||
background-color:#294366;
|
||||
color:green;
|
||||
padding:;
|
||||
margin:;
|
||||
}
|
||||
.mix { font-size:10px; }
|
25
sites/all/libraries/lessphp/tests/outputs/arity.css
Normal file
25
sites/all/libraries/lessphp/tests/outputs/arity.css
Normal file
@@ -0,0 +1,25 @@
|
||||
.one {
|
||||
color: one;
|
||||
color: one;
|
||||
}
|
||||
.two {
|
||||
color: two;
|
||||
color: two;
|
||||
}
|
||||
.three {
|
||||
color: three;
|
||||
color: three;
|
||||
}
|
||||
.multi-foo {
|
||||
color: two;
|
||||
color: three;
|
||||
color: two;
|
||||
color: three;
|
||||
color: three;
|
||||
}
|
||||
.multi-baz {
|
||||
color: two;
|
||||
color: three;
|
||||
color: two;
|
||||
color: three;
|
||||
}
|
105
sites/all/libraries/lessphp/tests/outputs/attributes.css
Normal file
105
sites/all/libraries/lessphp/tests/outputs/attributes.css
Normal file
@@ -0,0 +1,105 @@
|
||||
* {
|
||||
color: blue;
|
||||
}
|
||||
E {
|
||||
color: blue;
|
||||
}
|
||||
E[foo] {
|
||||
color: blue;
|
||||
}
|
||||
[foo] {
|
||||
color: blue;
|
||||
}
|
||||
[foo] .helloWorld {
|
||||
color: blue;
|
||||
}
|
||||
[foo].helloWorld {
|
||||
color: blue;
|
||||
}
|
||||
E[foo="barbar"] {
|
||||
color: blue;
|
||||
}
|
||||
E[foo~="hello#$@%@$#^"] {
|
||||
color: blue;
|
||||
}
|
||||
E[foo^="color: green;"] {
|
||||
color: blue;
|
||||
}
|
||||
E[foo$="239023"] {
|
||||
color: blue;
|
||||
}
|
||||
E[foo*="29302"] {
|
||||
color: blue;
|
||||
}
|
||||
E[foo|="239032"] {
|
||||
color: blue;
|
||||
}
|
||||
E:root {
|
||||
color: blue;
|
||||
}
|
||||
E:nth-child(odd) {
|
||||
color: blue;
|
||||
}
|
||||
E:nth-child(2n+1) {
|
||||
color: blue;
|
||||
}
|
||||
E:nth-child(5) {
|
||||
color: blue;
|
||||
}
|
||||
E:nth-last-child(-n+2) {
|
||||
color: blue;
|
||||
}
|
||||
E:nth-of-type(2n) {
|
||||
color: blue;
|
||||
}
|
||||
E:nth-last-of-type(n) {
|
||||
color: blue;
|
||||
}
|
||||
E:first-child {
|
||||
color: blue;
|
||||
}
|
||||
E:last-child {
|
||||
color: blue;
|
||||
}
|
||||
E:first-of-type {
|
||||
color: blue;
|
||||
}
|
||||
E:last-of-type {
|
||||
color: blue;
|
||||
}
|
||||
E:only-child {
|
||||
color: blue;
|
||||
}
|
||||
E:only-of-type {
|
||||
color: blue;
|
||||
}
|
||||
E:empty {
|
||||
color: blue;
|
||||
}
|
||||
E:lang(en) {
|
||||
color: blue;
|
||||
}
|
||||
E::first-line {
|
||||
color: blue;
|
||||
}
|
||||
E::before {
|
||||
color: blue;
|
||||
}
|
||||
E#id {
|
||||
color: blue;
|
||||
}
|
||||
E:not(:link) {
|
||||
color: blue;
|
||||
}
|
||||
E F {
|
||||
color: blue;
|
||||
}
|
||||
E > F {
|
||||
color: blue;
|
||||
}
|
||||
E + F {
|
||||
color: blue;
|
||||
}
|
||||
E ~ F {
|
||||
color: blue;
|
||||
}
|
41
sites/all/libraries/lessphp/tests/outputs/builtins.css
Normal file
41
sites/all/libraries/lessphp/tests/outputs/builtins.css
Normal file
@@ -0,0 +1,41 @@
|
||||
body {
|
||||
color: "hello world";
|
||||
height: 5.1666666666667;
|
||||
height: 5px;
|
||||
height: 6px;
|
||||
width: 0.66666666666667;
|
||||
width: 1;
|
||||
width: 0;
|
||||
width: 1;
|
||||
width: 3px;
|
||||
color: #ff112233;
|
||||
color: #992c3742;
|
||||
color: #992c3742;
|
||||
}
|
||||
format {
|
||||
format: "rgb(32, 128, 64)";
|
||||
format-string: "hello world";
|
||||
format-multiple: "hello earth 2";
|
||||
format-url-encode: 'red is %A';
|
||||
eformat: rgb(32, 128, 64);
|
||||
}
|
||||
#functions {
|
||||
str: true;
|
||||
str: false;
|
||||
num: true;
|
||||
num: true;
|
||||
num: true;
|
||||
num: false;
|
||||
col: true;
|
||||
col: false;
|
||||
col: true;
|
||||
col: true;
|
||||
key: true;
|
||||
key: false;
|
||||
px: true;
|
||||
px: false;
|
||||
per: true;
|
||||
per: false;
|
||||
em: true;
|
||||
em: false;
|
||||
}
|
89
sites/all/libraries/lessphp/tests/outputs/colors.css
Normal file
89
sites/all/libraries/lessphp/tests/outputs/colors.css
Normal file
@@ -0,0 +1,89 @@
|
||||
body {
|
||||
color: #996d33;
|
||||
color: rgba(153,109,51,0.3);
|
||||
lighten: #ffffff;
|
||||
lighten: #7c8df2;
|
||||
lighten: rgba(222,140,129,0.5);
|
||||
darken: #d6d6d6;
|
||||
darken: #0d1e81;
|
||||
darken: rgba(18,42,185,0.5);
|
||||
saturate: #f1eded;
|
||||
saturate: #0025fe;
|
||||
saturate: rgba(10,44,244,0.5);
|
||||
desaturate: #efefef;
|
||||
desaturate: #3349cb;
|
||||
desaturate: rgba(36,62,218,0.5);
|
||||
spin: #efefef;
|
||||
spin: #2d17e7;
|
||||
spin: rgba(59,23,231,0.5);
|
||||
spin: #efefef;
|
||||
spin: #1769e7;
|
||||
spin: rgba(23,119,231,0.5);
|
||||
one: #abcdef;
|
||||
one: #abcdef;
|
||||
two: rgba(2,159,35,0.9);
|
||||
two: rgba(2,159,35,0.9);
|
||||
three: rgba(1,2,3,0.6);
|
||||
three: rgba(1,2,3,0.6);
|
||||
four: rgba(1,2,3,0);
|
||||
four: rgba(1,2,3,0);
|
||||
hue: 282;
|
||||
sat: 33;
|
||||
lit: 12;
|
||||
what: #dff1da;
|
||||
zero: #343434;
|
||||
zero: #003468;
|
||||
zero: #000000;
|
||||
zero: #ffffff;
|
||||
zero: #000000;
|
||||
zero: #ffffff;
|
||||
zero: #ffffff;
|
||||
zero: #ffffff;
|
||||
zero: #1d5612;
|
||||
zero: #56124b;
|
||||
zero: #000000;
|
||||
zero: #ffffff;
|
||||
}
|
||||
alpha {
|
||||
g: 0;
|
||||
g: 1;
|
||||
}
|
||||
fade {
|
||||
f: rgba(255,0,0,0.5);
|
||||
f: rgba(255,255,255,0.2);
|
||||
f: rgba(34,23,64,0.5);
|
||||
}
|
||||
.mix {
|
||||
color: #808080;
|
||||
color: rgba(6,3,2,-0.25);
|
||||
}
|
||||
.percent {
|
||||
per: 50%;
|
||||
}
|
||||
.colorz {
|
||||
color: #ebebeb;
|
||||
color: #ff9100;
|
||||
color: #000000;
|
||||
}
|
||||
body {
|
||||
start: #fcf8e3;
|
||||
spin: #fcf4e3;
|
||||
chained: #fbeed5;
|
||||
direct: #fbefd5;
|
||||
}
|
||||
pre {
|
||||
spin: #f2dee1;
|
||||
}
|
||||
dd {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.ops {
|
||||
c: #4d0000;
|
||||
c: #004000;
|
||||
c: #020002;
|
||||
c: #ffffff;
|
||||
c: #fb8173;
|
||||
c: 132 / #ff0000;
|
||||
c: 132 - #ff0000;
|
||||
c: 132- #ff0000;
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
body {
|
||||
height: 22px;
|
||||
}
|
||||
body ul {
|
||||
height: 20px;
|
||||
}
|
||||
body ul li {
|
||||
height: 10px;
|
||||
}
|
||||
body ul li div span,
|
||||
body ul li link {
|
||||
margin: 10px;
|
||||
color: red;
|
||||
}
|
||||
body ul div,
|
||||
body ul p {
|
||||
border: 1px;
|
||||
}
|
||||
body ul div.hello,
|
||||
body ul p.hello {
|
||||
color: green;
|
||||
}
|
||||
body ul div :what,
|
||||
body ul p :what {
|
||||
color: blue;
|
||||
}
|
||||
body ul a b {
|
||||
color: blue;
|
||||
}
|
15
sites/all/libraries/lessphp/tests/outputs/directives.css
Normal file
15
sites/all/libraries/lessphp/tests/outputs/directives.css
Normal file
@@ -0,0 +1,15 @@
|
||||
@charset "utf-8";
|
||||
@-moz-document url-prefix() {
|
||||
div {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
@page :left {
|
||||
margin-left: 4cm;
|
||||
}
|
||||
@page :right {
|
||||
margin-left: 3cm;
|
||||
}
|
||||
@page {
|
||||
margin: 2cm;
|
||||
}
|
16
sites/all/libraries/lessphp/tests/outputs/escape.css
Normal file
16
sites/all/libraries/lessphp/tests/outputs/escape.css
Normal file
@@ -0,0 +1,16 @@
|
||||
body {
|
||||
border: this is simple;
|
||||
border: this;
|
||||
border: this is simple;
|
||||
border: 1232;
|
||||
border: world;
|
||||
border: onemore;
|
||||
border: ;
|
||||
line-height: eating rice;
|
||||
line-height: string cheese;
|
||||
line-height: a b c string me d e f;
|
||||
line-height: string world;
|
||||
}
|
||||
.class {
|
||||
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png');
|
||||
}
|
17
sites/all/libraries/lessphp/tests/outputs/font_family.css
Normal file
17
sites/all/libraries/lessphp/tests/outputs/font_family.css
Normal file
@@ -0,0 +1,17 @@
|
||||
@font-face {
|
||||
font-family: Graublau Sans Web;
|
||||
src: url(fonts/GraublauWeb.otf) format("opentype");
|
||||
}
|
||||
@font-face {
|
||||
font-family: Gentium;
|
||||
src: url('fonts/Gentium.ttf');
|
||||
}
|
||||
@font-face {
|
||||
font-family: Gentium;
|
||||
src: url("fonts/GentiumItalic.ttf");
|
||||
font-style: italic;
|
||||
}
|
||||
h2 {
|
||||
font-family: Gentium;
|
||||
crazy: maroon;
|
||||
}
|
27
sites/all/libraries/lessphp/tests/outputs/guards.css
Normal file
27
sites/all/libraries/lessphp/tests/outputs/guards.css
Normal file
@@ -0,0 +1,27 @@
|
||||
dd {
|
||||
color: yellow;
|
||||
}
|
||||
b {
|
||||
color: red;
|
||||
color: blue;
|
||||
color: blue;
|
||||
}
|
||||
img {
|
||||
color: green;
|
||||
color: teal;
|
||||
}
|
||||
body {
|
||||
color: purple;
|
||||
color: silver;
|
||||
color: purple;
|
||||
}
|
||||
div {
|
||||
color: blue;
|
||||
}
|
||||
link {
|
||||
color: true red;
|
||||
color: true #fff;
|
||||
color: true #fffddd;
|
||||
color: true #000000;
|
||||
color: true rgba(0,0,0,0.34);
|
||||
}
|
4
sites/all/libraries/lessphp/tests/outputs/hacks.css
Normal file
4
sites/all/libraries/lessphp/tests/outputs/hacks.css
Normal file
@@ -0,0 +1,4 @@
|
||||
:root .alert-message,
|
||||
:root .btn {
|
||||
border-radius: 0 \0;
|
||||
}
|
3
sites/all/libraries/lessphp/tests/outputs/hi.css
Normal file
3
sites/all/libraries/lessphp/tests/outputs/hi.css
Normal file
@@ -0,0 +1,3 @@
|
||||
div:before {
|
||||
content: "hi!";
|
||||
}
|
9
sites/all/libraries/lessphp/tests/outputs/ie.css
Normal file
9
sites/all/libraries/lessphp/tests/outputs/ie.css
Normal file
@@ -0,0 +1,9 @@
|
||||
foo {
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr=#c0ff3300,endColorstr=#ff000000);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr=#c0ff3300,endColorstr=#ff000000);
|
||||
}
|
||||
foo {
|
||||
filter: alpha(opacity=20);
|
||||
filter: alpha(opacity=20,enabled=true);
|
||||
filter: blaznicate(foo=bar,baz=bang bip,bart=#fa4600);
|
||||
}
|
61
sites/all/libraries/lessphp/tests/outputs/import.css
vendored
Normal file
61
sites/all/libraries/lessphp/tests/outputs/import.css
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
@import "not-found";
|
||||
@import "something.css" media;
|
||||
@import url("something.css") media;
|
||||
@import url(something.css) media, screen, print;
|
||||
b {
|
||||
color: maroon;
|
||||
padding: 16px;
|
||||
}
|
||||
body {
|
||||
line-height: 10em;
|
||||
}
|
||||
body div.bright {
|
||||
color: red;
|
||||
}
|
||||
body div.sad {
|
||||
color: blue;
|
||||
}
|
||||
div b {
|
||||
color: fuchsia;
|
||||
padding: 16px;
|
||||
}
|
||||
.one {
|
||||
color: blue;
|
||||
}
|
||||
.one h2 {
|
||||
background: url("../images/logo.png") no-repeat;
|
||||
}
|
||||
.two h2 {
|
||||
background: url("../images/logo.png") no-repeat;
|
||||
}
|
||||
#merge-import-mixins .just-a-class {
|
||||
background: red;
|
||||
}
|
||||
#merge-import-mixins .just-a-class {
|
||||
background: blue;
|
||||
}
|
||||
#merge-import-mixins .hello {
|
||||
height: 200px;
|
||||
}
|
||||
@media cool {
|
||||
#merge-import-mixins {
|
||||
color: red;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
#merge-import-mixins div {
|
||||
background: red;
|
||||
background: blue;
|
||||
}
|
||||
.inner {
|
||||
content: "inner/file1.less";
|
||||
}
|
||||
.inner {
|
||||
content: "inner/file2.less";
|
||||
}
|
||||
pre {
|
||||
color: hello-from-file-3;
|
||||
}
|
||||
h2 {
|
||||
background: url("../images/logo.png") no-repeat;
|
||||
}
|
48
sites/all/libraries/lessphp/tests/outputs/keyframes.css
Normal file
48
sites/all/libraries/lessphp/tests/outputs/keyframes.css
Normal file
@@ -0,0 +1,48 @@
|
||||
@keyframes 'bounce' {
|
||||
from {
|
||||
top: 100px;
|
||||
animation-timing-function: ease-out;
|
||||
}
|
||||
25% {
|
||||
top: 50px;
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
50% {
|
||||
top: 100px;
|
||||
animation-timing-function: ease-out;
|
||||
}
|
||||
75% {
|
||||
top: 75px;
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
to {
|
||||
top: 100px;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes flowouttoleft {
|
||||
0% {
|
||||
-webkit-transform: translateX(0) scale(1);
|
||||
}
|
||||
60%,
|
||||
70% {
|
||||
-webkit-transform: translateX(0) scale(.7);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateX(-100%) scale(.7);
|
||||
}
|
||||
}
|
||||
div {
|
||||
animation-name: 'diagonal-slide';
|
||||
animation-duration: 5s;
|
||||
animation-iteration-count: 10;
|
||||
}
|
||||
@keyframes 'diagonal-slide' {
|
||||
from {
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
to {
|
||||
left: 100px;
|
||||
top: 100px;
|
||||
}
|
||||
}
|
69
sites/all/libraries/lessphp/tests/outputs/math.css
Normal file
69
sites/all/libraries/lessphp/tests/outputs/math.css
Normal file
@@ -0,0 +1,69 @@
|
||||
.unary {
|
||||
sub: 10 -5;
|
||||
}
|
||||
.spaces {
|
||||
sub: 5;
|
||||
sub: 5;
|
||||
add: 15;
|
||||
add: 15;
|
||||
div: 2;
|
||||
mul: 50;
|
||||
mul: 50;
|
||||
}
|
||||
.supress-division {
|
||||
border-radius: 10px/10px;
|
||||
border-radius: 10px/10px;
|
||||
border-radius: hello(10px/10px) world;
|
||||
font: 10px/30 sans-serif;
|
||||
font: 10px/20px sans-serif;
|
||||
font: 10px/20px sans-serif;
|
||||
border-radius: 0 15px 15px 15px/0 50% 50% 50%;
|
||||
}
|
||||
.parens {
|
||||
sub: 5;
|
||||
add: 15;
|
||||
div: 2;
|
||||
div: 2;
|
||||
mul: 50;
|
||||
}
|
||||
.keyword-names {
|
||||
height: "hello" 25;
|
||||
}
|
||||
.negation {
|
||||
hello: -1px;
|
||||
hello: -1px;
|
||||
hello: -10;
|
||||
}
|
||||
.test {
|
||||
single: 5;
|
||||
single: 10;
|
||||
single: 10;
|
||||
parens: 10 -2;
|
||||
math: 20;
|
||||
math: 20;
|
||||
width: 71;
|
||||
height: 6;
|
||||
padding: 6px 1em 2px 2;
|
||||
padding: 8 4 4 4px;
|
||||
width: 96;
|
||||
height: 113;
|
||||
margin: 12;
|
||||
}
|
||||
.percents {
|
||||
color: 1000%;
|
||||
color: 1000%;
|
||||
color: 100%;
|
||||
color: 1000px;
|
||||
color: 1000%;
|
||||
color: 30%;
|
||||
color: 10%;
|
||||
color: 2%;
|
||||
}
|
||||
.misc {
|
||||
x: 40px;
|
||||
y: 40em;
|
||||
}
|
||||
.cond {
|
||||
y: false;
|
||||
y: true;
|
||||
}
|
65
sites/all/libraries/lessphp/tests/outputs/media.css
Normal file
65
sites/all/libraries/lessphp/tests/outputs/media.css
Normal file
@@ -0,0 +1,65 @@
|
||||
@media screen,3D {
|
||||
P {
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
@media print {
|
||||
body {
|
||||
font-size: 10pt;
|
||||
}
|
||||
}
|
||||
@media screen {
|
||||
body {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
@media screen,print {
|
||||
body {
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
@media all and (min-width: 0px) {
|
||||
body {
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
@media all and (min-width: 0) {
|
||||
body {
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 102.5em) and (max-width: 117.9375em),screen and (min-width: 150em) {
|
||||
body {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
@media screen and (min-height: 110px) {
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
@media screen and (height: 100px) and (width: 110px),(size: 120px) {
|
||||
body {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
@media test {
|
||||
div {
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
@media test and (hello) {
|
||||
div {
|
||||
color: red;
|
||||
}
|
||||
div pre {
|
||||
color: orange;
|
||||
}
|
||||
}
|
||||
@media yeah {
|
||||
@page {
|
||||
@media cool {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
63
sites/all/libraries/lessphp/tests/outputs/misc.css
Normal file
63
sites/all/libraries/lessphp/tests/outputs/misc.css
Normal file
@@ -0,0 +1,63 @@
|
||||
color: "aaa, bbb";
|
||||
.topbar {
|
||||
background: url(/assets/images/test/topbar.png);
|
||||
}
|
||||
.hello {
|
||||
test: empty-function("/assets/images/test/",40%,to(#fff));
|
||||
}
|
||||
.css3 {
|
||||
background-image: -webkit-gradient(linear,0% 0%,0% 90%,from(#E9A000),to(#A37000));
|
||||
}
|
||||
.test,
|
||||
.world {
|
||||
border: 1px solid red;
|
||||
color: url(http://mage-page.com);
|
||||
string: "hello /* this is not a comment */";
|
||||
world: "// neither is this";
|
||||
string: 'hello /* this is not a comment */';
|
||||
world: '// neither is this';
|
||||
what-ever: 100px;
|
||||
background: url(/*no comment here*/);
|
||||
}
|
||||
.urls {
|
||||
background: url("http://google.com");
|
||||
background: url(http://google.com);
|
||||
background: url("http://google.com");
|
||||
}
|
||||
.cool {
|
||||
color: "aaa, bbb";
|
||||
}
|
||||
.span-17 {
|
||||
float: left;
|
||||
}
|
||||
.span-17 {
|
||||
width: 660px;
|
||||
}
|
||||
.x {
|
||||
float: left;
|
||||
width: 660px;
|
||||
}
|
||||
.hi pre {
|
||||
color: red;
|
||||
}
|
||||
.hi pre {
|
||||
color: blue;
|
||||
}
|
||||
.rad pre {
|
||||
color: red;
|
||||
}
|
||||
.rad pre {
|
||||
color: blue;
|
||||
}
|
||||
hello {
|
||||
numbers: 1.0 0.1 .1 1.;
|
||||
numbers: 1.0s 0.1s .1s 1.s;
|
||||
numbers: -1s -0.1s -0.1s -1s;
|
||||
numbers: -1 -0.1 -0.1 -1;
|
||||
}
|
||||
#string {
|
||||
hello: 'what\'s going on here';
|
||||
hello: 'blah blag @{ blah blah';
|
||||
join: "3434hello";
|
||||
join: 3434hello;
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
body {
|
||||
padding: 2.0em;
|
||||
color: red;
|
||||
margin: 10px;
|
||||
height: 12px;
|
||||
border-bottom: 1px solid green;
|
||||
}
|
||||
.skip_args {
|
||||
margin: 22px;
|
||||
height: 12px;
|
||||
padding: 10px 20px 30px 88px;
|
||||
margin: 4px 12px 2px 1px;
|
||||
color: red;
|
||||
}
|
42
sites/all/libraries/lessphp/tests/outputs/mixin_merging.css
Normal file
42
sites/all/libraries/lessphp/tests/outputs/mixin_merging.css
Normal file
@@ -0,0 +1,42 @@
|
||||
#test1 div {
|
||||
color:red;
|
||||
height:10px;
|
||||
}
|
||||
#test1 p { height:10px; }
|
||||
#test2 b {
|
||||
color:red;
|
||||
width:1px;
|
||||
}
|
||||
#test2 a, #test2 i { width:1px; }
|
||||
#test3 a, #test3 i { width:1px; }
|
||||
#test3 b {
|
||||
width:1px;
|
||||
color:red;
|
||||
}
|
||||
#test4 a {
|
||||
color:blue;
|
||||
margin:1px;
|
||||
}
|
||||
#test4 div, #test4 html { color:blue; }
|
||||
#test5 img, #test5 strong {
|
||||
padding:2px;
|
||||
float:right;
|
||||
}
|
||||
#test6 div a, #test6 span a {
|
||||
line-height:10px;
|
||||
color:red;
|
||||
}
|
||||
#test7 div strong {
|
||||
margin:1px;
|
||||
color:red;
|
||||
}
|
||||
#test7 div b { color:red; }
|
||||
#test7 span strong, #test7 span b { color:red; }
|
||||
#test8 a i, #test8 b i {
|
||||
background:red;
|
||||
color:red;
|
||||
}
|
||||
#test8 a s, #test8 b s {
|
||||
background:red;
|
||||
color:blue;
|
||||
}
|
83
sites/all/libraries/lessphp/tests/outputs/mixins.css
Normal file
83
sites/all/libraries/lessphp/tests/outputs/mixins.css
Normal file
@@ -0,0 +1,83 @@
|
||||
.bold {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
body #window {
|
||||
border-radius: 10px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 30px;
|
||||
}
|
||||
#bundle .button {
|
||||
display: block;
|
||||
border: 1px solid black;
|
||||
background-color: grey;
|
||||
}
|
||||
#bundle .button:hover {
|
||||
background-color: white;
|
||||
}
|
||||
#header a {
|
||||
color: orange;
|
||||
display: block;
|
||||
border: 1px solid black;
|
||||
background-color: grey;
|
||||
}
|
||||
#header a:hover {
|
||||
background-color: white;
|
||||
}
|
||||
div {
|
||||
color: blue;
|
||||
hello: world;
|
||||
}
|
||||
div b {
|
||||
color: blue;
|
||||
}
|
||||
body {
|
||||
color: blue;
|
||||
hello: world;
|
||||
}
|
||||
body b {
|
||||
color: blue;
|
||||
}
|
||||
.hello .world {
|
||||
color: blue;
|
||||
}
|
||||
.foobar {
|
||||
color: blue;
|
||||
}
|
||||
.eggs {
|
||||
foo: 1px 2px;
|
||||
bar: 1px 2px;
|
||||
foo: 100 land;
|
||||
bar: 100 land;
|
||||
}
|
||||
#hello {
|
||||
cool: one two three cool;
|
||||
}
|
||||
#hello-important {
|
||||
cool: one two three cool !important;
|
||||
}
|
||||
#world {
|
||||
cool: "world";
|
||||
}
|
||||
#another {
|
||||
things: red blue green;
|
||||
things: red blue green skip me;
|
||||
}
|
||||
#day .cool {
|
||||
color: one two three;
|
||||
}
|
||||
#day .cool {
|
||||
color: one two three skip me;
|
||||
}
|
||||
.mix-suffix {
|
||||
color: red !important;
|
||||
height: 20px !important;
|
||||
}
|
||||
.mix-suffix pre {
|
||||
color: red;
|
||||
}
|
||||
.search-test {
|
||||
color: #f00 !important;
|
||||
color: #0f0 !important;
|
||||
}
|
51
sites/all/libraries/lessphp/tests/outputs/nested.css
Normal file
51
sites/all/libraries/lessphp/tests/outputs/nested.css
Normal file
@@ -0,0 +1,51 @@
|
||||
#header {
|
||||
color: black;
|
||||
}
|
||||
#header .navigation {
|
||||
font-size: 12px;
|
||||
}
|
||||
#header .navigation .border .outside {
|
||||
color: blue;
|
||||
}
|
||||
#header .logo {
|
||||
width: 300px;
|
||||
}
|
||||
#header .logo:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
a b ul li {
|
||||
color: green;
|
||||
}
|
||||
div .cool {
|
||||
color: green;
|
||||
}
|
||||
p .cool span {
|
||||
color: yellow;
|
||||
}
|
||||
div another {
|
||||
color: green;
|
||||
}
|
||||
p another span {
|
||||
color: yellow;
|
||||
}
|
||||
b .something {
|
||||
color: blue;
|
||||
}
|
||||
b.something {
|
||||
color: blue;
|
||||
}
|
||||
.foo .bar .qux,
|
||||
.foo .baz .qux {
|
||||
display: block;
|
||||
}
|
||||
.qux .foo .bar,
|
||||
.qux .foo .baz {
|
||||
display: inline;
|
||||
}
|
||||
.qux .foo .bar .biz,
|
||||
.qux .foo .baz .biz {
|
||||
display: none;
|
||||
}
|
||||
b hello [x="&yeah"] {
|
||||
color: red;
|
||||
}
|
6
sites/all/libraries/lessphp/tests/outputs/nesting.css
Normal file
6
sites/all/libraries/lessphp/tests/outputs/nesting.css
Normal file
@@ -0,0 +1,6 @@
|
||||
#header .navigation .border .outside { color:blue; }
|
||||
#header .navigation { font-size:12px; }
|
||||
#header .logo:hover { text-decoration:none; }
|
||||
#header .logo { width:300px; }
|
||||
#header { color:black; }
|
||||
a b ul li { color:green; }
|
@@ -0,0 +1,72 @@
|
||||
.class {
|
||||
color: #a2a2a2;
|
||||
display: block;
|
||||
}
|
||||
.zero {
|
||||
zero: 0;
|
||||
one: 1;
|
||||
two: 2;
|
||||
three: 3;
|
||||
}
|
||||
.one {
|
||||
one: 1;
|
||||
one-req: 1;
|
||||
two: 2;
|
||||
three: 3;
|
||||
}
|
||||
.two {
|
||||
two: 2;
|
||||
three: 3;
|
||||
}
|
||||
.three {
|
||||
three-req: 3;
|
||||
three: 3;
|
||||
}
|
||||
.left {
|
||||
left: 1;
|
||||
}
|
||||
.right {
|
||||
right: 1;
|
||||
}
|
||||
.border-right {
|
||||
color: black;
|
||||
border-right: 4px;
|
||||
}
|
||||
.border-left {
|
||||
color: black;
|
||||
border-left: 4px;
|
||||
}
|
||||
.only-right {
|
||||
right: 33;
|
||||
}
|
||||
.only-left {
|
||||
left: 33;
|
||||
}
|
||||
.left-right {
|
||||
both: 330;
|
||||
}
|
||||
#hola {
|
||||
color: blue;
|
||||
}
|
||||
#defaults_1 {
|
||||
height: one;
|
||||
height: two;
|
||||
height: three;
|
||||
height: four;
|
||||
}
|
||||
.thing {
|
||||
color: red;
|
||||
}
|
||||
#aa {
|
||||
color: green;
|
||||
color: blue;
|
||||
color: red;
|
||||
}
|
||||
#bb {
|
||||
color: green;
|
||||
color: blue;
|
||||
color: red;
|
||||
}
|
||||
#cc {
|
||||
color: blue;
|
||||
}
|
11
sites/all/libraries/lessphp/tests/outputs/scopes.css
Normal file
11
sites/all/libraries/lessphp/tests/outputs/scopes.css
Normal file
@@ -0,0 +1,11 @@
|
||||
body div other world {
|
||||
height: 50;
|
||||
}
|
||||
div other world {
|
||||
height: 50;
|
||||
}
|
||||
pre {
|
||||
height: 10;
|
||||
height: 11;
|
||||
height: 12;
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
something blue,
|
||||
world {
|
||||
color: blue;
|
||||
}
|
||||
.div 3434 {
|
||||
height: 100px;
|
||||
}
|
||||
.div cool red {
|
||||
height: 4000px;
|
||||
}
|
||||
.span5 {
|
||||
color: 15;
|
||||
}
|
||||
.span4 {
|
||||
color: 14;
|
||||
}
|
||||
.span3 {
|
||||
color: 13;
|
||||
}
|
||||
.span2 {
|
||||
color: 12;
|
||||
}
|
||||
.span1 {
|
||||
color: 11;
|
||||
}
|
76
sites/all/libraries/lessphp/tests/outputs/site_demos.css
Normal file
76
sites/all/libraries/lessphp/tests/outputs/site_demos.css
Normal file
@@ -0,0 +1,76 @@
|
||||
default .underline {
|
||||
border-bottom: 1px solid green;
|
||||
}
|
||||
default #header {
|
||||
color: black;
|
||||
border: 1px solid #dd44dd;
|
||||
}
|
||||
default #header .navigation {
|
||||
font-size: 12px;
|
||||
}
|
||||
default #header .navigation a {
|
||||
border-bottom: 1px solid green;
|
||||
}
|
||||
default #header .logo {
|
||||
width: 300px;
|
||||
}
|
||||
default #header .logo:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
variables .variables {
|
||||
width: 14cm;
|
||||
height: 24px;
|
||||
color: #888;
|
||||
background: #6c94be;
|
||||
font-family: "Trebuchet MS", Verdana, sans-serif;
|
||||
}
|
||||
mixins .bordered {
|
||||
border-top: dotted 1px black;
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
mixins #menu a {
|
||||
color: #111;
|
||||
border-top: dotted 1px black;
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
mixins .post a {
|
||||
color: red;
|
||||
border-top: dotted 1px black;
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
nested-rules #header {
|
||||
color: black;
|
||||
}
|
||||
nested-rules #header .navigation {
|
||||
font-size: 12px;
|
||||
}
|
||||
nested-rules #header .logo {
|
||||
width: 300px;
|
||||
}
|
||||
nested-rules #header .logo:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
namespaces #bundle .button {
|
||||
display: block;
|
||||
border: 1px solid black;
|
||||
background-color: grey;
|
||||
}
|
||||
namespaces #bundle .button:hover {
|
||||
background-color: white;
|
||||
}
|
||||
namespaces #header a {
|
||||
color: orange;
|
||||
display: block;
|
||||
border: 1px solid black;
|
||||
background-color: grey;
|
||||
}
|
||||
namespaces #header a:hover {
|
||||
background-color: white;
|
||||
}
|
||||
mixin-functions body {
|
||||
padding: 2.0em;
|
||||
color: red;
|
||||
margin: 10px;
|
||||
height: 12px;
|
||||
border-bottom: 1px solid green;
|
||||
}
|
20
sites/all/libraries/lessphp/tests/outputs/variables.css
Normal file
20
sites/all/libraries/lessphp/tests/outputs/variables.css
Normal file
@@ -0,0 +1,20 @@
|
||||
color: 44px;
|
||||
color: 44px;
|
||||
.variables {
|
||||
width: 14cm;
|
||||
height: 24px;
|
||||
margin-top: -20px;
|
||||
margin-bottom: 30px;
|
||||
color: #888899;
|
||||
background: #6c94be;
|
||||
font-family: "Trebuchet MS", Verdana, sans-serif;
|
||||
margin: 3px;
|
||||
font: 10px/12px serif;
|
||||
font: 120%/120% serif;
|
||||
}
|
||||
.external {
|
||||
color: #888;
|
||||
border: 1px solid #3326cc;
|
||||
background: rgba(23,68,149,0.5);
|
||||
padding: 4px;
|
||||
}
|
57
sites/all/libraries/lessphp/tests/sort.php
Normal file
57
sites/all/libraries/lessphp/tests/sort.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require realpath(dirname(__FILE__)).'/../lessc.inc.php';
|
||||
|
||||
// sorts the selectors in stylesheet in order to normalize it for comparison
|
||||
|
||||
$exe = array_shift($argv); // remove filename
|
||||
|
||||
if (!$fname = array_shift($argv)) {
|
||||
$fname = "php://stdin";
|
||||
}
|
||||
|
||||
class lesscNormalized extends lessc {
|
||||
public $numberPrecision = 3;
|
||||
|
||||
public function compileValue($value) {
|
||||
if ($value[0] == "raw_color") {
|
||||
$value = $this->coerceColor($value);
|
||||
}
|
||||
|
||||
return parent::compileValue($value);
|
||||
}
|
||||
}
|
||||
|
||||
class SortingFormatter extends lessc_formatter_lessjs {
|
||||
function sortKey($block) {
|
||||
if (!isset($block->sortKey)) {
|
||||
sort($block->selectors, SORT_STRING);
|
||||
$block->sortKey = implode(",", $block->selectors);
|
||||
}
|
||||
|
||||
return $block->sortKey;
|
||||
}
|
||||
|
||||
function sortBlock($block) {
|
||||
usort($block->children, function($a, $b) {
|
||||
$sort = strcmp($this->sortKey($a), $this->sortKey($b));
|
||||
if ($sort == 0) {
|
||||
// TODO
|
||||
}
|
||||
return $sort;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function block($block) {
|
||||
$this->sortBlock($block);
|
||||
return parent::block($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$less = new lesscNormalized();
|
||||
$less->setFormatter(new SortingFormatter);
|
||||
echo $less->parse(file_get_contents($fname));
|
||||
|
Reference in New Issue
Block a user