mirror of
https://github.com/dzeiocom/components.git
synced 2025-06-16 04:29:20 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
6c2b3466ba
|
|||
31c9e30d3d
|
|||
0b60fa84ba
|
|||
b586a32d00
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@ module/
|
|||||||
node_modules/
|
node_modules/
|
||||||
*.mjs
|
*.mjs
|
||||||
*.js
|
*.js
|
||||||
|
!src/dzeio/stylusUtils.js
|
||||||
*.d.ts
|
*.d.ts
|
||||||
!src/stylus.d.ts
|
!src/stylus.d.ts
|
||||||
!.storybook/*.js
|
!.storybook/*.js
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dzeio/components",
|
"name": "@dzeio/components",
|
||||||
"version": "0.5.0",
|
"version": "0.5.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./src/index.mjs",
|
"main": "./src/index.mjs",
|
||||||
"types": "./src/index.d.ts",
|
"types": "./src/index.d.ts",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
@import '../config'
|
@import '../config'
|
||||||
|
|
||||||
.link
|
.link
|
||||||
color $infoLight
|
|
||||||
@media (prefers-color-scheme dark)
|
|
||||||
color $infoDark
|
color $infoDark
|
||||||
|
@media (prefers-color-scheme dark)
|
||||||
|
color $infoLight
|
||||||
&:hover
|
&:hover
|
||||||
text-decoration underline
|
text-decoration underline
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ interface Props {
|
|||||||
/**
|
/**
|
||||||
* Override external detection system
|
* Override external detection system
|
||||||
*/
|
*/
|
||||||
|
noStyle?: boolean
|
||||||
external?: boolean
|
external?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ export default class Link extends React.Component<Props> {
|
|||||||
// external link
|
// external link
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={buildClassName(this.props.className, css.link)}
|
className={buildClassName(this.props.className, [css.link, !this.props.noStyle])}
|
||||||
href={this.props.href}
|
href={this.props.href}
|
||||||
rel="noreferrer nofollow"
|
rel="noreferrer nofollow"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -35,7 +36,7 @@ export default class Link extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<NextLink href={this.props.href}>
|
<NextLink href={this.props.href}>
|
||||||
<a
|
<a
|
||||||
className={buildClassName(this.props.className, css.link)}
|
className={buildClassName(this.props.className, [css.link, !this.props.noStyle])}
|
||||||
>{this.props.children}</a>
|
>{this.props.children}</a>
|
||||||
</NextLink>
|
</NextLink>
|
||||||
)
|
)
|
||||||
|
11
src/dzeio/stylusUtils.js
Normal file
11
src/dzeio/stylusUtils.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
// See https://github.com/stylus/stylus/issues/1872#issuecomment-86553717
|
||||||
|
var stylus = require('stylus');
|
||||||
|
|
||||||
|
module.exports = function() {
|
||||||
|
return function(style) {
|
||||||
|
style.define('file-exists', function(path) {
|
||||||
|
return !!stylus.utils.lookup(path.string, this.paths);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
Reference in New Issue
Block a user