diff --git a/README.md b/README.md index 447cd6e..d7279f5 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ It has four color. - `black` - `green` +#### className + +It would be an html tag's attribute `class`. + ## Release Notes ### Version 0.5.1 - 2017/10/05 diff --git a/dst/react-github-fork-ribbon.js b/dst/react-github-fork-ribbon.js index e28b500..ce4c72d 100644 --- a/dst/react-github-fork-ribbon.js +++ b/dst/react-github-fork-ribbon.js @@ -39,8 +39,9 @@ var GitHubForkRibbon = function GitHubForkRibbon(_ref) { target = _ref.target, _ref$color = _ref.color, color = _ref$color === undefined ? 'red' : _ref$color, + className = _ref.className, children = _ref.children, - other = _objectWithoutProperties(_ref, ['position', 'href', 'target', 'color', 'children']); + other = _objectWithoutProperties(_ref, ['position', 'href', 'target', 'color', 'className', 'children']); var positionStyle = positionMapping[position] || [_ribbonStyle.RibbonStyle.rightStyle, _ribbonStyle.RibbonStyleWrapper.rightStyle]; var colorStyle = colorMapping[color] || _ribbonStyle.RibbonStyle.redColor; @@ -56,7 +57,7 @@ var GitHubForkRibbon = function GitHubForkRibbon(_ref) { return _react2.default.createElement( 'div', _extends({}, other, { - className: 'github-fork-ribbon-wrapper ' + position, + className: 'github-fork-ribbon-wrapper ' + position + ' ' + className, style: wrapperStyle }), _react2.default.createElement( 'div', @@ -138,7 +139,7 @@ var RibbonStyle = exports.RibbonStyle = { /* Add "stitching" effect */ borderWidth: '1px 0', - borderStyle: 'dotted', + borderStyle: 'dashed', // borderColor: '#fff', borderColor: 'rgba(255, 255, 255, 0.7)' }, diff --git a/dst/react-github-fork-ribbon.min.js b/dst/react-github-fork-ribbon.min.js index 4444dc5..f7ea67f 100644 --- a/dst/react-github-fork-ribbon.min.js +++ b/dst/react-github-fork-ribbon.min.js @@ -1 +1 @@ -!function t(e,o,r){function n(l,a){if(!o[l]){if(!e[l]){var b="function"==typeof require&&require;if(!a&&b)return b(l,!0);if(i)return i(l,!0);var f=new Error("Cannot find module '"+l+"'");throw f.code="MODULE_NOT_FOUND",f}var d=o[l]={exports:{}};e[l][0].call(d.exports,function(t){var o=e[l][1][t];return n(o?o:t)},d,d.exports,t,e,o,r)}return o[l].exports}for(var i="function"==typeof require&&require,l=0;l=0||Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r]);return o}Object.defineProperty(o,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}Object.defineProperty(o,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t { +const GitHubForkRibbon = ({position = 'right', href, target, color = 'red', className = '', children, ...other}) => { const positionStyle = positionMapping[position] || [RibbonStyle.rightStyle, RibbonStyleWrapper.rightStyle]; const colorStyle = colorMapping[color] || RibbonStyle.redColor; @@ -41,7 +41,7 @@ const GitHubForkRibbon = ({position = 'right', href, target, color = 'red', chil return (
diff --git a/storybook/__tests__/GithubForkRibbon.stories.js b/storybook/__tests__/GithubForkRibbon.stories.js index 4062123..8fb0e3b 100644 --- a/storybook/__tests__/GithubForkRibbon.stories.js +++ b/storybook/__tests__/GithubForkRibbon.stories.js @@ -108,3 +108,25 @@ storiesOf('GitHub fork ribbon/color', module) return component; }); + +storiesOf('GitHub fork ribbon/className', module) + .add('hidden on small devices up to 576px', () => { + const component = ( +
+ + + Fork me on GitHub + +
+ ); + + return component; + });