Giter Club home page Giter Club logo

Comments (4)

dominikschreiber avatar dominikschreiber commented on July 27, 2024 3

It's complicated.

"SAP Belize Deep" is the theme a customer can select (similar to "SAP Belize"), the only difference between "SAP Belize" and "SAP Belize Deep" is that the "dark part" is applied to the sapContrastPlus scope, not the sapContrast scope (see sap_belize_plus/.theming):

<div><!-- light in "SAP Belize" and "SAP Belize Deep" --></div>
<div class="sapContrast"><!-- dark in "SAP Belize", light in "SAP Belize Deep" --></div>
<div class="sapContrastPlus"><!-- light in "SAP Belize", dark in "SAP Belize Deep" --></div>
<div class="sapContrast sapContrastPlus"><!-- dark in "SAP Belize" and "SAP Belize Deep" --></div>

sap_belize and sap_belize_plus are the actual light (sap_belize) and dark (sap_belize_plus) parts of "SAP Belize" and "SAP Belize Deep". "SAP Belize" and "SAP Belize Deep" both contain sap_belize as well as sap_belize_plus, just in different scopes.

The worst thing is that if a customer selects "SAP Belize Deep", technically sap_belize_plus is selected (compare sap_belize/css_variables.css and sap_belize_plus/css_variables.css -- the only difference should be in the very last line, where sap_belize defines .sapContrast and sap_belize_plus defines .sapContrastPlus).

So: "SAP Belize Deep" is in the theming-base-content (as the label of sap_belize_plus), it's just not obvious.

from theming-base-content.

Vita-Meow avatar Vita-Meow commented on July 27, 2024 1

It's complicated.

"SAP Belize Deep" is the theme a customer can select (similar to "SAP Belize"), the only difference between "SAP Belize" and "SAP Belize Deep" is that the "dark part" is applied to the sapContrastPlus scope, not the sapContrast scope (see sap_belize_plus/.theming):

<div><!-- light in "SAP Belize" and "SAP Belize Deep" --></div>
<div class="sapContrast"><!-- dark in "SAP Belize", light in "SAP Belize Deep" --></div>
<div class="sapContrastPlus"><!-- light in "SAP Belize", dark in "SAP Belize Deep" --></div>
<div class="sapContrast sapContrastPlus"><!-- dark in "SAP Belize" and "SAP Belize Deep" --></div>

sap_belize and sap_belize_plus are the actual light (sap_belize) and dark (sap_belize_plus) parts of "SAP Belize" and "SAP Belize Deep". "SAP Belize" and "SAP Belize Deep" both contain sap_belize as well as sap_belize_plus, just in different scopes.

The worst thing is that if a customer selects "SAP Belize Deep", technically sap_belize_plus is selected (compare sap_belize/css_variables.css and sap_belize_plus/css_variables.css -- the only difference should be in the very last line, where sap_belize defines .sapContrast and sap_belize_plus defines .sapContrastPlus).

So: "SAP Belize Deep" is in the theming-base-content (as the label of sap_belize_plus), it's just not obvious.

That's very helpful! thanks a lot !

from theming-base-content.

Vita-Meow avatar Vita-Meow commented on July 27, 2024

hi @dominikschreiber ,
I see some systems using .sapContrastPlus, which means light in "SAP Belize", dark in "SAP Belize Deep", to distinguish these 2 themes, is that a standard behavior to do it like that ?

from theming-base-content.

dominikschreiber avatar dominikschreiber commented on July 27, 2024

I don't get what you mean by "standard behavior".

Constrast scoping via sapContrast and sapContrastPlus has been introduced only for the Belize theme family, and (as far as I know) only to UI5- and Unified Rendering-based applications. It involves an infamous feature of the SAP-internal "theming engine", in which two full css's are built, then diffed against each other, and the diff is appended to one css with all selectors prefixed with a "scope" class (e.g. .sapContrast, .sapContrastPlus).

That was at a time where css custom properties were in their infancy and browser-support had to cover IE11 (where they are not supported even today). With custom properties this would have been a whole lot easier:

<style>
:root { --sapButton_Background: #eee; /* a light color */ }
.sapContrast{ --sapButton_Background: #111; /* a dark color */ }
.sapButton { background-color: var(--sapButton_Background); }
</style>
<button class="sapButton"><!-- uses #eee --></button>
<div class="sapContrast"><button class="sapButton"><!-- uses #111 --></button></div>

So this is no standard behavior as in "provided by the browser/html/css".

from theming-base-content.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.