Skip to content

Commit

Permalink
TASK: Move Shortcut.css from Ui to Neos
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Oct 31, 2023
1 parent 8c27d3e commit d9ea8ca
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 47 deletions.
27 changes: 18 additions & 9 deletions Neos.Neos/Resources/Private/Fusion/Prototypes/Shortcut.fusion
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Neos.Neos.Shortcut is given a representation for editing purposes
#
prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) {
prototype(Neos.Neos:Shortcut) < prototype(Neos.Neos:Page) {
head.stylesheets {
shortcut = afx`
<link rel="stylesheet" href={StaticResource.uri('Neos.Neos', 'Public/Styles/Shortcut.css')} />
`
}

body = afx`
<div id="neos-shortcut">
<p>
<Neos.Neos:Shortcut.Link />
</p>
</div>
`
}

/** @internal */
prototype(Neos.Neos:Shortcut.Link) < prototype(Neos.Fusion:Component) {
targetMode = ${q(node).property('targetMode')}
firstChildNode = ${q(node).children('[instanceof Neos.Neos:Document]').get(0)}
target = ${q(node).property('target')}
Expand Down Expand Up @@ -68,14 +85,6 @@ prototype(Neos.Neos:Shortcut) < prototype(Neos.Fusion:Component) {
}
}

[email protected] = afx`
<div id="neos-shortcut">
<p>
{value}
</p>
</div>
`

@cache {
mode = "uncached"
context {
Expand Down
8 changes: 3 additions & 5 deletions Neos.Neos/Resources/Private/Fusion/RootCase.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
root = Neos.Fusion:Case
root {
shortcut {
prototype(Neos.Neos:Page) {
body = Neos.Neos:Shortcut
}

# this code path will only be taken for backend views, as the node controller
# will take care of resolving the shortcut in the frontend
@position = 'start'
condition = ${q(node).is('[instanceof Neos.Neos:Shortcut]')}
type = 'Neos.Neos:Page'
renderer = Neos.Neos:Shortcut
}

editPreviewMode {
Expand Down
32 changes: 32 additions & 0 deletions Neos.Neos/Resources/Private/Styles/Shortcut.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#neos-shortcut {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: $grayMedium;
z-index: 9999;
@include font;

p {
position: relative;
margin: 0 auto;
width: 500px;
height: 60px;
top: 50%;
margin-top: -30px;
color: #fff;
font-size: 22px;
line-height: 1.4;
text-align: center;

a {
color: $blue;
text-decoration: none;

&:hover {
color: $blueLight;
}
}
}
}
33 changes: 0 additions & 33 deletions Neos.Neos/Resources/Private/Styles/_Global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,3 @@
.neos-rendering-exception {
word-wrap: break-word;
}

#neos-shortcut {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: $grayMedium;
z-index: 9999;
@include font;

p {
position: relative;
margin: 0 auto;
width: 500px;
height: 60px;
top: 50%;
margin-top: -30px;
color: #fff;
font-size: 22px;
line-height: 1.4;
text-align: center;

a {
color: $blue;
text-decoration: none;

&:hover {
color: $blueLight;
}
}
}
}
1 change: 1 addition & 0 deletions Neos.Neos/Resources/Public/Styles/Shortcut.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Neos.Neos/webpack.styles.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const stylesConfig = {
Error: ["./Resources/Private/Styles/Error.scss"],
RawContentMode: ["./Resources/Private/Styles/RawContentMode.scss"],
Welcome: ["./Resources/Private/Styles/Welcome.scss"],
Shortcut: ["./Resources/Private/Styles/Shortcut.scss"],
},
output: {
path: __dirname + "/Resources/Public/Styles",
Expand Down

0 comments on commit d9ea8ca

Please sign in to comment.