Compass / compass

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
http://compass-style.org
Other
6.72k stars 1.18k forks source link

View source for lines-for-font-size() broken #1670

Open benebun opened 10 years ago

benebun commented 10 years ago

The view source link for the lines-for-font-size() function doesn't work when the syntax preference is scss because it got mangled with the sass source somehow:

http://compass-style.org/reference/compass/typography/vertical_rhythm/#function-lines-for-font-size

@function lines-for-font-size($font-size)
  $lines: if($round-to-nearest-half-line, ceil(2 * $font-size / $base-line-height) / 2, ceil($font-size / $base-line-height))
  @if $lines * $base-line-height - $font-size
<pre class="brush: scss source-code scss">@function lines-for-font-size($font-size) {
  $lines: if($round-to-nearest-half-line, ceil(2 * $font-size / $base-line-height) / 2, ceil($font-size / $base-line-height));
  @if $lines * $base-line-height - $font-size
</pre>
chriseppstein commented 10 years ago

wierd.

floq-design commented 8 years ago

Still an issue [https://github.com/Compass/compass/issues/2015].

The problem seems to be that the source has classes that match the CSS rule .function-source .syntaxhighlighter.sass which is being set to display: none; in screen.css line 1129. Changing the .sass class to .scss fixes the issue on div with id="highlighter_996914"

floq-design commented 8 years ago

I've forked the Compass repo to try and fix the issue but getting lost in the reference doc creation syntax.

There are 3 areas to the reference docs that I've found that have failed to compile due to the same reason which is the < character is not being escaped (it seems).

http://compass-style.org/reference/compass/typography/vertical_rhythm/#function-lines-for-font-size http://compass-style.org/reference/compass/support/#function-has-browser-subset http://compass-style.org/reference/compass/support/#function-intersect-browser-ranges

TowhidKashem commented 7 years ago

in case anyone else encountered this issue and wants to see the actual function, it's:

@function lines-for-font-size($font-size) {
  $lines: if($round-to-nearest-half-line,
             ceil(2 * $font-size / $base-line-height) / 2,
             ceil($font-size / $base-line-height));
  // If lines are cramped include some extra lead.
  @if ($lines * $base-line-height - $font-size) < ($min-line-padding * 2) {
    $lines: $lines + if($round-to-nearest-half-line, 0.5, 1);
  }
  @return $lines;
}