Skip to content

Commit

Permalink
[TASK] styleguide: Namespace BE css
Browse files Browse the repository at this point in the history
TYPO3-CMS/styleguide#464

Have a unique BE css id to restrict any
declared CSS to the styleguide module.
  • Loading branch information
lolli42 authored Oct 31, 2023
1 parent 26e8e8b commit 2402823
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function handleRequest(ServerRequestInterface $request): ResponseInterfac
if (!in_array($currentAction, $this->allowedActions, true)
&& !in_array($currentAction, $this->allowedAjaxActions, true)
) {
throw new \RuntimeException('Not allowed action', 1672751508);
throw new \RuntimeException('Action not allowed', 1672751508);
}
$actionMethodName = $currentAction . 'Action';
return $this->$actionMethodName($request);
Expand Down Expand Up @@ -304,7 +304,7 @@ private function flashMessagesAction(ServerRequestInterface $request): ResponseI
$loremIpsum = GeneralUtility::makeInstance(KauderwelschService::class)->getLoremIpsum();
// We're writing to an own queue here to position the messages within the body.
// Normal modules wouldn't usually do this and would let ModuleTemplate layout take care of rendering
// at some appropriate positions.
// at some appropriate position.
$flashMessageQueue = $this->flashMessageService->getMessageQueueByIdentifier('styleguide.demo');
$flashMessageQueue->enqueue(GeneralUtility::makeInstance(FlashMessage::class, $loremIpsum, 'Info - Title for Info message', ContextualFeedbackSeverity::INFO, true));
$flashMessageQueue->enqueue(GeneralUtility::makeInstance(FlashMessage::class, $loremIpsum, 'Notice - Title for Notice message', ContextualFeedbackSeverity::NOTICE, true));
Expand Down
37 changes: 9 additions & 28 deletions typo3/sysext/styleguide/Resources/Private/Styles/backend.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
// Navigation scaffold
@media (min-width: 769px) {
#container-navigation {
position: fixed;
width: 260px;
}
#container-content {
margin-left: 300px;
}
@media (max-height: 660px) {
#container-navigation {
position: absolute;
}
}
#tx-styleguide-navigation {
position: fixed;
width: 260px;
}
#tx-styleguide-content {
margin-left: 300px;
}

// Example
.example {
// Code and example rendering
#tx-styleguide-content .example {
background-color: var(--typo3-component-bg);
border: var(--typo3-component-border-width) solid var(--typo3-component-border-color);
padding: var(--typo3-spacing);
Expand All @@ -31,20 +24,10 @@
margin-bottom: var(--typo3-spacing);
}
&.code {
font-family: var(--typo3-font-family-code);
&:before {
content: 'EXAMPLE CODE';
}
}
pre {
font-size: var(--typo3-component-font-size);
margin: 0;
}
pre[class*="language-"] {
border-radius: calc(var(--typo3-component-border-radius) / 2);
color: var(--typo3-component-color);
margin: 0;
}
pre code {
overflow: auto;
width: 100%;
Expand All @@ -53,15 +36,13 @@
}

// Icon module
div.icon-container {
#tx-styleguide-content .icon-container {
border: 1px solid transparent;
margin-bottom: 20px;
height: 100px;

&.icon-deprecated-container {
height: 175px;
}

span.icon-container-icon,
span.icon-container-label {
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:accordion"/></h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:avatar" /></h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:buttons" /></h1>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:cards" /></h1>

<p>Cards can be displayed individually or in groups.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:colors" /></h1>
<p>CI color from the TYPO3 logo and contrast primary color.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1>Filter</h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>

<div id="container-content">
<div id="tx-styleguide-content">
<h1>
<f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:flashMessages"/>
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:icons" /></h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:backendStyleguide" /></h1>
<p>Presents supported styles for TYPO3 backend modules.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:infobox" /></h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:modal" /></h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="""vigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1>
<f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:notifications"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1>Pagination</h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
}"
/>

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">

<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:tab" /></h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:tables" /></h1>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:trees" /></h1>

<h2>Page trees</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<f:section name="Content">

<div id="container-navigation">
<div id="tx-styleguide-navigation">
<f:render partial="Backend/Navigation" arguments="{currentAction: currentAction, actions: actions}" />
</div>
<div id="container-content">
<div id="tx-styleguide-content">
<h1><f:translate key="LLL:EXT:styleguide/Resources/Private/Language/locallang.xlf:typography" /></h1>

<!--
Expand Down
51 changes: 17 additions & 34 deletions typo3/sysext/styleguide/Resources/Public/Css/backend.css
Original file line number Diff line number Diff line change
@@ -1,70 +1,53 @@
@media (min-width: 769px) {
#container-navigation {
position: fixed;
width: 260px;
}
#container-content {
margin-left: 300px;
}
#tx-styleguide-navigation {
position: fixed;
width: 260px;
}
@media (min-width: 769px) and (max-height: 660px) {
#container-navigation {
position: absolute;
}

#tx-styleguide-content {
margin-left: 300px;
}
.example {

#tx-styleguide-content .example {
background-color: var(--typo3-component-bg);
border: var(--typo3-component-border-width) solid var(--typo3-component-border-color);
padding: var(--typo3-spacing);
margin-bottom: var(--typo3-spacing);
}
.example + *:not(.example) {
#tx-styleguide-content .example + *:not(.example) {
margin-top: var(--typo3-component-spacing);
}
.example:before {
#tx-styleguide-content .example:before {
content: "EXAMPLE";
display: block;
font-weight: normal;
font-size: 0.9em;
margin-bottom: var(--typo3-spacing);
}
.example.code {
font-family: var(--typo3-font-family-code);
}
.example.code:before {
#tx-styleguide-content .example.code:before {
content: "EXAMPLE CODE";
}
.example pre {
font-size: var(--typo3-component-font-size);
margin: 0;
}
.example pre[class*=language-] {
border-radius: calc(var(--typo3-component-border-radius) / 2);
color: var(--typo3-component-color);
margin: 0;
}
.example pre code {
#tx-styleguide-content .example pre code {
overflow: auto;
width: 100%;
display: block;
}

div.icon-container {
#tx-styleguide-content .icon-container {
border: 1px solid transparent;
margin-bottom: 20px;
height: 100px;
}
div.icon-container.icon-deprecated-container {
#tx-styleguide-content .icon-container.icon-deprecated-container {
height: 175px;
}
div.icon-container span.icon-container-icon,
div.icon-container span.icon-container-label {
#tx-styleguide-content .icon-container span.icon-container-icon,
#tx-styleguide-content .icon-container span.icon-container-label {
display: block;
text-align: center;
background-color: #eee;
min-height: 50px;
padding: 5px;
}
div.icon-container:hover span.icon-container-icon, div.icon-container:hover span.icon-container-label {
#tx-styleguide-content .icon-container:hover span.icon-container-icon, #tx-styleguide-content .icon-container:hover span.icon-container-label {
background-color: #e1e1e1;
}

0 comments on commit 2402823

Please sign in to comment.