Skip to content
Snippets Groups Projects
Commit 060ca02a authored by iberdinsky-skilld's avatar iberdinsky-skilld
Browse files

Messages SDC - #3502993

parent 9ef9b0f7
No related branches found
No related tags found
1 merge request!11420Messages SDC - #3502993
# This is so your IDE knows about the syntax for fixes and autocomplete.
$schema: https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json
# The human readable name.
name: Message
# Status can be: "experimental", "stable", "deprecated", "obsolete".
status: experimental
# Schema for the props. We support www.json-schema.org. Learn more about the
# syntax there.
props:
# Props are always an object with keys. Each key is a variable in your
# component template.
type: object
properties:
type:
type: string
default: status
enum:
- error
- status
- warning
url:
type: string
title: Message URL
format: iri-reference
slots:
content:
type: string
description: Message content.
......@@ -11,7 +11,6 @@
z-index: 1;
display: flex;
align-items: start;
cursor: pointer;
text-align: start;
-webkit-text-decoration: none;
text-decoration: none;
......@@ -28,6 +27,10 @@
gap: calc(0.5 * var(--admin-toolbar-rem));
}
.toolbar-message[href] {
cursor: pointer;
}
.toolbar-message__icon {
flex-shrink: 0;
inline-size: var(--admin-toolbar-space-20);
......
......@@ -4,7 +4,6 @@
z-index: 1;
display: flex;
align-items: start;
cursor: pointer;
text-align: start;
text-decoration: none;
word-break: break-word;
......@@ -20,6 +19,10 @@
gap: calc(0.5 * var(--admin-toolbar-rem));
}
.toolbar-message[href] {
cursor: pointer;
}
.toolbar-message__icon {
flex-shrink: 0;
inline-size: var(--admin-toolbar-space-20);
......
{#
/**
* @file
* Default theme implementation to display a single message in the navigation toolbar.
*
* Available variables:
* - content: The message to display.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'toolbar-message',
......
......@@ -38,15 +38,6 @@ internal.navigation-workspaces:
dependencies:
- navigation/internal.navigation
internal.navigation-messages:
# Internal library. Do not depend on it outside core nor add core usage
# beyond the Navigation module.
css:
theme:
css/components/toolbar-message.css: { }
dependencies:
- navigation/internal.navigation
admin-reset-styles:
css:
base:
......
......@@ -133,14 +133,6 @@ public function theme($existing, $type, $theme, $path) : array {
'message_list' => NULL,
],
];
$items['navigation__message'] = [
'variables' => [
'attributes' => [],
'url' => NULL,
'content' => NULL,
'type' => 'status',
],
];
return $items;
}
......
......@@ -9,7 +9,6 @@
* @ingroup themeable
*/
#}
{{ attach_library('navigation/internal.navigation-messages') }}
<div class="toolbar-block__list">
{% for message in message_list %}
{{ message }}
......
......@@ -179,12 +179,15 @@ public function navigationContentTop(): array {
'#theme' => 'navigation__messages',
'#message_list' => [
[
'#theme' => 'navigation__message',
'#content' => [
'#markup' => $this->t('This site is intended for demonstration purposes.'),
'#type' => 'component',
'#component' => 'navigation:message',
'#props' => [
'type' => 'warning',
'url' => $url,
],
'#slots' => [
'content' => (string) $this->t('This site is intended for demonstration purposes.'),
],
'#url' => $url,
'#type' => 'warning',
],
],
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment