at-import / sassy-strings Goto Github PK
View Code? Open in Web Editor NEWAdvanced string handling for Sass
Advanced string handling for Sass
Sorry guys for posting this question here. Maybe some sass pro had a solution for this.
Is it possible to pares css comments with sass and interpolate variables?
$background-color: #FFF;
// comment dummy #{$background-color} interpolation
- or -
/* comment dummy #{$background-color} interpolation */
result:
// comment dummy #FFF interpolation
Hello, have this package some licence? Thanx
Has this gem been pushed to rubygems.org?
Tried installing it:
$ gem install SassyStrings
ERROR: Could not find a valid gem 'SassyStrings' (>= 0) in any repository
ERROR: Possible alternatives: sassy-strings
And sassy-strings is @Snugug's old version from August 2013, not the @team-sass version.
Could str-split
be reworked to accept a param to split it at a certain character? (like javascript?)
str-split('foo.bar', '.')
=> (foo, bar)
Don't remember why I wrote it this way instead of as a recursive function, but something to look at.
@function str-replace($string, $search, $replace) {
$length: str-length($replace);
$index: str-index($string, $search);
$slice: $string;
@while $index != 0 {
$slice: str-slice($slice, 0, $index - 1);
$slice: $slice + $replace;
$slice: $slice + str-slice($string, $index + $length);
$index: str-index($slice, $search);
}
@return $slice;
}
str-count-chars
str-capitalize
str-compare
Hello!
The str-index()
function is improperly used : it should be testing for "null", as per Sass Reference, since we are querying for the position of the first occurrence and not a count of the number of occurrences.
@if str-index($new, $old) != null {
// ...
}
and
@if $index != null and $new != $old {
// ...
}
Cheers,
Being able to provide a match
function to check wether a string matches a certain regular expression would be quite cool.
Although coding this in pure Sass would be crazy. What about a Ruby function for this one?
On Sass 3.4 I'm getting the following error, any idea if this is caused by this gem ?
Errno::ENOENT on line ["670"] of /Users/anahkiasen/.rvm/gems/ruby-2.1.2@madewithlove/gems/sass-3.4.2/lib/sass/util.rb: No such file or directory @ realpath_rec - /Users/anahkiasen/.rvm/gems/ruby-2.1.2@madewithlove/gems/sassy-strings-1.0.0/stylesheets
Run with --trace to see the full backtrace
Your gemfile: gem 'sassy-strings', '0.4.0'
but you're at 1.0.0 right?
Is having the ability to trim left / right or both worth adding it?
$shortName: str-replace($font, ' ', '');
Error:
WARNING: The string to be replaced is contained in the new string. Infinite recursion avoided.
' ' to '' ?
Also
$shortName: str-replace($font, 'a', 'b');
Same!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.