Bootstrap 3.3.1 carousel animation not working with LESS - twitter-bootstrap-3

I am working on a Bootstrap template that I am building on the Bootstrap 3.3.1 LESS files compiled on the go (as a temporary solution) with less.min.js. The problem is when I try to flip slides of the Bootstrap carousel they do so with no animation. Chrome Dev tools gave me this:
.carousel-inner > .item {
transition: transform 0.6s ease-in-out;
backface-visibility: hidden;
perspective: 1000;
}
As you can see there is not -webkit-transition line for some reasons.
Switching to bootstrap.css or replacing the carousel.less file with that from v3.3.0 resolves the issue. Is it a Bootstrap issue or is it something on my side?

You should run the autoprefixer (since version 3.2), also see https://github.com/twbs/bootstrap/issues/15203
Cause your are compiling client side, you can NOT run this plugin. Alternatively you can use -prefix-free.
Notice that the autoprefixer is part of TB default build process now.
Thought they were supposed to use mixins internally until v4
Yes, probably. But i seems new added code is not longer prefixed by mixins. Code that used a mixin before v3.2. already, are not replaced before v4.
You can see the above in the less/carousel.less file, that contains the following code (reflecting your issue):
// WebKit CSS3 transforms for supported devices
#media all and (transform-3d), (-webkit-transform-3d) {
transition: transform .6s ease-in-out;
backface-visibility: hidden;
perspective: 1000;

Related

Safari and duplicate property display

I'm using gulp with postcss/autoprefixer and have the browserlists list set up as a .browserslistrc file and that's all working well but when it comes to Safari and using flexbox I'm still getting this issue...
Safari then completely ignores flexbox as it seems to have an issue with the display duplication. I have the browserslist query set as Last 2 versions.
Any thoughts?
Ran into this issue myself, ended up playing around and figured out if you put the css properties in the correct order it seems to solve the problem:
display: flex;
display: -ms-flexbox;
display: -webkit-flex;

Bootstrap v3.3 has unusual line-height

The latest compiled css for Bootstrap V3.3.0 (and at least the previous version) contains some unusual syntax for the line-height in a few places. Can anyone explain it? Needless to say, it causes Resharper to spit the dummy...
input[type="month"] {
line-height: 34px;
line-height: 1.42857143 \0; <<<-- here. the '\0' is what bothers me
}
You will find it around line 2408 in the css.
Also noteworthy is the repeat definition, with and without units. What browser 'feature' does this rectify?
See this issue on GitHub and this question on SO
Its a CSS hack specific to IE, it will only apply to IE10 and under. \9 would apply to IE9 and under etc... All other browsers will ignore it and keep 34px line-height.

PhantomJS not exactly rendering Sankey diagram HTML to PNG

I'm having trouble adjusting PhantomJS to create a PNG file that matches the original browser presentation.
Here is the entire sample html file. It's a sankey diagram creating using rCharts and d3-sankey. (You'll need to save the file to your hard drive and view it from there.)
I'm running on Windows and using rasterize.js:
>> phantomjs.exe rasterize.js test.html test.png
ISSUE: Below is a snip of one of the text strings when viewed in a browser:
And here is a snip of the same string from the PNG created by PhantomJS:
How do I make the text-shadow go away? I've played around with various CSS attributes (text-shadow) and webkit-specific attributes (e.g., -webkit-text-rendering), but can't seem to make it go away.
Is this a setting in PhantomJS? in the underlying webkit? or somewhere else?
rCharts has an undocumented function called take_screenshot that uses CasperJS (which in turn uses PhantomJS to take screenshots of rCharts created visualizations on a given html page.
For example, I forked the example you provided, renamed it as a html file, which you can view here.
I ran rCharts::take_screenshot('http://rcharts.io/viewer/?7063641'), which results in the following screenshot. The take_screenshot function uses system commands, and work well on a Mac. I have not tested it on Windows, so YMMV.
NOTE: You will need to install the dev branch for this feature.
OK - I found the issue. It is related to browser display differences. SANKEY.CSS sets the text shadow:
.node text {
pointer-events: none;
text-shadow: 0 1px 0 #fff;
}
The text-shadow is ignored in Firefox (my default browser) and is properly rendered using Chrome (thanks #ramnath for cluing me into the browser differences!). PhantomJS uses webkit to render pages (which works properly) while Firefox uses gecko (which obviously doesn't implement text-shadow properly.) Fiddling with text-shadow in my original post didn't affect any changes - because Firefox wasn't rendering any changes and I was experimenting in the browser.
SO, the fix is to override .node text-shadow in my main HTML file. After the change, all is rendering as I prefer in the PhantomJS-created PNG.
.node text {
pointer-events: none;
text-shadow: 0 0px 0 #fff;
}
Lesson: to properly test HTML for rendering in PhantomJS on Windows, use Chrome to preview. Both use webkit as the underlying rendering engine.

Inlining Bootstrap SASS images with Compass

A bit about environment: we do UI build automation with Grunt, we do use Twitter Bower for managing third-party dependencies, as we don't want to keep third-party code in our repository, we use Compass for CSS extension.
Currently making a compressed version of vendor assets into single CSS file and encountered a problem, that Compass doesn't transform somehow images to inline ones while build. We want all images to be inlined into resulting CSS file with Data URL (as long as we support browsers newer than IE9 =).
Master SCSS file including Bootstrap SASS looks like
// styles/main.scss
$iconSpritePath: '../components/bootstrap-sass/img/glyphicons-halflings.png';
$iconWhiteSpritePath: '../components/bootstrap-sass/img/glyphicons-halflings-white.png';
//..
#import "../components/bootstrap-sass/lib/bootstrap";
Compass command looks like
compass compile --css-dir target/compass/styles \
--sass-dir app/styles --images-dir app/images --output-style expanded
Resulting output is like
// target/compass/styles/main.css
/* line 18, ../../../app/components/bootstrap-sass/lib/_sprites.scss */
[class^="icon-"],
[class*=" icon-"] {
display: inline-block;
...
/* WANT THIS IMAGE INLINED */
background-image: url("../components/bootstrap-sass/img/glyphicons-halflings.png");
...
}
So, main desire is to get all url() expressions to hold base64 encoded images inline. As an alternative, we can switch to LESS, if it provides this ability more easily. Actually, a good thing, because we'd eliminate dependency on Ruby/Compass and we'd be able to install everything with NPM
try this
inline-image($image, $mime-type)
http://compass-style.org/reference/compass/helpers/inline-data/#inline-image
http://blog.derekperez.com/post/755676493/smarter-sprites-inline-image-function-with-sass
Multiple Background Images using Sass / Compass
Just changed the variable for base path in bootstrap SASS main file. it helped.

FontAwesome error in scss file

hello fellow webdevelopers,
I'm a newbie to SASS, developing with Intellij IDEA Ultimate. I copied the font-awesome.scss file from the fontawesome/sass directory to my project and I got a few errors from the IDE, mainly at constructs like this:
.btn, .nav-tabs {
[class^="icon-"],
[class*=" icon-"] {
/* keeps button heights with and without icons the same */
line-height: .9em;
}
}
it keeps nagging about the colon , as separator between [class^="icon-"] and [class*=" icon-"].
but if the section looks like this
a [class^="icon-"],
a [class*=" icon-"] {
display: inline-block;
text-decoration: inherit;
}
everything looks fine.
furthermore, in the generated font-awesome.css file, there are some obvious errors as text-decoration: inherit; is definitely no valid CSS value. Could it be that these are bugs, or am I getting something wrong here?
how should I change the syntax at the above shown scss file to prevent the errors?
I'd like to use the font-awesome.scss as I'm also planning to use SASS for the whole project and it would be cool if I could use fontawesome the same way.
any suggestions on this?
The sample code provided is valid Sass and compiles as it should. Your IDE is just missing the proper syntax highlighting for Sass.