Giter Site home page Giter Site logo

Comments (14)

lyuben-todorov avatar lyuben-todorov commented on July 24, 2024

Then I saw that the npm package hasn't been updated for 2 years?

from react-chessground.

hophacker avatar hophacker commented on July 24, 2024

We will fix that.

from react-chessground.

hophacker avatar hophacker commented on July 24, 2024

Have you installed and applied style-loader in webpack?

from react-chessground.

hophacker avatar hophacker commented on July 24, 2024

Hi, friend, we have fixed that issue due to changes of css classnames made by chessground. Pls upgrade react-chessground to version 1.1.0. BTW, we have also upgraded all dependency modules to latest versions.

from react-chessground.

lyuben-todorov avatar lyuben-todorov commented on July 24, 2024

Thanks for the update! Styles seem to be doing fine, however the board is still broken. This is what I'm getting from the example after I updated it's dependencies:
localhost_3000_ (2)
I'm also getting the same situation from a CRA project:

import React from 'react';
import logo from './logo.svg';
import './App.css';
import Chessground from 'react-chessground';
import 'react-chessground/dist/styles/chessground.css'
function App() {
  return (
    <div className="App">
      <Chessground
        width="38vw"
        height="38vw"
        orientation={'w'}
        turnColor={'w'}
        viewOnly={false}
        fen={"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}
        style={{ margin: "auto" }}
        
      />    </div>
  );
}

export default App;

localhost_3000_ (3)

from react-chessground.

hophacker avatar hophacker commented on July 24, 2024

You haven't included theme.css: `import 'react-chessground/dist/assets/theme.css'

from react-chessground.

lyuben-todorov avatar lyuben-todorov commented on July 24, 2024

I'm still getting the same bug. When I originally encountered this I saw the 'import a theme or board won't work' warning in chessground.css so I copied chessground-theme.css from /assets and imported it as such:

import 'react-chessground/dist/styles/chessground-theme.css'

localhost_3000_ (4)
Still, theme is here but positions are messed up

from react-chessground.

hophacker avatar hophacker commented on July 24, 2024

Have you upgraded to Version 1.1.0

from react-chessground.

hophacker avatar hophacker commented on July 24, 2024

Hey, friend, I've just created a demo repo here using create-create-app https://github.com/ruilisi/react-chessground-demo.
Hope this could help you!

from react-chessground.

lyuben-todorov avatar lyuben-todorov commented on July 24, 2024

The demo works. Thanks! I've found the culprit. The bug is symptomatic to removing

import "react-chessground/dist/assets/chessground.css";

So far I was importing from "react-chessground/dist/styles/chessground.css"; instead, which was the path instructed in the readme, so that probably needs to be updated too. Thanks for the help!

from react-chessground.

hophacker avatar hophacker commented on July 24, 2024

Thanks for noticing that, that was fixed.

from react-chessground.

Allirey avatar Allirey commented on July 24, 2024

had same problem with all pieces on a8 square, and only helps these imports:
import "react-chessground/dist/assets/chessground.css"
import "react-chessground/dist/styles/chessground.css"

from react-chessground.

lyuben-todorov avatar lyuben-todorov commented on July 24, 2024

Have you imported /dist/assets/theme.css ?

from react-chessground.

Allirey avatar Allirey commented on July 24, 2024

previously - not, but now makes test with this import and it only changed squares on blue color, trying different combinations and works only mentioned in previous comment

from react-chessground.

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.