Git Product home page Git Product logo

Comments (7)

BenGamma avatar BenGamma commented on June 15, 2024

styled-component seems to be an efficient & unified css workflow for react
https://github.com/styled-components/styled-components
https://material-ui.com/guides/interoperability/#styled-components

from community-platform.

chrismclarke avatar chrismclarke commented on June 15, 2024

It makes sense once/if we decide to build our own component library (likely based on material-ui). Suggest that as you work on the docs page component you try to move 'core' components into a shared library and include styled-components.

I don't think we need to explicitly have a 'new component' template, but components we create should follow a consistent pattern which others can then base new ones on.

As for naming conventions, I think prettify enforces some (like upper case) but agree we need some extra conventions. I suggest:

  1. TS Classes should end with an identifier, namely their parent folder type e.g. the home page class falls within 'Pages' and should have class 'HomePage'. Similarly the login component which is a general component falls within 'components' and has class name 'LoginComponent'. This helps keep clear the naming where the login component also has a parent container (to handle global state binding) which is called 'LoginContainer'.

  2. Ideally we want to avoid the situation where you will have multiple tabs open with the same name (i.e. Login and Login for both container and component), and as such components and pages can retain just their simple file name (e.g. components/Login.tsx and pages/Home.tsx) but everything else should have .[identifier], e.g. containers/Login.container.tsx or user model models/User.model.tsx

  3. CSS classes should follow standard BEM naming - i.e. lower cases, hyphen spaces, double underscore child class and double-dash modifiers. See link for example stickMan element css of .stick-man, .stick-man__head and stick-man__head--big

If you're happy with this we can add it to the contribution guidelines, create a few example components and close

from community-platform.

chrismclarke avatar chrismclarke commented on June 15, 2024

Templates are currently being produced for general components, pages etc. (#72) It would be good to also populate with some styling info once we decide

from community-platform.

chrismclarke avatar chrismclarke commented on June 15, 2024

(I say decide, we've decided to go ahead with styled components so now just need to implement)

from community-platform.

BenGamma avatar BenGamma commented on June 15, 2024

Yep on my todo, I will implement it as soon as we release the documentation ✌️

from community-platform.

BenGamma avatar BenGamma commented on June 15, 2024

Now that styled-component is implemented with most our components, I would like to add a few things to this thread :

  • For efficiency and clarity, styled-components needs to be the default tool used when building the interface, instead of scss. I'll make a example file in page/_Templates that shows how to use it easily in the project.
  • There is still some components using scss : pages/common/Tags, pages/common/UploadedFiles, pages/Events. It's on purpose. They will be refactored later when the final design will be defined.
  • When our design system will be defined, all the shared components will live in components/ like it's already the case for our Button and Form components.

from community-platform.

BenGamma avatar BenGamma commented on June 15, 2024

Frontend structure is now defined and explained in the dedicated wiki section

from community-platform.

Related Issues (20)

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.