Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update interaction links markup to accommodate font icons. #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

populationtwo
Copy link

I made some modification to the interaction links to a accommodate font icons.

Cheers

@jasonmayes
Copy link
Owner

Can you elaborate what this does? Does the user need to add CSS for this to show the icons?

@populationtwo
Copy link
Author

Basically wrapping the interaction text with <span> and adding <i> tag. That will allow user to style the interaction link with font icon.
image

With the current markup it's impossible to display the icons (withouth text) using font icons. The only way to display the icons is by displaying the text as well, since hiding the text will hiding the icons as well.
http://codepen.io/populationtwo/details/jBYozW/

With the proposed markup user can display the icons only without text. Or display the text only without icons.
http://codepen.io/populationtwo/pen/VpyOBE

And yes, use need to add their own CSS to show the icons.

Let me know if you have any questions.

@jasonmayes
Copy link
Owner

Could you not use the following CSS to hide the text but keep the background image?

.interact span {
text-indent: -1000px;
overflow: hidden;
background-image: url('../path/to/icon.png');
}

?

@populationtwo
Copy link
Author

populationtwo commented Mar 23, 2017

That only works on image file, it won't work on font-icon. The proposed PR will allow both font icon and image file.

@cho9e
Copy link

cho9e commented May 21, 2017

I managed to use font icons pretty easily with CSS?
p.interact a { visibility: hidden; position: relative; width: 11px; height: 11px; overflow: hidden; display: inline-block; margin-right: 2px; } p.interact a:after { visibility: visible; display: block; position: absolute; left:0; top:0; font-family: untitled-font-1!important; font-style: normal; font-weight: 400; speak: none; display: inline-block; text-decoration: inherit; width: 1em; text-align: center; font-variant: normal; text-transform: none; vertical-align: middle; line-height: 1em; font-size: 1em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } p.interact a:first-of-type:after {content: '\e092';} p.interact a:nth-of-type(2):after {content: '\e02d';} p.interact a:nth-of-type(3):after {content: '\e06e';}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants