You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2020/12/18 08:39:17 UTC
[myfaces-tobago] 01/02: add tobago-header css class to
tobago-section
This is an automated email from the ASF dual-hosted git repository.
hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit 0fb265dc691e477fd358c67823051888d8e96504
Author: Henning Nöth <hn...@apache.org>
AuthorDate: Wed Dec 16 16:38:43 2020 +0100
add tobago-header css class to tobago-section
* adjust tests
* use '.tobago-header' instead of 'div' in scss
---
tobago-core/npm/scss/_tobago.scss | 2 +-
.../myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java | 1 +
.../main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java | 1 +
.../src/test/resources/renderer/section/section-label-facet.html | 2 +-
tobago-core/src/test/resources/renderer/section/section-label.html | 2 +-
tobago-core/src/test/resources/renderer/section/simple.html | 2 +-
6 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/tobago-core/npm/scss/_tobago.scss b/tobago-core/npm/scss/_tobago.scss
index c745865..ba8c492 100644
--- a/tobago-core/npm/scss/_tobago.scss
+++ b/tobago-core/npm/scss/_tobago.scss
@@ -794,7 +794,7 @@ label.tobago-required:after {
}
/* section ----------------------------------------------------------- */
-tobago-section > div > {
+tobago-section > .tobago-header > {
h1, h2, h3, h4, h5, h6 {
> .fa:first-child, > img {
/* to separate the icon from the rest of the title */
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java
index ff4d5cd..694d82c 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SectionRenderer.java
@@ -77,6 +77,7 @@ public class SectionRenderer<T extends AbstractUISection> extends CollapsiblePan
}
writer.startElement(HtmlElements.DIV);
+ writer.writeClassAttribute(TobagoClass.HEADER);
writer.startElement(tag);
final String image = component.getImage();
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
index 6921a94..c44575a 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
@@ -142,6 +142,7 @@ public enum TobagoClass implements CssItem {
*/
@Deprecated
FORM("tobago-form"),
+ HEADER("tobago-header"),
/**
* @deprecated Since 5.0.0. Please use {@link TobagoClass#POPOVER__BUTTON}
*/
diff --git a/tobago-core/src/test/resources/renderer/section/section-label-facet.html b/tobago-core/src/test/resources/renderer/section/section-label-facet.html
index 15c2ec7..5566acf 100644
--- a/tobago-core/src/test/resources/renderer/section/section-label-facet.html
+++ b/tobago-core/src/test/resources/renderer/section/section-label-facet.html
@@ -16,7 +16,7 @@
-->
<tobago-section id='id'>
- <div>
+ <div class='tobago-header'>
<h1>label
</h1>
</div>
diff --git a/tobago-core/src/test/resources/renderer/section/section-label.html b/tobago-core/src/test/resources/renderer/section/section-label.html
index 64b8429..bd41c06 100644
--- a/tobago-core/src/test/resources/renderer/section/section-label.html
+++ b/tobago-core/src/test/resources/renderer/section/section-label.html
@@ -16,7 +16,7 @@
-->
<tobago-section id='id'>
- <div>
+ <div class='tobago-header'>
<h1>
<span>label</span>
</h1>
diff --git a/tobago-core/src/test/resources/renderer/section/simple.html b/tobago-core/src/test/resources/renderer/section/simple.html
index 52574d9..d0adecd 100644
--- a/tobago-core/src/test/resources/renderer/section/simple.html
+++ b/tobago-core/src/test/resources/renderer/section/simple.html
@@ -16,7 +16,7 @@
-->
<tobago-section id='id'>
- <div>
+ <div class='tobago-header'>
<h1>
</h1>
</div>