Skip to content

Instantly share code, notes, and snippets.

@carlwood
Last active December 17, 2015 21:48
Show Gist options
  • Save carlwood/5676966 to your computer and use it in GitHub Desktop.
Save carlwood/5676966 to your computer and use it in GitHub Desktop.
Problem with fuzzy firefox :after arrow rendering?

#Fixing fuzzy CSS triangles in Firefox

References http://stackoverflow.com/questions/12301366/pure-css-triangle-looks-blurry-in-firefox.

Thanks to http://stackoverflow.com/users/295770/luca

This problem references my earlier gist (https://gist.github.com/carlwood/5663616) where I created css triangles to display a selected link - which would open a dropdown.

Original SCSS source code:

.selected {

  &:after {
    // Draw a standard upward-facing arrow
    border-right: 14px solid transparent;           
    border-left: 14px solid transparent;
    border-bottom: 8px solid #303030;
    position: absolute;
  }
  
}

The arrow edges are fuzzy on Firefox.

To fix it, we need to change the transparent borders to dotted style instead of solid.

&:after {
  border-right: 14px dotted transparent; // solid -> dotted      
  border-left: 14px dotted transparent; // solid -> dotted
  border-bottom: 8px solid #303030;
  position: absolute;
}

Tested on Firefox 21.0

@carlwood
Copy link
Author

Hmm, seems to not work for latest FF version *27.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment