Code Monkey home page Code Monkey logo

cwp-watea-theme's Introduction

CWP Wātea theme

CI Silverstripe supported module

The Wātea theme can be installed on top of the Starter theme (see cascading themes) to provide a more visually appealing start to a CWP website.

Screenshot

Installation

composer require cwp/watea-theme

Documentation

You can find documentation on how to use this theme in the CWP Developer Documentation: Using the Wātea theme.

You may also find the documentation for the Starter theme useful: Customising the starter theme.

Development requirements

Versioning

This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.

All methods, with public visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.

cwp-watea-theme's People

Contributors

brettt89 avatar clarkepaul avatar dependabot[bot] avatar dhensby avatar dnsl48 avatar elliot-sawyer avatar emteknetnz avatar github-actions[bot] avatar guysartorelli avatar lexakami avatar lhalaa avatar masseyisaako avatar matias-silverstripe avatar maxime-rainville avatar newleeland avatar nightjar avatar pjayme avatar raissanorth avatar robbieaverill avatar sabina-talipova avatar sachajudd avatar scopeynz avatar scott1702 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cwp-watea-theme's Issues

There is no permanently visible label for the search field.

Medium priority:
There is no permanently visible label for the search field. The placeholder text should not be used as a replacement for a label.

image

When a person enters information into an input, its placeholder content will disappear. The only way to restore it is to remove the information entered. This creates a challenging experience for users with cognitive impairment where guiding language is removed as soon as the person attempting to fill out the input interacts with it.
Solution: Provide a permanently visible "Search" label.

Note: Could possibly be needed to be ported into Starter too.

cc @silverstripeux

3.0: Watea theme has duplicate nested search forms in the header

<div class="main-nav">
   <nav class="navbar navbar-expand-md navbar-dark" aria-label="Main navigation">
   <div class="container">
   <div class="col-12">
   <div class="collapse navbar-collapse" id="navbar-collapse">
   <form class="form-inline d-block d-md-none" action="/search/SearchForm">
    
   <div class="site-header-search ">
   <form id="SearchForm_SilverStripe_CMS_Search_SearchForm" action="search/SearchForm" method="get" enctype="application/x-www-form-urlencoded" class="form-inline d-none d-md-block header-search float-right" role="search">
   <div class="input-group">
   <input name="Search" aria-label="search" type="text" class="form-control" placeholder="Search...">
   <div class="input-group-append">
   <button type="submit" class="btn btn-secondary">
   <i class="fa fa-search" aria-hidden="true"></i>
   <span class="sr-only">Search</span>
   </button>
   </div>
   </div>
   </form>
    
   </div>

editor.css is not exposed

In order to be automatically included in the TinyMCE bundle, it needs to be in css/editor.css and listed in vendor-expose.

Menu navigation doesn't display when page is upside down

Version(s) affected

3.0.0, but probably affects all versions

Issue

The menu navigation works fine when viewing the page is not inverted.

image

However, when the page is upside down, the menu navigation does not display correctly as the carousel image is overlaying on top of the dropdown. The carousel image also seems to overlay on top of the carousel controls/heading, making the site even less accessible.

image

Note: when taking the background-image off the carousel items, the navigation and carousel controls work correctly.

image

Links are distinguished within the sentences by use of colour alone.

Note: CWP demo site: (Quicklinks section)

Medium priority:
The "Introducing CWP 2.0" and "the CMS" links are distinguished within the sentences by use of colour alone.

image

People with low vision/colour vision difficulties will be unable to distinguish that these are links. While some links may be visually evident from page design and context, links within text are often visually understood only from their own display attributes. Removing the underline and leaving only the color difference for such links would be a failure because there would be no other visual indication (besides color) that it is a link.

Use a method other than colour to distinguish links (e.g. bold, underline, italics).

I'd suggest using an underline in this case.

No indication that a carousel slide has changed

High priority:
Upon activating the Previous or Next carousel controls, there's no indication to non-sighted users that anything has happened.

image

There is no way for screen reader users to know that the content of the carousel has changed.

To indicate that the slide has changed, use an ARIA live region to announce the newly displayed slide. The live region should only be populated with the updated slide information upon a user activating the "Previous" or "Next" buttons. When the results screen is first loaded, the live region should remain empty. The live region should be polite, and its text content replaced with something like "Slide 1 of 3:" as appropriate when the slide changes, e.g.

<div aria-label="polite" class="sr-only">Slide 1 of 3: CWP 2.0 is here</div>

Should have editor.css by default

Would be nice to have some basic editor.scss / editor.css functionality so that the customer doesn't have microscopic fonts in tinymce

editor.scss can literally be a copy / paste from the top of main.scss

editor.scss:

// Watea theme specific variables and overrides
@import "./variables";

// Starter theme styles
@import "../../../starter/src/scss/main";

// Watea theme mixins
@import "./utils/mixins";

// Watea theme styles
@import "./typography";

Use 'Yarn build' instead of 'Yarn package' for themes

At the moment when compiling dist files and making a commit you have to run 'yarn package'. This is different from our other modules (admin etc.) which use 'yarn build'. It'd be good if we could update these for consistency for how we compile across SS.

Provide more information about agency extensions in the readme

The suggested agency-extensions module is a key module to providing additional benefit to a CMS user working with a site using Wātea. We should be making this more clear in the docs, including describing what those features are, in order to entice anyone reading this ReadMe to also install agency-extensions

Force https for CDN request in frontend template

We've currently not enforcing that sites with this module access the following CDN over HTTPS, which apparently could be as simple as appending 'https' to the link, here:

<% require javascript('//code.jquery.com/jquery-3.3.1.min.js') %>

Uncovered this while running a browser security checker tool, message: Subresource Integrity (SRI) not implemented, and external scripts are loaded over HTTP or use protocol-relative URLs via src="//..."

See guidance from Mozilla: https://infosec.mozilla.org/guidelines/web_security#resource-loading

Theme Activation issue

[User Warning] None of the following templates could be found: Array ( [0] => Array ( [type] => Includes [0] => HeaderSearch ) [1] => HeaderSearch ) in themes "Array ( [0] => watea [1] => $public [2] => simple [3] => $default ) "
GET /my-project/page-not-found/
Line 215 in /var/www/html/my-project/vendor/silverstripe/framework/src/View/SSViewer.php

Not been able to activate the watea theme on my project in config.yml file.

Dropdown item colour

Regression I'm noticing from the accessibility work. The text colour should be #555 it looks like it needs more specificity to override 'body.theme-accent-default-accent a:not(.btn)'

Screen Shot 2019-07-24 at 3 38 48 PM

Finish SS4 upgrade

Previously started, ensure that all templates are in the correct file path and regression test.

Make agency-extensions a requirement

Overview
Currently cwp/agency-extensions is only marked as a suggested module when installing this module.

The concern is that without prior knowledge of the agency-extensions module, it won't be installed on a site and CMS users will be missing out on additional functionality.

RFC
Given these concerns, I'm suggesting we add cwp/agency-extensions as a composer.json requirement and update the this modules docs to list the additional functionality that would be provided.

Version affected:
dev-master / new major branch

Notes:

  1. This module is about to receive a new major branch utilising Bootstrap4, this maybe a good time to include agency-extensions as well.
  2. Some of the additional features would be opt-out by default, any new docs should make that clear.
  3. I'm not yet sure of what the backwards compatibility concerns would be for someone upgrading this module to the suggested new version.

Layout Templates Should Reflect Counterpart Namespaces

Unless I'm missing something, default Layout templates should exist in a folder hierarchy that matches the namespace of the PageType to which they belong. In this case, it's:

templates
  CWP
    CWP
      PageTypes
        Layout
          EventPage.ss
          NewsPage.ss
          ...

Carousel buttons and indicators do not meet contrast standards

Medium priority:
The blue carousel buttons are not clearly visible due to the low contrast ratio against their adjacent background (Foreground: #0F7EB2; Background:#various). The same issue occurs with the carousel indicators, especially the ones that are greyed out.

image

People with low vision or colour vision difficulties will be unable to clearly discern the buttons. Use a Contrast finder tool to choose and set a different element colour or background colour to meet the necessary contrast ratio of 3:1 against adjacent colours for all instances of this colour combination (includes focus and hover states).

cc @silverstripeux

We could consider darkening the mask again also. Note: that the white border buttons did not come up as being unaccessible so we could do something similar?

Carousel indicators are not keyboard accessible

High priority:
The carousel indicators work for mouse users, but they are not keyboard accessible, and they have no content or accessible name, so are not announced by screen readers.

image

Users who rely on keyboard will not be able to access these carousel indicators or know what their purpose is.

If they were focusable and keyboard accessible buttons, they should have content like "Slide 1 of 3". As a list of buttons for controlling the carousel, they should have a group name, which can be done with aria-label="Slide controls" or similar on the <ol> Example:

<ol class="carousel-indicators" aria-label="Slide
controls">
   <button aria-label="Slide 1 of 3" class=""><li
data-target="#carousel-slide" data-slide-to="0"
class="" name="carousel-item-1"></li></button> ...
</ol>

There's no programmatic indication that the entire widget is a carousel, nor of the purpose of the carousel

High priority:
There's no programmatic indication that the entire widget is a carousel, nor of the purpose of the carousel.

image

There is no way for screen reader users to understand the purpose or role without a programmatic indication that the widget is a carousel.

Apply role="region" and aria-label="Slideshow: CWP 2.0 Theme" or another meaningful and descriptive name to the entire widget's container. Example

<div id="carousel-slide" data-ride="carousel" class="carousel slide text-center" role="region" aria-label="Slideshow: CWP 2.0 Theme">

The region role serves to encapsulate the carousel widget as a discrete unit, making it easier for screen reader users to navigate past as a whole so the "End of carousel" div should be removed (elements that are in the tab order should be focusable anyway).

Remove:

<div tabindex="0" class="sr-only"> End of carousel.</div>

Add npm linting and built dist file comparisons to Travis

Many of the core SilverStripe modules with notable frontend assets now have npm linting and build dist file comparisons in Travis to ensure that (A) new changes lint correctly, and (B) that the dist files are correctly rebuilt.

We should add this as a single build step for the CWP themes.

This module would also need to run npm install from inside the starter theme before doing this.

Related: silverstripe/cwp-starter-theme#58

Pull requests

Colour picker styles override badge link colours

Watea 3.0.x-dev

image

The "Spam it" and "Reject it" buttons have the markup <a ... class="btn btn-warning">...</a> for example, and should have white text from default Bootstrap functionality. The CSS specificity is too high from the colour picker functionality, so the text is blue instead.

image

News displays Created instead of Date

NewsSummary.ss

<time datetime="$Created.Nice">{$Created.Nice}</time>

should probably be

<time datetime="$Date.Nice">{$Date.Nice}</time>

Date is the cms editable one, and is what's used for sorting NewsPage's

Wātea theme's navigation menus (MainNav.ss) are not accessible

The navigation needs to be properly audited for accessibility against WCAG 2.1, and tested using multiple assistive technologies, across multiple platforms. You'll discover a range of severe accessibility issues with the navigation implementation. The code needs to be reviewed and remediated by somebody with a high level of accessibility knowledge (testing, semantic HTML, correct ARIA usage, etc).

I'd suggest, at a minimum, the navigation should be tested with:

  1. VoiceOver on iOS
  2. VoiceOver on macOS
  3. NVDA on Windows
  4. JAWS on Windows
  5. TalkBack on Android
  6. Keyboard-only
  7. axe DevTools

Some current issues I've picked up are:

  • Navigation menus cannot be announced by VoiceOver on iOS, with each menu item simply announced as "menu item" - therefore making it impossible for VoiceOver users to know what the menu item actually is
  • Keyboard-only users on desktop cannot access expanded dropdown menus in the navigation - the keyboard focus just skips over the expanded content
  • Improper use of role=menubar, role=menuitem, role=menu - this results in a huge amount of audio clutter for screen reader users e.g. the "expand" buttons are announced by NVDA on Windows as "menu item menu button collapsed subMenu Display Features submenu pages" - this has a huge amount of clutter and makes the interface hard to understand for screen reader users

Recommendations:
Look at the navigation implementation on digital.govt.nz, how it does not use the menubar/menu/menuitem roles, and provides a screen-reader and keyboard-accessible experience

Unaccessible colours Wātea 3.0

Just installed the latest version of Wātea (3.0) and the Site name, site tag line and search border in desktop and mobile should be white, this includes the mobile menu border and icon. I think some colours are coming through from the styles 'colour: inherit.'

Also noticing some white borders in mobile above/below the search which shouldn't be there.
image

I'm also noticing the nav items seem to be darker than usual:
image

Looking through James' Wātea Plus designs the nav items are white.
Hover: Border should appear with no text changes and should be placed on the nav bar rather than below it. Current page: Text should be bold and border should be present.
See #36 for more details.

See designs here: https://invis.io/AWO7CJSK426#/331473258_Wa-tea_Plus_Content_Page

cc @silverstripeux

[3.0] Breadcrumbs included in search results break accessibility

CWP 2.3.x-dev with Watea 3.0.x-dev

A new feature in Wātea 3.0 (over 2.x) is that breadcrumbs to each page are included in the search results. There are some issues with that:

  • BreadcrumbsTemplate.ss in starter theme assumes it will be shown once in a page, and provides an accessibility label "You are here" pointing at the ordered list of breadcrumb items - this isn't true in the case of search results
  • As above, the label has an ID attribute (which must be unique in the document)
  • I'm not sure it has been considered if items other than pages are in the search results, e.g. files - presumably breadcrumbs wouldn't be relevant for files

cc @silverstripeux @jamessilverstripe

image

Axe report

IDs used in ARIA and labels must be unique

Issue description: Ensures every id attribute value used in ARIA and in labels is unique

Impact: critical
Element location: article:nth-child(1) > header > nav[role="navigation"] > p
Element source: <p class="sr-only" id="breadcrumbs-label-">You are here</p>
To solve this violation, you need to fix the following:

  • Document has multiple elements referenced with ARIA with the same id attribute: breadcrumbs-label

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.