Skip to content

Commit

Permalink
XWIKI-22316: Some elements keep main theme CSS values
Browse files Browse the repository at this point in the history
* Updated the Applications Panel to use the document style
* Updated the Notification displayer UIX to use the document style
* Removed style for the Colibri skin in order to use new color theme variables in the application panel.
* Removed useless calls to colorThemeInit.vm at the start of ssxs (and set the parsing off for those.)
  • Loading branch information
Sereza7 committed Jul 11, 2024
1 parent a5f8379 commit a1e295c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ require(['jquery', 'XWikiAsyncNotificationsMacro', 'xwiki-events-bridge'], funct
<cache>long</cache>
</property>
<property>
<code>#template('colorThemeInit.vm')
<code>
/***********************************************
* Notification Container
***********************************************/
Expand Down Expand Up @@ -914,7 +914,7 @@ require(['jquery', 'XWikiAsyncNotificationsMacro', 'xwiki-events-bridge'], funct
<name>CSS</name>
</property>
<property>
<parse>1</parse>
<parse>0</parse>
</property>
<property>
<use>currentPage</use>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ Get the actual notifications.
<cache>long</cache>
</property>
<property>
<code>#template('colorThemeInit.vm')
<code>
/***********************************************
* Notifications Header
***********************************************/
Expand Down Expand Up @@ -644,7 +644,7 @@ Get the actual notifications.
<name>LESS</name>
</property>
<property>
<parse>1</parse>
<parse>0</parse>
</property>
<property>
<use>currentPage</use>
Expand Down Expand Up @@ -784,8 +784,13 @@ Get the actual notifications.
#if ("$!xcontext.userReference" != '' &amp;&amp; $services.notification.isEnabled())
#set ($discard = $xwiki.jsx.use('XWiki.Notifications.Code.Macro.NotificationsMacro'))
#set ($discard = $xwiki.jsx.use('XWiki.Notifications.Code.NotificationsDisplayerUIX'))
#set ($discard = $xwiki.ssx.use('XWiki.Notifications.Code.Macro.NotificationsMacro'))
#set ($discard = $xwiki.ssx.use('XWiki.Notifications.Code.NotificationsDisplayerUIX'))
## We make sure to use the color theme of the document where this UIX is used.
#set ($colorTheme = $xwiki.getUserPreference('colorTheme'))
#if ("$!colorTheme" != '')
#set ($colorTheme = $services.model.resolveDocument($colorTheme, $doc.documentReference))
#end
#set ($discard = $xwiki.ssx.use('XWiki.Notifications.Code.Macro.NotificationsMacro', {'colorTheme': $colorTheme}))
#set ($discard = $xwiki.ssx.use('XWiki.Notifications.Code.NotificationsDisplayerUIX', {'colorTheme': $colorTheme}))
{{html clean="false"}} ## We need the clean false to avoid getting a supplementary ul element.
&lt;li class="notification-uix loading"&gt;&lt;/li&gt;
{{/html}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
</property>
<property>
<async_context>
<value>doc.reference</value>
<value>icon.theme</value>
<value>locale</value>
<value>request.wiki</value>
Expand Down Expand Up @@ -226,7 +227,12 @@
{{/velocity}}

{{velocity}}
#set ($discard = $xwiki.ssx.use('Panels.Applications'))
## We make sure to use the color theme of the document where this UIX is used.
#set ($colorTheme = $xwiki.getUserPreference('colorTheme'))
#if ("$!colorTheme" != '')
#set ($colorTheme = $services.model.resolveDocument($colorTheme, $doc.documentReference))
#end
#set ($discard = $xwiki.ssx.use('Panels.Applications', {'colorTheme': $colorTheme}))
#set ($discard = $xwiki.jsx.use('Panels.Applications'))

#panelheader($services.localization.render('panels.applications.title'))
Expand Down Expand Up @@ -532,9 +538,7 @@ require(['scriptaculous/effects'], function() {
<cache>long</cache>
</property>
<property>
<code>#template('colorThemeInit.vm')

.applicationsPanel li img {
<code>.applicationsPanel li img {
float: left;
width: 16px;
height: 16px;
Expand All @@ -555,7 +559,7 @@ require(['scriptaculous/effects'], function() {
padding: 0;
margin: 10px 0 0 0;
border: 0;
color: $theme.linkColor;
color: @link-color;
box-shadow: none;
background-color: transparent;
width: 100%;
Expand All @@ -565,7 +569,7 @@ require(['scriptaculous/effects'], function() {

.applicationPanelMoreButton:hover,
.applicationPanelMoreButton:focus {
background-color: $theme.highlightColor;
color: @link-hover-color;
}

.applicationPanelMoreButton .application-label {
Expand Down Expand Up @@ -692,66 +696,24 @@ require(['scriptaculous/effects'], function() {
float: left;
width: 33%;
}

/* no responsive design for colibri */
.skin-colibri .panel-width-Small .applicationsPanel li {
float: none;
width: inherit;
}
}

@media (min-width: 768px) and (max-width: 992px) {
.panel-width-Small .applicationsPanel &gt; li {
float: left;
width: 20%;
}

/* no responsive design for colibri */
.skin-colibri .panel-width-Small .applicationsPanel li {
float: none;
width: inherit;
}
}

/* for colibri */

.skin-colibri .panel-width-Small .applicationsPanel {
margin: 0;
}

.skin-colibri .panel-width-Small .applicationsPanel li {
padding: 15px 0;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
margin: 1px 0;
}

.skin-colibri .panel-width-Small .applicationsPanel li.active {
background-color: $theme.buttonPrimaryBackgroundColor;
}

.skin-colibri .panel-width-Small .applicationsPanel li.active a {
color: $theme.buttonPrimaryTextColor
}

.skin-colibri .panel-width-Small .applicationsPanel li:hover {
background-color: $theme.highlightColor;
}

.skin-colibri .panel-width-Small .applicationsPanel li:hover a {
color: $theme.textPrimaryColor;
}
</code>
</property>
<property>
<contentType/>
<contentType>LESS</contentType>
</property>
<property>
<name>Applications Panel</name>
</property>
<property>
<parse>1</parse>
<parse>0</parse>
</property>
<property>
<use>onDemand</use>
Expand Down

0 comments on commit a1e295c

Please sign in to comment.