question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Semantic UI Theming using Less

See original GitHub issue

Description

I want to introduce theming to semantic UI and have gone down the path of using the less distro

Please refer to this Link http://neekey.net/2016/12/09/integrate-react-webpack-with-semantic-ui-and-theming/

Environment

Gatsby version: latest Node.js version: latest Operating System: OSX High Siera

File contents (if changed):

I added a gatsby-node file to try and wedge in the rewrite required for the theme file as described in the above link

exports.modifyWebpackConfig = ({config, stage}) => {
  switch (stage) {
    case 'develop':
      config.loader('less', {
        options: {
          paths: ['.', 'node_modules'],
          plugins: [
            new RewriteImportPlugin({
              paths: {
                '../../theme.config': 'semantic-ui/theme.config'
              }
            })
          ]
        }
      })
  }
}

Actual result

The result is

object.allowUnknown , "options" is not allowed

Expected behavior

I want the file to be renamed - but do not know the correct syntax for the gatsby node and webpack configuration

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
hproboticcommented, Mar 10, 2018

The other solution is you can link current theme/config file to node_module by postinstall like this

"postinstall": "ln -s ../../src/semantic-ui/theme.config node_modules/semantic-ui-less/theme.config"

Then we don’t need to add any line of code to gatsby-node Btw, it only works with less version 2.7.2

1reaction
hproboticcommented, Mar 10, 2018

Hi @iwarner, have you got that fixed yet?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Theming - Semantic UI React
It's really powerful, you don't need to know LESS or CSS you can simply update values of variables or use styles from predefined...
Read more >
Theming Semantic UI with LESS@4 and Webpack@5 - Medium
The main idea behind what we are trying to accomplish here is to have an easy way to override Semantic UI variables to...
Read more >
Semantic-UI React: How to theme using less variables in a ...
Run gulp build-new (in forked semantic-ui repo) which takes say argument for theme. config path(pointing to your react projects theme path) and ...
Read more >
Semantic-UI-LESS/theme.less at master - GitHub
Semantic -UI-LESS/theme.less · Go to file T · Go to line L · Copy path · Copy permalink.
Read more >
How to use Semantic UI with a custom theme in your CRA app
How customizing Semantic UI React works ... As described in the official docs, in order to customize the default theme, you will need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found