-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from paulcpederson/master
better tooltips + version bump to 0.2.0
- Loading branch information
Showing
18 changed files
with
339 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
function guid(){ | ||
#!/usr/bin/env node | ||
function guid () { | ||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | ||
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | ||
return v.toString(16); | ||
}); | ||
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8) | ||
return v.toString(16) | ||
}) | ||
} | ||
|
||
console.log(guid()); | ||
console.log(guid()) | ||
process.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env node | ||
// Builds a .scss file with all site icons | ||
var glob = require('glob') | ||
var fs = require('fs') | ||
var path = require('path') | ||
var format = require('util').format | ||
|
||
var sets = ['calcite', 'calcite-large', 'vecticons'] | ||
|
||
function comma (index, array) { | ||
var needsComma = index !== array.length - 1 | ||
return needsComma ? ',' : '' | ||
} | ||
|
||
function formatLine (files, i) { | ||
var icon = path.basename(files[i], '.svg') | ||
return format('\n "%s"%s', icon, comma(i, files)) | ||
} | ||
|
||
function parseFiles (setName, index) { | ||
var files = glob.sync(format('lib/img/icons/%s/*.svg', setName)) | ||
var sassStream = fs.createWriteStream(format('lib/sass/calcite-web/icons/sets/%s.scss', setName), 'utf8') | ||
|
||
dataStream.write(format('\n "%s": [', setName)) | ||
sassStream.write(format('$%s-icons:', setName)) | ||
|
||
files.forEach(function (file, i) { | ||
var line = formatLine(files, i) | ||
dataStream.write(line) | ||
sassStream.write(line) | ||
}) | ||
sassStream.end(';') | ||
dataStream.write(format('\n ]%s', comma(index, sets))) | ||
} | ||
|
||
var dataStream = fs.createWriteStream('docs/source/icons.json', 'utf8') | ||
dataStream.write('{') | ||
sets.forEach(parseFiles) | ||
dataStream.end('\n}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Tooltips | ||
|
||
Tooltips use a `data-message` attribute to provide contextual help on hover. Tooltips can apply to any element. | ||
Tooltips use an `aria-label` attribute to provide contextual help on hover. Tooltips can apply to any element. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<div class="tooltip {{modifier}}" data-message="This is the message of the tooltip"> | ||
<span class="icon-help">?</span> | ||
</div> | ||
<p> | ||
Tooltips can be single line: <a class="tooltip {{modifier}}" aria-label="This is the message of the tooltip">single line tooltip</a> | ||
</p> | ||
<p> | ||
Tooltips can also have more than one line. Just use the <code>tooltip-multiline</code> class: | ||
<span class="tooltip tooltip-multiline {{modifier}}" aria-label="This is a tooltip with a quite large message if I do say so myself. Probably too long for just one line."> multiline tooltip</span> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.