Giter Club home page Giter Club logo

styled-components-website's Issues

Add Babel plugin

People will look in the DevTools, see the x-Asdf123 classnames and be turned off. Let's avoid that by using the Babel plugin.

Improve SEO

I know, I know, who needs SEO anyways? But if you google the site this is what you get:

screen shot 2017-08-28 at 19 53 27

None of the content, and only the top-level pages are linked. (not even the sub-sections are there) Would much appreciate help so people can find the content on the website more easily!

Separate tooling pages

Since the tooling docs are quite long, they don't really make sense to all live on a single huge page. I think it'd make sense to move them all to actually separate pages:

  • /docs/tooling/babel-plugin
  • /docs/tooling/stylelint
  • etc.

/cc @philpl wdyt?

Set up redirection for moved/renamed docs pages

We've now for the first time moved a section (babel plugin) to a different URL. But a slight rename can also change the URL dramatically, which leads to previous links being dead / unusable. Together with anchors this can become really annoying as it might not be immediately obvious that a section is missing.

We need to add some "stub" entries to the docs.json that set up some simple redirection to the new location. I think this is crucial not to frustrate readers over time 👍

Documentation: more on React Native (values, Animated)

I'm new on using styled-components. I'm working with it on a React Native app. I've read all documentation and React Native section is maybe lacking of some little help It would be useful.

  • Emphasize on styled.Component is an alias for styled(Component), in case Component is not built into the aliases (see styled-components/styled-components#1027)

  • Interpolation can mix more than text/numeric values/theme.props and also include other expressions (since they're actually ES template strings), e.g.:

    styled.View`
      border-width: ${StyleSheet.hairlineWidth};
    `;
  • Animations section is made for web and it is clarified in React Native section: as an improvement it could link to Animations documentation, and mention you can use Animated.createAnimatedComponent() with styled.Component: Animated.createAnimatedComponent(styled.Component)

  • (this is still confusing for me) By the end of React Native section it is mentioned that now it uses percentages, which is fine, but It was really confusing for me when I tried to use unitless values (since I've used RN StyleSheet before) and styled-component was expecting a unit like px. Maybe it should emphasize on using units just like on CSS.

Hope this helps to improve documentation :)

Translations

We should make the documentation available in more languages! The setup is definitely not there to do this so there'll be a lot of changes necessary in the website to get set up with the tooling. Does anybody have experience with this?


The biggest wins based on where tweets seem to be coming from would likely be:

  • Japanese (!)
  • Chinese (!)
  • German (I can cover this one)
  • Spanish?
  • Portuguese?
  • Hindi?

Add "Guides" section

We could use a more tutorial-like guides section for some longer topics.

  • Server-side rendering with Express (including setting up a build process?)
  • Setting up a codebase for success (stylelint + prettier + folder structure?)
  • Preact + styled-components
  • Inferno + styled-components
  • Other ideas?

Separate .md files for markdown

Rather than have the markdown content as strings inside of JavaScript (which is annoying for escaping and highlighting, and might make translation tooling harder) we should be extending the webpack configuration with raw-loader, have .md files, import them and wrap them in react-markings!

We might even be able to do it automatically so that we don't have to do the wrapping manually for each .md file? There's gotta be a webpack plugin for that! 😉

Add site search

I love how the React and Flow docs do their search, I think that's using Algolia? We should have the search input on every page, so it'll likely have to sit in the nav bar at the top, ref #83.

For now it'd be fine to only live on docs pages in the sidebar though, don't let yourself be blocked by #83!

Update: There's a search component ready for the nav bar.

The "documentation" button is broken

Hello, the "documentation" button is broken in production:

screen shot 2017-07-30 at 11 43 44

The classe names (sc-brqgnP dlxELr sc-bZQynM coTCuP) seem to be right, but the order on which they are applied is wrong:

screen shot 2017-07-30 at 11 45 22

I can't repro the issue on dev (master).

Upgrade next to version 3 as soon as 3.0.7 is released

Currently we have a vendored version of next: https://github.com/styled-components/styled-components-website/blob/master/vendor/next-v2.4.8.tgz

This is to work around our styling problem that prevented us from wrapping the entire app. A fix was proposed here but wasn't merged for a long time: vercel/next.js#2010

Now that it was merged we can get rid of the vendored version and upgrade to v3, as soon as the fix lands in the next patch release

Add Tooling Section

We want to create a Tooling section, where we are going to add:

  • babel-plugin-styled-components (now under Advanced, see: /pull/62)
  • jest-styled-components

Perhaps we can add className also to the example?

Perhaps the key aspect of SC is elegance in splitting style/markup. And since many projects still use old CSS classes that are shared for the whole project, class names will remain for many projects.

The new .attr chainable method is awesome for this use case & I think adding a className in the provided example may be a good idea. Something like

import styled from 'styled-components';

const Input = styled.input.attrs({
  type: 'text',
  size: props => props.small ? 3 : 8,
  className: 'pa4 ba bg--black-80',
})`
  background: palevioletred;
  border-radius: 3px;
  border: none;
  color: white;
  padding: ${props => props.padding}
`;

GitHub star button and count on homepage

Maybe there's a way to show a live star count and "Star" button on the homepage without using GitHub's huge default embed? Can we fetch the star count from the backend and cache it for 24 hours in memory or something like that?

Scrolling broken in docs

Hi guys,

stumpled upon the beautiful website today - love it! Unfortunately, there's a nasty bug - at least in Mac OS, Chrome Version 60.0.3112.101 (Official Build) (64-bit):

If you scroll down the content completely, you can't scroll in the nav section anymore.

I've created a screencast to highlight this problem:

screencast

Unfortunately, you can't see when I'm using my scroll wheel on the mouse - but it should be straight forward to reproduce the issue on your machine:

  1. open up https://www.styled-components.com/docs
  2. scroll the content area once
  3. try to scroll the navigation area
  4. 💥 - nothing happens

If you select so much text in the navigation area that it's start scrolling based on your selection, it's free again and it's able to scroll the section. Until: You scroll the content once again! :)

Homepage has a lot of styles

For some reason the homepage ships a lot of styles (a few thousand lines) even though it should only serve the ones needed to render the homepage. Something's wrong, /cc @styled-components/core 🤔

Maybe that's due to Next.js and how it renders?

h/t @threepointone @AndrewIngram

Move website to main repo when finished

I'd hate for the docs to be outdated because you can't update the docs and code at the same time. I'd prefer the website (when finished) to live in the same repo as the code if at all possible!

Figure out navigation

Right now, even on a large screen, large portions of the nav are cut off:

screen shot 2017-08-28 at 19 56 14

That's not good, and it'll only get worse as we add more content to the site. We should figure out a better way of doing navigation.

We need a top nav for the "big pages" that should persist across all pages. (Homepage, Docs, Docs -> Basics, Docs -> Advanced, Docs -> FAQ, Docs -> Tooling, etc) We'll then likely still need some sort of side nav for the docs pages to navigate within them.

Any design/layout ideas and implementations welcome!

Improve docs homepage

The docs homepage right now mostly duplicates content from the nav and from the homepage:

screen shot 2017-08-28 at 19 56 14

We should figure out a better thing to do with it than just that. Any ideas?

LiveEdit overflow

Hey guys, I have a proposition to improve docs.
In Regards to LiveEdit components where you can scroll inside.

The problem is when you scroll over top or bottom inside LiveEdit component, then you scroll with the whole page and you mess up your scroll position. Which seems super annoying to me.

Here is a demo if you don't know what I mean.
http://codepen.io/pavelsuraba/full/bWVoBO/

Anyway it's not hard to implement and I could fix that with HOC.

Would this change be welcomed?

Thanks.

Translation tooling

With the volunteers in #70 and the changes in #74 the content is now in a markdown string and we should now be able to start translating the webpage.

React uses https://crowdin.com, which seems pretty good in terms of the workflow for translators and they offer a free unlimited account to OSS projects. What I'm not sure about is the workflow from the development side; how are changes going to get on the website, which format do the strings need to have, etc.

On top of that I'm not sure how we'd make that happen across the app, how we'd structure the repo, etc.

Any investigations/experiences here very helpful.

Add Analytics

micro-analytics is nice and all, but doesn't quite give us what we need and I don't have time to improve it further.

Let's switch to something else. I'd love for the stats to be public, if that's not possible because it doesn't exist let's just use Google Analytics because it's easy?

FAQ links don't point to the right sections.

The FAQ links "Support for nesting" and "Referring to other components" take you to the FAQ, but they don't jump to the appropriate section:

https://www.styled-components.com/docs/faqs#referring-to-other-components

This is because the <SectionLayout> title doesn't match; the FAQ item headings are all question-format, but it looks like it just uses the dash-case version of the menu item for the hash anchor links.

A fancy solution could be to update docs.json to support a "display" heading as well as a "hash" string, for navigation. More simply, we could just update the links to match.

FAQ: Why you should to avoid declare styled component in render method

Sometimes I see in different PRs something like that:

const Header = () => {
  const Title = styled.h1`
    font-size: 10px;
  `

  return (
    <div>
      <Title />
    </div>
  )
}

As I understand classes for this component will be generated only in runtime in browser and even SSR doesn't help. It's pretty hard to describe this all the time, so it will be great to have a link in official documentation.

.attrs docs needs clarification

https://www.styled-components.com/docs/basics#attaching-additional-props

The attrs function passes all attributes directly to the dom node.
so it should only be used with "safe" values that won't trigger html incompatibilities.

In the docs the word "props" is being used.

"It allows you to attach additional props (or "attributes") to a component."

And it implies that it should be used for organizing the data logic before the css expression.
The example actually uses them for something similar to "defaultProps".
If you use it like the docs tells you to you will suddenly generate tons of react warnings.

The docs should be clearer about this function intended behavior to prevent these confusions.

PS:
The behavior that the documentation implies is actually really helpful and the impossibility to use it like this creates the need for workarounds like creating wrapper-components. Would creating a .props functionality that behaves exactly like attrs but without the dom printing be something to consider? By creating wrapper components you're suddenly breaking the styled-components "flow" preventing further "extensions". With a props functionality tons of compositions would be possible.

Add documentation on imports

Just had a brief discussion here: #59

So either we:

  • Add some notes on imports in "Getting Started"
  • Add some notes to each helper in the API section
  • Add some notes here and there ( 👎 )
  • Add an import functionality to react-live ( any ideas )

cc @TrevorBurnham @mxstbr

Add eslint and prettier to repo

Yellow!

I was thinking maybe adding eslint and prettier would be a good idea here since the website has a lot of components and things can get messy with different ways of writing code

Sent from my Bq Aquaris M5 using FastHub

Update / Improve documentation narrative & content

Most of the content right now is from the—fairly outdated—docs in the styled-components repo.

It'd be great to take the time to think about the sections, narrative, missing content, current content, etc.

Ecosystem page

Rather than having a huge list of related libraries in our README we should move that to the website! Could be structured into "one-off npm components you can use built with s-c", "component libraries" "grids" and "others" or something.

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.