How to use the colorette.underline function in colorette

To help you get started, we’ve selected a few colorette examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SlexAxton / css-colorguard / lib / formatter.js View on Github external
module.exports = function (input) {
  var messages = input.messages;
  var source = input.source;

  if (!messages.length) {
    return '  ' + logSymbols.success + '  No collisions found.';
  }

  var filename = underline(logFrom(source)) + '\n';

  return filename + table(messages.map(function (msg) {
    var last = msg.text.lastIndexOf('(');
    var warning = msg.text.slice(0, last).trim();
    var position = msg.text.slice(last, msg.text.length);
    return [
      '',
      gray('line ' + msg.node.source.start.line),
      gray('col ' + msg.node.source.start.column),
      warning,
      gray(position)
    ];
  })) + collisions(messages);
};
github zamotany / react-slate / packages / react-slate-reflow / src / render / applyStyle.js View on Github external
const applySingleStyle = memoize((key: string, value: string, text: string) => {
  switch (key) {
    case 'fontWeight':
      return value === 'bold' ? colorette.bold(text) : text;
    case 'fontStyle':
      return value === 'italic' ? colorette.italic(text) : text;
    case 'textDecoration': {
      switch (value) {
        case 'line-through':
          return colorette.strikethrough(text);
        case 'underline':
          return colorette.underline(text);
        default:
          return text;
      }
    }
    case 'textTransform': {
      switch (value) {
        case 'uppercase':
          return text.toUpperCase();
        case 'lowercase':
          return text.toLowerCase();
        case 'capitalize':
          return capitalize(text);
        default:
          return text;
      }
    }