Skip to content

Commit

Permalink
Merge pull request #73 from nextcloud/scssphp-0.7.2
Browse files Browse the repository at this point in the history
Upgrade leafo/scssphp to 0.7.2
  • Loading branch information
MorrisJobke committed Dec 18, 2017
2 parents f4e328b + 6404924 commit 696f768
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 557 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,5 @@ paragonie/random_compat/.scrutinizer.yml
paragonie/random_compat/ERRATA.md
paragonie/random_compat/README.md
paragonie/random_compat/SECURITY.md

leafo/scssphp/example
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"symfony/polyfill-php70": "^1.0",
"lukasreschke/id3parser": "^0.0.1",
"stecman/symfony-console-completion": "^0.7.0",
"leafo/scssphp": "^0.6.6",
"leafo/scssphp": "^0.7.2",
"icewind/searchdav": "0.3.1",
"symfony/translation": "^3.3",
"aws/aws-sdk-php": "^3.35"
Expand Down
15 changes: 7 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,6 @@
'Leafo\\ScssPhp\\Node' => $vendorDir . '/leafo/scssphp/src/Node.php',
'Leafo\\ScssPhp\\Node\\Number' => $vendorDir . '/leafo/scssphp/src/Node/Number.php',
'Leafo\\ScssPhp\\Parser' => $vendorDir . '/leafo/scssphp/src/Parser.php',
'Leafo\\ScssPhp\\Server' => $vendorDir . '/leafo/scssphp/src/Server.php',
'Leafo\\ScssPhp\\Type' => $vendorDir . '/leafo/scssphp/src/Type.php',
'Leafo\\ScssPhp\\Util' => $vendorDir . '/leafo/scssphp/src/Util.php',
'Leafo\\ScssPhp\\Version' => $vendorDir . '/leafo/scssphp/src/Version.php',
Expand Down
1 change: 0 additions & 1 deletion composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,6 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
'Leafo\\ScssPhp\\Node' => __DIR__ . '/..' . '/leafo/scssphp/src/Node.php',
'Leafo\\ScssPhp\\Node\\Number' => __DIR__ . '/..' . '/leafo/scssphp/src/Node/Number.php',
'Leafo\\ScssPhp\\Parser' => __DIR__ . '/..' . '/leafo/scssphp/src/Parser.php',
'Leafo\\ScssPhp\\Server' => __DIR__ . '/..' . '/leafo/scssphp/src/Server.php',
'Leafo\\ScssPhp\\Type' => __DIR__ . '/..' . '/leafo/scssphp/src/Type.php',
'Leafo\\ScssPhp\\Util' => __DIR__ . '/..' . '/leafo/scssphp/src/Util.php',
'Leafo\\ScssPhp\\Version' => __DIR__ . '/..' . '/leafo/scssphp/src/Version.php',
Expand Down
109 changes: 54 additions & 55 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2164,61 +2164,6 @@
],
"description": "Minimal set of PEAR core files to be used as composer dependency"
},
{
"name": "leafo/scssphp",
"version": "v0.6.7",
"version_normalized": "0.6.7.0",
"source": {
"type": "git",
"url": "https://github.com/leafo/scssphp.git",
"reference": "562213cd803e42ea53b0735554794c4022d8db89"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/leafo/scssphp/zipball/562213cd803e42ea53b0735554794c4022d8db89",
"reference": "562213cd803e42ea53b0735554794c4022d8db89",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"kherge/box": "~2.5",
"phpunit/phpunit": "~3.7",
"squizlabs/php_codesniffer": "~2.5"
},
"time": "2017-02-23T05:07:33+00:00",
"bin": [
"bin/pscss"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Leafo\\ScssPhp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Leaf Corcoran",
"email": "leafot@gmail.com",
"homepage": "http://leafo.net"
}
],
"description": "scssphp is a compiler for SCSS written in PHP.",
"homepage": "http://leafo.github.io/scssphp/",
"keywords": [
"css",
"less",
"sass",
"scss",
"stylesheet"
]
},
{
"name": "mikemccabe/json-patch-php",
"version": "0.1.0",
Expand Down Expand Up @@ -3466,5 +3411,59 @@
"support": {
"source": "https://github.com/icewind1991/dbal/tree/2.5-pg10"
}
},
{
"name": "leafo/scssphp",
"version": "v0.7.2",
"version_normalized": "0.7.2.0",
"source": {
"type": "git",
"url": "https://github.com/leafo/scssphp.git",
"reference": "4f605a51462c85cf6df5bb45460483a138e04025"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/leafo/scssphp/zipball/4f605a51462c85cf6df5bb45460483a138e04025",
"reference": "4f605a51462c85cf6df5bb45460483a138e04025",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.6",
"squizlabs/php_codesniffer": "~2.5"
},
"time": "2017-10-14T21:35:01+00:00",
"bin": [
"bin/pscss"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Leafo\\ScssPhp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Leaf Corcoran",
"email": "leafot@gmail.com",
"homepage": "http://leafo.net"
}
],
"description": "scssphp is a compiler for SCSS written in PHP.",
"homepage": "http://leafo.github.io/scssphp/",
"keywords": [
"css",
"less",
"sass",
"scss",
"stylesheet"
]
}
]
4 changes: 1 addition & 3 deletions leafo/scssphp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "~2.5",
"phpunit/phpunit": "~3.7",
"kherge/box": "~2.5"
"phpunit/phpunit": "~4.6"
},
"bin": ["bin/pscss"],
"archive": {
Expand All @@ -35,7 +34,6 @@
"/.gitattributes",
"/.gitignore",
"/.travis.yml",
"/box.json.dist",
"/phpunit.xml.dist",
"/tests"
]
Expand Down
3 changes: 1 addition & 2 deletions leafo/scssphp/scss.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
throw new \Exception('scssphp requires PHP 5.4 or above');
}

if (! class_exists('scssc', false)) {
if (! class_exists('Leafo\ScssPhp\Version', false)) {
include_once __DIR__ . '/src/Base/Range.php';
include_once __DIR__ . '/src/Block.php';
include_once __DIR__ . '/src/Colors.php';
Expand All @@ -26,5 +26,4 @@
include_once __DIR__ . '/src/Type.php';
include_once __DIR__ . '/src/Util.php';
include_once __DIR__ . '/src/Version.php';
include_once __DIR__ . '/src/Server.php';
}
32 changes: 15 additions & 17 deletions leafo/scssphp/src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ public function __construct()
*/
public function compile($code, $path = null)
{
$locale = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, 'C');

$this->indentLevel = -1;
$this->commentsSeen = [];
$this->extends = [];
Expand Down Expand Up @@ -196,8 +193,6 @@ public function compile($code, $path = null)

$out = $this->formatter->format($this->scope);

setlocale(LC_NUMERIC, $locale);

return $out;
}

Expand Down Expand Up @@ -1181,7 +1176,7 @@ protected function flattenSelectorSingle($single)
/**
* Compile selector to string; self(&) should have been replaced by now
*
* @param array $selector
* @param string|array $selector
*
* @return string
*/
Expand All @@ -1203,7 +1198,7 @@ protected function compileSelector($selector)
/**
* Compile selector part
*
* @param arary $piece
* @param array $piece
*
* @return string
*/
Expand Down Expand Up @@ -1963,7 +1958,7 @@ protected function shouldEval($value)
* @param array $value
* @param boolean $inExp
*
* @return array
* @return array|\Leafo\ScssPhp\Node\Number
*/
protected function reduce($value, $inExp = false)
{
Expand Down Expand Up @@ -2238,7 +2233,7 @@ public function normalizeValue($value)
* @param array $left
* @param array $right
*
* @return array
* @return \Leafo\ScssPhp\Node\Number
*/
protected function opAddNumberNumber($left, $right)
{
Expand All @@ -2251,7 +2246,7 @@ protected function opAddNumberNumber($left, $right)
* @param array $left
* @param array $right
*
* @return array
* @return \Leafo\ScssPhp\Node\Number
*/
protected function opMulNumberNumber($left, $right)
{
Expand All @@ -2264,7 +2259,7 @@ protected function opMulNumberNumber($left, $right)
* @param array $left
* @param array $right
*
* @return array
* @return \Leafo\ScssPhp\Node\Number
*/
protected function opSubNumberNumber($left, $right)
{
Expand All @@ -2277,7 +2272,7 @@ protected function opSubNumberNumber($left, $right)
* @param array $left
* @param array $right
*
* @return array
* @return array|\Leafo\ScssPhp\Node\Number
*/
protected function opDivNumberNumber($left, $right)
{
Expand All @@ -2294,7 +2289,7 @@ protected function opDivNumberNumber($left, $right)
* @param array $left
* @param array $right
*
* @return array
* @return \Leafo\ScssPhp\Node\Number
*/
protected function opModNumberNumber($left, $right)
{
Expand Down Expand Up @@ -2580,7 +2575,7 @@ protected function opLtNumberNumber($left, $right)
* @param array $left
* @param array $right
*
* @return array
* @return \Leafo\ScssPhp\Node\Number
*/
protected function opCmpNumberNumber($left, $right)
{
Expand Down Expand Up @@ -3505,7 +3500,7 @@ protected function fileExists($name)
* Call SCSS @function
*
* @param string $name
* @param array $args
* @param array $argValues
* @param array $returnValue
*
* @return boolean Returns true if returnValue is set; otherwise, false
Expand Down Expand Up @@ -3777,7 +3772,7 @@ protected function applyArguments($argDef, $argValues)
*
* @param mixed $value
*
* @return array
* @return array|\Leafo\ScssPhp\Node\Number
*/
private function coerceValue($value)
{
Expand Down Expand Up @@ -3850,7 +3845,8 @@ protected function coerceMap($item)
/**
* Coerce something to list
*
* @param array $item
* @param array $item
* @param string $delim
*
* @return array
*/
Expand Down Expand Up @@ -5210,6 +5206,8 @@ protected function libVariableExists($args)
* Workaround IE7's content counter bug.
*
* @param array $args
*
* @return array
*/
protected function libCounter($args)
{
Expand Down
9 changes: 5 additions & 4 deletions leafo/scssphp/src/Node/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Number extends Node implements \ArrayAccess
/**
* @var integer
*/
static public $precision = 5;
static public $precision = 10;

/**
* @see http://www.w3.org/TR/2012/WD-css3-values-20120308/
Expand Down Expand Up @@ -290,9 +290,10 @@ public function output(Compiler $compiler = null)
}

reset($units);
list($unit, ) = each($units);

return (string) $dimension . $unit;
$unit = key($units);
$dimension = number_format($dimension, static::$precision, '.', '');

return (static::$precision ? rtrim(rtrim($dimension, '0'), '.') : $dimension) . $unit;
}

/**
Expand Down

0 comments on commit 696f768

Please sign in to comment.