@@ -41,16 +41,58 @@ Decision
4141
4242..  This section describes our response to these forces. It is stated in full sentences, with active voice. "We will …"
4343
44- 
45- those that alter the content of the component. We will expose both
46- customization option to be configurable through the `MFE's config mechanism `_.
44+ 
45+ ===== 
4746
48- For styles, to allow a great degree of freedom in customization, we will allow,
49- where appropriate, to either supply a list of CSS classes which will be applied
50- to a particular component, or a list of CSS attributes and values.
47+ For specifying the footer links, we are going to use `MFE's config mechanism `_.
48+ That would allow to specify a list of links in various ways:
49+ 
50+ * At build time:
51+   * Via environmental variables
52+   * By providing them in ``env.config.js ``, like so:
53+ 
54+     .. code-block :: javascript 
55+ 
56+         const  config  =  { 
57+             FOOTER_LINKS :  [ 
58+                 {" url" :  " https://google.com" " text" :  " Terms of service"  
59+                 {" url" :  " https://duckduckgo.com" " text" :  " Acceptable Use Policy"  
60+                 {" url" :  " https://openedx.org" " text" :  " Privacy Policy"  
61+             ], 
62+         }; 
63+ 
64+         export  default  config ; 
65+ 
66+ MFE_CONFIG `` in LMS's Django settings:
67+ 
68+     .. code-block :: python 
69+ 
70+         MFE_CONFIG  =  { 
71+             " FOOTER_LINKS"  
72+                 {" url" " https://google.com" " text" " Terms of service"  
73+                 {" url" " https://duckduckgo.com" " text" " Acceptable Use Policy"  
74+                 {" url" " https://openedx.org" " text" " Privacy Policy"  
75+             ], 
76+         } 
77+ 
78+ 
79+ container).
5180
5281.. _MFE's config mechanism : https://github.com/openedx/frontend-platform/blob/master/src/config.js 
5382
83+ Styles
84+ ====== 
85+ 
86+ Since the root of the footer component is rendered as a footer HTML element, it
87+ is unique enough to use ``footer `` as selector. To make it more convenient to
88+ style footer's children, we will add unique class names, which will simplify
89+ the SCSS selectors.
90+ 
91+ These SCSS styles can be put in a custom `branding package `_ into
92+ ``paragon/_overrides.scss ``.
93+ 
94+ .. _branding package : https://github.com/openedx/brand-openedx 
95+ 
5496Consequences
5597************ 
5698
@@ -59,27 +101,17 @@ Consequences
59101
60102======== 
61103
62- * Styles and additional content (i.e. all the customizations to the component)
63-   can be configured in the same place (or at least using the same API).
64- * Can set defaults at build time, and overwrite them at runtime.
65- * Have the option to do at build time.
66- * Can customize for each MFE independently.
67- * Using ``eox-tenant `` can customize per tenant (org, microsite).
104+ * There will be an option to make the MFE footer look similar to the legacy UI
105+   footer, without having to create and maintain a fork.
106+ * Can add custom text/urls for links, unlike what branding v1 API allows.
68107
69108Negative
70109======== 
71110
72- * At the time of writing, Tutor doesn't pass ``env.config.js `` or environmental
73-   variables at build time, which means that anyone using tutor directly, or
74-   tools that are built on top of it (e.g. Grove, cookiecutter-openedx-devops)
75-   will have to use ``MFE_CONFIG `` Web API.
76- * There exist branding mechanism and theming mechanism for styling MFEs, and
77-   the styles are expected to go there. The consequence of the decision above is
78-   that the styles will be in a separate place.
79- * Developers/designers would have to edit CSS styles and classes in the
80-   python/yaml/js files, which can be inconvenient.
81- * Configuration keys through which the customizations are exposed can
82-   potentially overlap, causing collisions. Hard to catch and debug.
111+ * There are already parameters that allow configuring the footer links for the
112+   legacy UI, which means that configuration will be duplicated (potentially in
113+   multiple places), in cases when the aim is to make the links in the legacy UI
114+   and MFE footers that same.
83115
84116Rejected Alternatives
85117********************* 
@@ -97,23 +129,30 @@ same as the cons from decoupling.
97129Styling using CSS variables
98130=========================== 
99131
100- Exposing styling customizations through the CSS variables would give a benefit
101- of being able to set the customizations in the branding package, together with
102- the rest of the styles. The cons however, are that it would be harder to
103- customize it for different MFEs and tenants, because you would need different
104- branding packages for each, and the customization options would be limited to
105- changing only the CSS attributes we decide can be changed, because you can't
106- set arbitrary styles through a CSS variable, only a value for a CSS attribute.
107- 
108- Styling using classes
109- ===================== 
110- 
111- We could add CSS classes to the component, so that the styles for those
112- components could be defined in a branding package using the CSS classes as
113- selectors. Pros and cons of this alternative are similar to the one above, for
114- the exception that it is possible to define any number of CSS attributes in a
115- style block, and child elements can be referenced using CSS selectors, allowing
116- a greater degree of customisability.
132+ Exposing styling customizations through the CSS variables would be similar to
133+ styling via CSS classes, and it would be better aligned with the current
134+ philosophy of Paragon, since it prefers CSS variables over custom CSS classes.
135+ 
136+ The cons however, is that you can only expose one CSS attribute per variable.
137+ This means that we would either heavily limit the styling options, or would
138+ have to create many variables for each element and CSS attribute.
139+ 
140+ Brading API V1
141+ ============== 
142+ 
143+ LMS already has an API endpoint which could be used to retrieve the links that
144+ are used in the footer (legacy UI footer uses the same API) in JSON format -
145+ ``api/branding/v1/footer ``.
146+ 
147+ The pros of using this approach would be that legacy and MFE footer would use
148+ the same API and would have the same links, without having to duplicate the
149+ configuration.
150+ 
151+ The cons of using this approach are:
152+ 
153+ * It would be necessary to make an additional API call from an MFE to get the
154+   links.
155+ * No custom links, only what is allowed by the branding API.
117156
118157..  References
119158..  **********
0 commit comments