CSS 2 Sass: How do I change the output format of the generated SCSS?
Tags: css,ruby,sass
Problem :
I want to convert CSS to SCSS that looks like this:
.top {
margin-top: 1em;
margin-bottom: 1em;
nav {
background: #333;
}
ul {
padding: 0;
display: table-row;
}
li {
display: table-cell;
}
}
Instead, I am getting this:
.top {
margin-top: 1em;
margin-bottom: 1em;
nav {
background: #333; }
ul {
padding: 0;
display: table-row; }
li {
display: table-cell; } }
How do I change the output indentation in the command:
sass-convert public/stylesheets/application.css public/stylesheets/application.scss
Thanks!
Solution :
According to the docs (and checking 'sass-convert -h' on the command line) there is no way to change the output style when going from css to scss (or sass).
CSS Howto..
You can use the viewport meta tag, as described by Mozilla. The Apple Documentation for developing web content for iPad describes this tag quite nicely too. Apple recommends: <meta name="viewport"...
This is not possible to do with jQuery - this kind of activity is blocked by the same-origin policy. It's a useful thing to do, but also opens up all...
MDN Learn .net magazine Would be the resources I would recommend. Outside of those I would just mess around with web design....
Try adding white-space: nowrap; to whichever div is holding your square elements. Of course, this will create some overflow if the page is small, which will need to be handled...
Finally I used jQuery to fix vh units, as it was mentioned in source 2 and there. CSS: Are view height (vh) and view width (vw) units widely supported? ...
If you're using wp_list_pages(), you can use the classes current_page_item, current_page_ancestor and current_page_parent to target the active nodes. Otherwise a bit of manual labour is at stake - you could...
$date1 = new DateTime("now"); $date2 = $rows['ExpirationDate']; $difference = $date1->diff($date2); $days = $difference->d; $class = ''; if ($days <= 3) $class = 'class="expired"'; Then add the $class variable to each...
Change the css of .top-wrapper to only take up 85%, that leaves 15% for the "arrow" on the bottom to take up. .top-wrapper { ... height: 85%; ... } see...
Because of the cascade, you can't just remove the font-size:1.3em specification. Try this: #mainIntro {font-size:1.3em;} #mainIntro p { 100%; } This will set the font size for that div to...
<link rel="stylesheet" type="text/css" href="class.css" /> ...
You can use .mouseover() effect from jQuery library (check here) I created an example JSFiddle with similar effect to what you wanted to achieve: JSFiddle Explanation: Div bg is over...
Add the padding to the a element instead of the li element. ul.menu > li a { padding:10px;} for example Updated Fiddle link...
You can solve all your issues with CSS only JSBin here New CSS .rotate { display:block; position:absolute; font-size: 12px; line-height: 18px; font-family: monospace; letter-spacing: 1px; margin: 0; text-align: center; top:45%;...
In case you do not want to use the toogleClass(), here is another solution: http://jsfiddle.net/YFBWQ/ $('#foo-bar') .removeClass('horizontal vertical') .addClass( myvar=='layout2' ? 'vertical' : 'horizontal') or $('#foo-bar') .removeClass(myvar=='layout2' ? 'horizontal' :...
Use relative positioning for the inner divs, wrap them in an absolute/fixed positioned div.
Personally, I would make it as simple as possible. Getting rid of <table> is always a good practice. Try this using divs, this is very responsive: .item { overflow: hidden;...
Just like everyone else here, I'll chime in with "Use my favorite framework, because it's what I use...." I would start with small goals for a web interface. Get something...
The trick is to not actually disable the checkbox but intercept the click action of the "disabled" textbox so it functions as if it was disabled from that point you...
You could create a master stylesheet that you include in every page, and within that css file you can use @import to include the others. This doesn't solve the problem...
Trying to set display: inline is the right idea. My supposition is that you didn't make your selector specific enough to override the display: block set in .entry .entry_meta_bottom a,...
The <input>s must have a size attribute if you want to control their width with CSS: <td><input size="1"></td> The value of size doesn't matter (though it does need some value—you...
Now i've played around with your problem and it seems like there is no solution to your specific issue without using some kind of script to control the show/noshow. Here's...
It is the float: left on the wrapping span. Either remove that, or set it's width to 100% or similar. You probably should do this for only IE8 and below.
Your divs have no height, so they do not do much currently. Fiddle .select_3_left{ float: left; width: 30%; height:100px; background: red; } .select_3_middle{ float: left; width: 30%; height:100px; background: green;...
You could use .slice() like so: Working Example 1 $(function () { $("#tabs").tabs(); $('#tabs li').slice(2, 5).css('visibility', 'hidden'); }); or :nth-child() like so: Working Example 2 $(function () { $("#tabs").tabs(); $('#tabs...
I ended up just implementing the "maximum" logic on the div manually to limit its size, instead of relying on max-width: if ($div.width() > limit) $div.css('width', limit); http://jsfiddle.net/yzn5pnhn/2/...
Unfortunately this can't currently be done using CSS as CSS reads from right to left only. This means that the rightmost element in the selector will be the one receiving...
Remove the width from #circles li and it should stack instead of run into each other .circle { display:table; width: 10em; height:10em; border-radius: 50%; overflow: hidden; background: transparent; box-shadow: 0...
You can't. The [...] selectors only work on attributes, not element types themselves. What you can do though, as I'm sure you're already aware, is chain them all into one...
Here is a fiddle that shows a few points that can help you with your implementation: http://jsfiddle.net/Gdadu/13/ It is far from perfect, and as pointed out in the comment, there...