Skip to content

Conversation

@ciar4n
Copy link
Contributor

@ciar4n ciar4n commented Sep 30, 2019

Pull Request for Issue # .

Summary of Changes

  • Reduces defined CSS variables. atum-bg-dark variables combined to a single primary variable
  • Remove the need for template php color helper file
  • Refactors template options. Changes 'primary color' from hue format. Renames 'special' to 'secondary'
  • Remove fill from logo SVG. Applies primary color to logo
  • Removed some unneeded CSS declarations (removed or changed to inherit)
  • Made template color options reactive. Template colors change as you change the input....

XPk1bcQ4FT

Testing Instructions

Apply this patch and run node build.js --compile-css and node build.js --compile-js to update the changed SCSS and JS. Alternatively, you can run npm i.

Navigate to admin template style settings. Check color options. General color check across template.

Documentation Changes Required

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.0-dev labels Sep 30, 2019
@wilsonge
Copy link
Contributor

@bembelimen are you able to take a look through this and make sure nothing on your guys side has regressed in the template options?

@wilsonge
Copy link
Contributor

wilsonge commented Sep 30, 2019

The system tests failing here are actually due to this PR.

141 | 18:41:49.747 SEVERE - http://localhost/test-install/media/templates/atum/js/template.min.js?b3f9923a4b6a60cad8a308ec588d0a0b 0:4691 Uncaught TypeError: Cannot set property 'onchange' of null
142 | 18:41:49.990 SEVERE - http://localhost/test-install/media/templates/atum/js/template.min.js?b3f9923a4b6a60cad8a308ec588d0a0b 0:4691 Uncaught TypeError: Cannot set property 'onchange' of null
143 | 18:41:51.382 SEVERE - http://localhost/test-install/media/templates/atum/js/template.min.js?b3f9923a4b6a60cad8a308ec588d0a0b 0:4691 Uncaught TypeError: Cannot set property 'onchange' of null
144 | 18:41:53.661 SEVERE - http://localhost/test-install/media/vendor/joomla-custom-elements/js/joomla-alert.min.js?b3f9923a4b6a60cad8a308ec588d0a0b 0:1742 Uncaught TypeError: Cannot read property 'removeChild' of null
145 | 18:41:55.54 SEVERE - http://localhost/test-install/media/templates/atum/js/template.min.js?b3f9923a4b6a60cad8a308ec588d0a0b 0:4691 Uncaught TypeError: Cannot set property 'onchange' of null

The removeElement thing is fine - it's not due to this PR but the onchange is - I assume we need to wrap and if statement around if the element being retrieved by ID is actually found on the page.

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 1, 2019

Thank you. Should be good now.

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 1, 2019

@wilsonge Assuming ozdemirburak/iris is not used elsewhere, I guess I can remove the following from composer.json ? ... https://github.com/joomla/joomla-cms/blob/4.0-dev/composer.json#L84

@brianteeman
Copy link
Contributor

It is really simple - you cannot achieve the intended aim of enforcing an accessible colour scheme using the hue field AND have the other field selects. It is one or the other.

@coolcat-creations
Copy link
Contributor

completely agree on that, that was never the intention back then to have the other selections...

@ciar4n
Copy link
Contributor Author

ciar4n commented Oct 22, 2019

I'm not sure where to go with this. I can delete all the color options, leaving it open for someone to create different themes as suggested by @coolcat-creations and @nadjak77? This PR still cleans up the CSS and with a few additional changes would makes theming easier.

Alternatively I leave as is. If we want a user to be able to define colors in the template options then this PR offers a CSS only, slimmer, client side solution. As suggested by @dgrammatiko this can probably be extended with JS but personnally I believe that is not required.

Lastly of course I can just close it.

@brianteeman
Copy link
Contributor

Unfortunately as the template team did most of their work through direct commits there is no pull request which documents the intent of that hue field. I do note however that it was added to the template when it already had those other colour fields so it does seem odd to me that it wasn't considered that they cannot work together.

@dgrammatiko
Copy link
Contributor

Many moons ago I did a small experiment to prove that we are all doing it wrong!
The code is public: https://github.com/dgrammatiko/scss-wasm-compile
What it does?
It compiles the template css from the source scss in the browser. So on install/update the template could recompile given any number of scss variables (colours or whatever). The only thing that is missing is a form that will store the scss variables in the db.

Did I mention that PHP is not the right tool for css works? I did, but let me repeat, PHP is not the right tool for scss/css works

@wilsonge
Copy link
Contributor

OK so given we're having the chat here. What about if we decided to flag to the user in the interface if their chosen colours have a11y compliant contrasts or not (at the various levels). Because @dgrammatiko is right in the context we really shouldn't be compiling this after the params are saved. At worst it should be done at the point where we save the params (with JS if required).

My recollection of this discussions is that initially the values were supposed to be precomputed. However at a later point the decision was made in order to support company colour schemes that may not be a11y by default people could choose to manually override the colour schemes to create their own branded themes that obeyed a brand manual that wasn't a11y by default. However for most people the intention was they'd only need to set primary/secondary colour styles

@brianteeman
Copy link
Contributor

Not sure what you mean about flagging up? Something like https://whocanuse.com/ ?

@wilsonge
Copy link
Contributor

Yup something exactly like that obviously less items in the list than that to not make the UI too complicated. So by default we're accessible (and can achieve this in JS etc). If people override the schema then we can show them what QA they are/aren't meeting

@brianteeman
Copy link
Contributor

No idea how to do that but at least I understand what you mean

@dgrammatiko
Copy link
Contributor

dgrammatiko commented Nov 25, 2019

At some point I saw in my tweeter feed a very nice solution for this exact problem. I just need to find it

EDIT: found it: https://twitter.com/kevgski/status/982714455300583424?s=21

@C-Lodder
Copy link
Member

There it is! Spent ages trying to find that

@brianteeman
Copy link
Contributor

that looks perfect @dgrammatiko

@dgrammatiko
Copy link
Contributor

@brianteeman hm, it seems overkill for the task tho. Let me explain it has a hard dependency
to d3 (gzipped 150% the size of jQuery). This can be implemented with waaaaay less code, eg https://github.com/dequelabs/axe-core/blob/develop/lib/checks/color/color-contrast.js
This is from the axe library that G-lighthouse is using for the a11 tests.
Conceptually the task in hand is pretty simple: get the relationship between the inputs (foreground, background) and constantly check their values (printing the contrast ratio as a label or whatever)

@wilsonge
Copy link
Contributor

D3 is a large library and does enough major version updates could be a bit of a concern :/ However practically speaking we need something that's not going to take forever to implement bearing in mind we have only a handful of quality javascript contributors to the CMS...

@dgrammatiko
Copy link
Contributor

However practically speaking we need something that's not going to take forever to implement

FYI that demo doesn't reflect to a oss repo

@brianteeman
Copy link
Contributor

The code in the demo is at https://github.com/KevinGutowski/KevinGutowski.github.io

As there is no licence listed we cannot use it (unless we ask - which is worth it I think)

@brianteeman
Copy link
Contributor

I don't care how it is done technically but I am sick of hearing that it can be done better if .... and then it stalls because there is no one with the time/skill/will/energy to do it.

@ciar4n
Copy link
Contributor Author

ciar4n commented Feb 14, 2020

Do I close this?

@wilsonge
Copy link
Contributor

Let's go for this and use the library @dgrammatiko is suggesting to feedback to users about whether their colours meet a11y requirements

@brianteeman
Copy link
Contributor

perhaps wait until @angieradtke has finished??

@wilsonge
Copy link
Contributor

yes we should wait on that

@ciar4n
Copy link
Contributor Author

ciar4n commented Feb 16, 2020

perhaps wait until @angieradtke has finished??

If you are gonna merge this, it should probably be done before any major work. My initial reason for this PR was to clean up the atum scss before an attempt to repaint it.

@angieradtke
Copy link
Contributor

angieradtke commented Feb 17, 2020 via email

@ciar4n
Copy link
Contributor Author

ciar4n commented Feb 17, 2020

  • Reduces defined CSS variables. atum-bg-dark variables combined to a single primary variable
  • Remove the need for template php color helper file
  • Refactors template options. Changes 'primary color' from hue format. Renames 'special' to 'secondary'
  • Remove unneeded CSS declarations

@angieradtke
Copy link
Contributor

@ciar4n

Does anybody know why this is so complicated?
Why is the background not at the body-element ?
What did I miss?

body .container-main {
  position: relative;
  min-height: calc(100vh - #{$header-height} - 3px);
  padding-left: 0;
  padding-right: 0;
  overflow: auto;
  &::before,
  &::after {
    content: '';
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
Use the ../images/joomla-pattern.svg through https://yoksel.github.io/url-encoder/
 background: var(--atum-bg-light) url("data:image/svg+xml,%3C%3Fxml version='1.0' ...... ;
    background-size: 15rem;
  }

  &::after {
  /*  background: linear-gradient(135deg, var(--atum-bg-light) 0%, var(--atum-bg-light) 20%, rgba(225, 229, 231, 0) 100%); */
  }
}

@ciar4n
Copy link
Contributor Author

ciar4n commented Feb 17, 2020

@angieradtke

Look like it is to apply both an SVG and a gradient to the background. As each use background-image property, to apply both they had been moved to pseudo-elements.

If you are removing either the SVG or gradient in your design then you can remove all this and just apply to .container-main. I'm sure the gradient can go as it is barely noticeable.

@ciar4n
Copy link
Contributor Author

ciar4n commented Feb 23, 2020

Closing. Now 5 months behind. To much work involved to bring up to date.

@ciar4n ciar4n closed this Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Composer Dependency Changed Conflicting Files Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester

Projects

None yet

Development

Successfully merging this pull request may close these issues.