Giter Club home page Giter Club logo

aybolit's Introduction

Aybolit

Aybolit is a lightweight, standards-based, framework agnostic UI components library built with LitElement.

Aybolit is a fictional character from the children's poems by Korney Chukovsky. He is a traveling doctor who treats animals for free, regardless of their injuries. The name may be translated as "Ouch, [it] hurts!"

Live Demo ↗

Size Limit code style: prettier

Overview

Aybolit is based on the modern web standards: Custom Elements, Shadow DOM and CSS Custom Properties. Using these parts of the web platform allows Aybolit to easily solve several common problems which have been around for years:

  1. Proper style scoping and zero global CSS! With Aybolit you are safe to use any CSS class name in your project, and never get any side effects. Forget about the evil hacks like using !important to override 3rd party CSS specificity.

  2. Granular DOM structure. You no longer have to place HTML elements in the specific order to satisfy CSS selectors like input ~ label - these are now implementation detail. The resulting markup is cleaner, easier to read and maintain.

  3. Flexible theming API: custom CSS properties and calc() allow to dynamically change colors at any part of the cascade, and make it possible to auto-adjust level of contrast for elements like buttons and checkboxes.

The mission of Aybolit is to let developers stop reinventing the wheel, and ensure a painless developer experience. Aybolit starts with the basics and provides a few primitive UI components, laying the groundwork for a lot more in future.

Project Structure

Aybolit project is a monorepo and contains the following npm packages:

  • @aybolit/core - components base classes with "normalized" styles.

Check the README of each individual package for more details.

Supported Browsers

Chrome, Firefox 64+ and Safari 11+ are targeted browsers. They all support Custom Elements, Shadow DOM, custom CSS properties and ES modules, and do not need any polyfills.

Any up-to-date Chromium-based browsers, like Samsung Internet, Opera, Vivaldi, Brave, Yandex Browser and many others, are supported too. Microsoft Edge will hopefully join this group later this year.

Internet Explorer is not officially supported. It is generally possible to make web components work in IE11 using polyfills and Babel, but certain things will not work as expected to say the least.

Contact

If you have questions, feedback or anything to share related to the project, feel free to contact me via:

aybolit's People

Contributors

anoblet avatar anxalicious avatar chanar avatar dominik-stypula-polcode avatar freudflintstone avatar henerhoop avatar kertuilves avatar litill avatar lkraav avatar matevarju89 avatar paulkirspuu avatar pawelkmpt avatar phkel avatar saas786 avatar tomasced avatar web-padawan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aybolit's Issues

Common Card component

1. Global changes to the card

2. Course cards

image

  • Show Course tag
  • Tag colour is CXL red lumo-primary-text-color: hsl(355.8, 74.7%, 48%);

3. Minidegree cards

image

  • Show Minidegree tag
  • Change colour to var(--lumo-secondary-text-color)

4. Hub cards

image

  • Show Playbook hub tag
  • Change colour to var(--lumo-secondary-text-color)
  • Link the title of the hub to the Title in the card
  • If there is no title, then use the last level as title
  • Show playbook and child hub count
  • Show section owner (if exists), otherwise empty
  • Show about section if exists, otherwise empty
  • show the breadcrumb (up to 3 levels only, prioritize last)
  • Show open CTA

5. Playbook Cards

image

  • Show Playbook tag
  • Tag colour is CXL red lumo-primary-text-color: hsl(355.8, 74.7%, 48%);
  • Link the title of the playbook to the Title in the card
  • Show total steps
  • show author followed by the author name
  • show the breadcrumb (up to 3 levels only, prioritize last)
  • Show open CTA

Jobs: UI Components

Slack Conversation
Syed: For menu, I should use CXL UI marketing nav component?
Leho: Yes. Use everything available in CXL UI first.

Syed: Sure, but I don't remember seeing such styling in storybook for cxl ui, like for images showing shadow (as in CXL Jobs Microsite designs)?

Gallery images on absolute locations (masonry like view) (Home 02-gallery-values.jpg & Job ad-qualifications.jpg) etc. So can you please point me to relevant styles, so I won't code my own css. We can definitely move theme level styles I code to CXL UI, so should I not even bother styling anything in theme to get things going, once done can let you know relevant styles so we can move it to CXL UI?

Monorepo design

https://conversionxl.slack.com/archives/C0G52K19U/p1554816779095600

There seems to be confusion about what https://github.com/conversionxl/aybolit monorepo packages is supposed to contain. Let's plan it here.

...
packages/
|- core/
|- cxl-marketing/
   |- scss/
   |- src/
   |- tests/
|- cxl-institute-app/
   |- scss/
   |- src/
   |- tests/
|- cxl-shared/
   |- scss/
   |- src/
|- ...
|- white-label/

Hub page layout on storybook

Hub page layout

Hub page design to follow the MVP Hub Page design on figma

image

  • Use the story book layout [layout=2c-r]
  • Use CXL nav and footer from storybook
  • The footer should not be "sticky" but be at the bottom of the page.
  • Use hub card & playbook accordion cards elements
  • Hub cards are always ontop
  • Include breadcrumb
    image
  • Breadcrumb interaction - clicking on a level in the breadcrumb goes to the hub page that matches the levels, including the one pressed. If there is no hub page there, it goes to the next level up.
  • Sidebar always shows level 2 as primary and level 3 is nested

image

Handle FOUC - `:defined`?

Custom elements take time to get upgraded, which means we might see a flash of unstyled content.

https://developers.google.com/web/fundamentals/web-components/customelements#prestyle

Before an element is upgraded you can target it in CSS using the :defined pseudo-class. This is useful for pre-styling a component. For example, you may wish to prevent layout or other visual FOUC by hiding undefined components and fading them in when they become defined.

@chanar thoughts?

cxl-institute-layout: generalize towards cxl-app-layout

It's becoming apparent that <cxl-institute-layout> is too narrow of a concept for something that is generally well re-usable across many apps.

Hence we should refactor this component towards <cxl-app-layout> where different modes trigger via element attributes like theme and whatever else we need.

cc @freudFlintstone

feat(cxl-ui): cxl-context-menu = vaadin-context-menu + context content

Explore whether vaadin-context-menu can technically sanely display a context content block

@lkraav: Even if we can somehow figure out how to render an extra vaadin-context-menu panel

  • large devices - sizing of it could be a problem, if first dropdown level doesn't have many items, content panel won't fit much content... it should probably scrollbar itself
  • small devices - I don't even have any idea where to display such panel on small devices - vaadin-context-menu turns into a modal dialog there... maybe simply hoist it below menu items?

CURRENT

image

Target (adds right-most "What are playbooks?" content block):

image

Ayobolit & Vaadin front-end

CXL Storybook

Ayobilit notes:

  • Polymer Is going away - Vaadin is going to get refactored to LitElement https://lit-element.polymer-project.org/
  • Originally polymer 2 - that spec went away.
  • Continue with Vaadin - extend their components.
  • If needed create a couple of our own.
  • Anything the UI/UX designers can do to assist/document this
  • Transparency of components

Steps

  1. Data source (WP REST API, fake JSON files)
  2. API (what attributes, what's in shadow DOM, what's in light DOM)
  3. Styling (CXL UI scss folder)

Adeft Playbook viewer front-end Compenents to be converted to storybook

  • Steps > extend cxl-vaadin-accordion on storybook
  • Ratings > CXL star rating
  • Embed other components to compose the playbook viewer using CXL layout=2c-l

Criteria for what Is a component:

  • Does it have functionality?
  • Does it have state?
  • If it is just display — then doesn’t need to become a CXL UI component - no "style-only wrapper custom elements" needed
  • Usually don’t do wrapper component

When Aybolit pull request is accepted then its ready for APP

Element view specification

Desktop

Main section

  1. Breadcrumb
  2. Title
  3. Author (check with @litill about improvements made here^ regarding hiding Adeft user)
  4. Peer reviewed - no avatar. (check with @litill about improvements made here^ regarding hiding user if that user is author, and showing multiple peer reviewers.)
  5. Use case
  6. Steps

Side bar

  1. Rate this playbook
  2. Last updated - as is
  3. Courses & Lessons- only show if exists - change Label to Related Courses & Lessons
  4. Related blogs - only show if exists
  5. Tools - only show if exists

Mobile view order

  1. Breadcrumb
  2. Title
  3. Author
  4. peer review - no avatar.
  5. Use case
  6. Steps
  7. Sidebar elements in same order^

Feedback

  • Move rating to the side bar with a Rate this playbook heading. Follows order above^ Check this video for placement - loom.com/share/749d6f9c1cd148e6838c2e4607ae5758
  • Remove arrows from sidebar
    image
  • Use CXL footer

Common Dashboard layout

Storybook link

As a user I want to be able to view all my CXL learning content in a central location so I can easily access items that are of importance to me.

MVP Dashboard Figma

image

Specifications

Layout

  • Use the story book layout [layout=2c-r]
  • Use CXL nav and footer from storybook
  • The footer should not be "sticky" but be at the bottom of the page.
  • Use course/minidegree/playbook accordion cards elements
  • Minidegree and hub cards are always ontop

Sidebar

  • Use the same component that @litll used in the hub page layout
  • Only Minidegrees & Playbooks are expandable.
    image
  • The rest of the labels are single level: Feed, Roadmap, Courses, Review new contributors
  • Minidegrees - Include an item for Each minidegree that is selected by the user
  • Playbooks - Include Saved Playbooks, Include an item for Each team you are part of, My drafts and Peer review playbooks.
  • On mobile view, after selecting an item from the sidebar, the content view is triggered. Explainer

Tags

  • Tags by default are not selected
  • Tags show the number of items in each one
  • When clicked filter the content
    image

Tags by section

  • In Feed the tags are: Playbooks, Courses, Minidegrees
  • In Roadmap : Include a tag per mini degree, Started, Not started
  • In Courses : Include Started, Not started
  • InMinidegrees top level: Include Started, Not Started
  • In Playbooks top level: include Drafts, Peer review and Saved, include a tag for each team
  • In Playbooks sub level: Include Drafts, Peer review and Saved

Object visibility Logic by section - to be done when live with database.

  • In Feed show last 10 items the user has interacted with
  • In Roadmap: Show courses and minidegrees that the user has selected with the roadmap
  • In Courses: Show courses the user has selected outside of the roadmap
  • InMinidegreestop level: Include Started and Not Started
  • In Playbookstop level: include Drafts, Peer review and Saved, include a tag for each team
  • In 'Playbookssub level: IncludeDrafts, Peer reviewandSaved`

Refactor `vaadin-accordion[theme~="cxl-accordion-card"] towards flex or CSS Grid layout

https://github.com/conversionxl/aybolit/blob/cxl-ui-0.2.0/packages/cxl-lumo-styles/scss/themes/vaadin-accordion.scss is currently using masonry-style CSS columns. Example URL https://cxl.com/institute/online-courses/

image

CSS columns present some UX issues so we'd like to experiment with more traditional "fixed-row" grid next.

Main problem with accordion card grid elements is that on horizontal grids, full grid row height changes when any card in the row is opened, creating unattractive whitespace underneath unopened cards.

We need to play with fixed height and overflow to make sure grid row height stays static.

It's probably OK for opened cards to overflow cards in other rows. This is a hypothesis that needs to be proven here.

cc @freudFlintstone

Mobile: headlines are too big

After a discussion with CXL Product owner, we thought it would be a simple win, if our headlines on mobile were smaller. Some headlines have long words in them which are awkward to read.

Current situation example from iPhone 8 on content-marketing-research online course sales page
Image

NYT example on mobile
Image

Here's an example of making:
h1: 2em (main header
h2: 1.5em (in-content headers)
h3: 1.3em (accordion elements)
h4: 1.1em (Course curriculum course title on sales page)
Image

The text should probably change with the mobile menu appearing. (around 740px i think)

I did check material.io for their solutions, but I didn't dig too deep. https://material.io/design/typography/the-type-system.html

Vaadin Lumo integration and overrides

First target: Aybolit Storybook

Implications for every component:

  1. must display itself fully themed, stand-alone (=== not inside a layout component, also we may have to display some styled components in some <iframe> embed, without any layout... unless even that should have a minimal layout component, or are we moving into a general theme mixin territory here - all layout components must mixin some CXL Lumo component)

  2. (?) must explicitly import Lumo https://github.com/vaadin/vaadin-button/blob/v2.1.5/theme/lumo/vaadin-button-styles.html (alternative would be "god object layout component imports Lumo, everybody shares benefits", but that would break 1.)

  3. Is it possible to architect Vaadin Lumo style overrides https://github.com/vaadin/vaadin-themable-mixin in a logical Aybolit package structure?

Sidebar course progress widget

Analysis

Structure: (minidegree > track[foldable] >)? course[foldable] (> module)? > lesson

Live examples

Notes

Modules -> start with solving via mini-headings? (non-collapsible)

Track containers need to hold "track time" element, like Total Time: ~40 hrs (edited)
75fcff10-9dcf-418c-ba26-a96e8e2c3bc0

Iteration v1

/certificate/ url displays long minidegree sidebar widget

/course/, /lesson/ display shorter sidebar widget

cxl-marketing-nav: @pika/plugin-bundle-web inlines order-specific theme module imports

https://polymer.slack.com/archives/C6ULJ2F7S/p1573588521132400

Bundle build causes missing styles:

The custom element definition for "vaadin-tab" was finalized before a style module was registered. Make sure to add component specific style modules before importing the corresponding custom element.

  • Evaluate cxl-redesign setup w/ "load all style modules first, always"
  • Decide if we need to go global, or tweak cxl-marketing-nav dependency graph with imports/exports for now

Storybook throws JS error: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Failed to convert value to 'CSSStyleSheet'

Error:

Uncaught TypeError: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Failed to convert value to 'CSSStyleSheet'.
    at HTMLElement.adoptStyles (lit-element.ts:191)
    at HTMLElement.initialize (lit-element.ts:153)
    at HTMLElement.UpdatingElement (updating-element.ts:438)
    at new LitElement (lit-element.ts:61)
    at new <anonymous> (delegate-focus-mixin.js:29)
    at new ButtonElement (button.js:5)
    at new AbwButton (abw-button.js:4)
    at TemplateInstance._clone (template-instance.ts:97)
    at NodePart.__commitTemplateResult (parts.ts:276)
    at NodePart.commit (parts.ts:218)

Research: CSSStyleSheet
Ref: lit/lit-element#715 (comment)

Note:

This is usually caused by some kind of invalid CSS
Probable cause

 - export basically fails

cxl-lumo-styles: `<blockquote>` styles

Current styles, feel free to optimize

blockquote { --lumo-secondary-text-color: var(--lumo-tint); background-color: var(--lumo-shade); font-style: italic; margin: 0; padding: 1em var(--lumo-space-xl); position: relative;

    @mixin mixin-icon format_quote, before, true { color: var(--lumo-primary-color); font-size: var(--lumo-font-size-xxl); right: 1rem; line-height: 1; position: absolute; };

    p {
        > img { float: left; margin-right: 1em; margin-top: -1em; }
    }

}

<cxl-marketing-layout>

To start, I'm looking for a clean branch that implements only <cxl-marketing-layout>, nothing else. This should establish a baseline requirement set for everything else.

package.json "yarn build" cross platform issue.

Ref:

"build-styling": "node packages/sass-render/bin/sass-render.js -s 'packages/*/scss/**/*.scss'",

can we replace

"build-styling": "node packages/sass-render/bin/sass-render.js -s 'packages/*/scss/**/*.scss'",

with

"build-styling": "node packages/sass-render/bin/sass-render.js -s \"packages/*/scss/**/*.scss\"",

does this works on linux as well?

Works on windows if double quotes are used.

`<cxl-icon-nav-item>` should maybe render `title` attribute

I foresee a scenario where people will request "icon + label" combo, instead of just "icon + hover + tooltip".

WP is easily able to render <cxl-icon-nav-item title="Active Training">, so we could use this value to render a <label> element below the icon. font-size needs to be on the small end of Lumo scale.


  >>>

ROADMAP

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.