-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added css-file and write forced handles
- Loading branch information
Showing
21 changed files
with
664 additions
and
323 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,15 @@ | ||
import {resizeClasses, resizeCursors, rotationClasses, rotationCursors} from "react-mops"; | ||
import {createGlobalStyle, css} from "styled-components"; | ||
import {createGlobalStyle} from "styled-components"; | ||
|
||
export const GlobalStyle = createGlobalStyle` | ||
body { | ||
margin: 0; | ||
font-family: sans-serif; | ||
background: #eee; | ||
color: hsla(0, 0%, 0%, 0.8); | ||
${rotationClasses.map( | ||
(c, i) => css` | ||
&.${c} * { | ||
cursor: -webkit-image-set( | ||
url(${rotationCursors[i]["1x"]}) 1x, | ||
url(${rotationCursors[i]["2x"]}) 2x | ||
) | ||
9 9, | ||
auto !important; | ||
} | ||
` | ||
)} | ||
${resizeClasses.map( | ||
(c, i) => css` | ||
&.${c} * { | ||
cursor: ${resizeCursors[i]} !important; | ||
} | ||
` | ||
)} | ||
color: hsla(0, 0%, 0%, 0.8); | ||
} | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
} | ||
`; |
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
plugins: { | ||
"postcss-url": { | ||
url: "inline" | ||
}, | ||
cssnano: process.env.NODE_ENV === "production" ? {} : null | ||
} | ||
}; |
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 @@ | ||
@import "./dist/index.css"; |
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,47 +1,17 @@ | ||
import png_eRotate1x from "./images/e-rotate.png"; | ||
import png_eRotate2x from "./images/e-rotate@2x.png"; | ||
import png_nRotate1x from "./images/n-rotate.png"; | ||
import png_nRotate2x from "./images/n-rotate@2x.png"; | ||
import png_neRotate1x from "./images/ne-rotate.png"; | ||
import png_neRotate2x from "./images/ne-rotate@2x.png"; | ||
import png_nwRotate1x from "./images/nw-rotate.png"; | ||
import png_nwRotate2x from "./images/nw-rotate@2x.png"; | ||
import png_sRotate1x from "./images/s-rotate.png"; | ||
import png_sRotate2x from "./images/s-rotate@2x.png"; | ||
import png_seRotate1x from "./images/se-rotate.png"; | ||
import png_seRotate2x from "./images/se-rotate@2x.png"; | ||
import png_swRotate1x from "./images/sw-rotate.png"; | ||
import png_swRotate2x from "./images/sw-rotate@2x.png"; | ||
import png_wRotate1x from "./images/w-rotate.png"; | ||
import png_wRotate2x from "./images/w-rotate@2x.png"; | ||
|
||
export const resizeClasses = [ | ||
"Mops--col-resize", | ||
"Mops--nwse-resize", | ||
"Mops--row-resize", | ||
"Mops--nesw-resize" | ||
"colResize", | ||
"nwseResize", | ||
"rowResize", | ||
"neswResize" | ||
]; | ||
|
||
export const resizeCursors = ["col-resize", "nwse-resize", "row-resize", "nesw-resize"]; | ||
|
||
export const rotationClasses = [ | ||
"Mops--e-rotate", | ||
"Mops--se-rotate", | ||
"Mops--s-rotate", | ||
"Mops--sw-rotate", | ||
"Mops--w-rotate", | ||
"Mops--nw-rotate", | ||
"Mops--n-rotate", | ||
"Mops--ne-rotate" | ||
]; | ||
|
||
export const rotationCursors = [ | ||
{"1x": png_eRotate1x, "2x": png_eRotate2x}, | ||
{"1x": png_seRotate1x, "2x": png_seRotate2x}, | ||
{"1x": png_sRotate1x, "2x": png_sRotate2x}, | ||
{"1x": png_swRotate1x, "2x": png_swRotate2x}, | ||
{"1x": png_wRotate1x, "2x": png_wRotate2x}, | ||
{"1x": png_nwRotate1x, "2x": png_nwRotate2x}, | ||
{"1x": png_nRotate1x, "2x": png_nRotate2x}, | ||
{"1x": png_neRotate1x, "2x": png_neRotate2x} | ||
"eRotate", | ||
"seRotate", | ||
"sRotate", | ||
"swRotate", | ||
"wRotate", | ||
"nwRotate", | ||
"nRotate", | ||
"neRotate" | ||
]; |
Oops, something went wrong.