GithubHelp home page GithubHelp logo

carbon's Introduction

Carbon (by Steadfast)

Steadfast's starter project - Craft CMS, DDEV, and Vite

  • See carbon-setup.md for instructions on setting up a new project using Carbon
  • See the slab docs for instructions on converting a Stallion project to Carbon
  • Find information about Carbon's features here

carbon's People

Contributors

btbunze avatar dev-besteadfast avatar drewtjohnson avatar gramirez22 avatar jakedohm avatar jalendport avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

carbon's Issues

Suggestion: move to Vizy for all rich text needs

We currently use Redactor ๐Ÿคฎ for our Rich Text fields, and Vizy for complex text fields (that need non-text blocks). If we're going to leverage Vizy for most projects, I think it makes sense to build all of our Rich Text fields with it as well.

A couple reasons:

  1. The UI is nicer
  2. The config is simpler
  3. If we need to add blocks in the future, there's no migration needed (this is pretty likely to happen)
  4. It means we only have one system for all of our text needs, which makes learning and knowledge retention easier.

Questions:

  • Is it harder to extend/build on top of?
  • Does the cost matter?

Auto-register Vue components

TLDR

Components in src/js/components should be auto-registered into Vue, so you don't have to manually import each component.

Spec

  • Components in src/js/components and all subfolders will be automatically registered
  • Component name will match the filename. Button.vue becomes <Button>
    • Note: this will require the developer to make sure they don't name two components exactly the same, which I'm fine with.
  • Lazy loading: If some components aren't required on page-load, we should be able to lazy load them. To lazy load a component, you name the file ComponentName.lazy.vue

This also will take care of #25.

Switch to using ESM for Tailwind & Carbon config file

Currently we're using CJS (CommonJS) for our Tailwind config and carbon config file (currently named stallion.cjs, #48). This is because Tailwind didn't support ESM previously. But in a newer version of Tailwind, ESM is now supported. So, let's upgrade Tailwind and then convert over to ESM.

Figure out when to run `composer install` automatically

We currently have this issue a lot.
CleanShot 2023-11-07 at 12 17 55@2x

Where someone adds a Composer or NPM dependency to the project, and then someone else pulls down their work and is missing that dependency.

This goes hand in hand with the issue of when to pull the database, or apply Project Config changes.

Let's discuss!

Rename things

Rename anything named "stallion" to "carbon".

Example: /config/build/stallion.cjs

Add aria-expanded and aria-haspopup to expanding menus/accordions

For dropdown menus, accordions, or anything else that opens another section in the DOM should have the aria-haspopup and aria-expanded attributes on them.

These attributes tell screen reader users that another section has opened when interacting with typical DOM nodes. The surgery center repos all have this in their main Nav elements that include a dropdown.

Modal

Name of Component(s)
Modal

Filename(s)
Modal.vue

Purpose
Display information in a focus-locked panel

Functionality

  • The modal should have two states, open and closed
  • Any number of buttons should be able to open a modal
  • Any number of modals should be able to exist on a page
  • Only one modal should be allowed to be open at a time
  • Modals should appear at the end of the body
  • Focus should be trapped inside modal while open
  • Modal should be able to be closed by clicking the background, clicking a close button, or pressing esc

State

  • Global
    • openModal(id) - Opens modal by id
    • closeModal() - Closes open modal
    • activeModalId - Id of the currently open modal

Props

  • hasOverscroll - decides how to handle overflow content
  • initialFocus - decides what element to focus when modal opens
  • id (different name?) - for distinguishing between modals

Content Slots

  • Panel Content - Contains all content of the modal's panel

Dependencies

  • HeadlessUI
    • Dialog, DialogPanel, DialogTitle, DialogDescription, TransitionRoot

Add icons volume by default

One thought on this: we probably need to have the icons volume be automatically re-indexed on deploy, so that new icons that are added via Git appear in the CP automatically without needing to re-index via Utilities

Accordion

Name of Component(s)
Accordion
Accordion Item

Filename(s)
Accordion.vue
AccordionItem.vue

Purpose
Display information in coordinated, toggleable disclosures

Functionality

  • An accordion item should have two states, open and closes
  • An accordion should be able to have any number of accordion items as children
  • A user should be able to use tab to navigate between accordion item buttons
  • A user should be able to press enter/space (when focusing) or click to open/close an accordion item
  • An accordion should have the ability to limit its children to only one open at once
  • An accordion should have the ability to scroll the viewport to a child when it opens
  • An accordion item should be able to be open by default

State

  • Accordion Item
    • Open/closed

Props

  • Accordion
    • exclusiveOpen - whether to only allow 1 item to be open at a time
    • scrollOnOpen - whether to scroll to an item when it opens
    • defaultOpen - set which (if any) disclosures should be open by default
  • Accordion Item
    • defaultOpen set whether the disclosure should be open by default

Content Slots

  • Accordion Item
    • button - content of the disclosure button
    • content - content of the disclosure panel

Dependencies

  • HeadlessUI
    • Disclosure, DisclosureButton, DisclosurePanel, TransitionRoot

Notes
The state of a Disclosure is contained within and managed by itself, so I think the best way to coordinate the items is to watch the data-headlessui-state attribute for each and send necessary instructions to the disclosures when one changes. The alternative, having the Accordion keep track of the state of all its children, would mean keeping (and having to sync) state in multiple locations.

Rename "webpack" volume to "node"

Currently the naming of the Docker volume "webpack" seems a bit odd because I'm usually using it for non-webpack tasks like adding dependencies or running our icon builds. I think "node" makes more sense because we're running node commands in that volume.

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.