bitovi / documentcss

A documentation/guide portal for the Live Style Guide feature of DocumentJS
https://documentcss.com/
MIT License
72 stars 7 forks source link

How to override documentCSS styles? #18

Closed brandonreid closed 8 years ago

brandonreid commented 8 years ago

My documentjs.json looks like...

{
  "siteDefaults": {
    "static": "./less/style-guide-theme"
  },
  "sites": {
    "styles": {
      "glob": {
        "pattern": "less/**/*.{css,less,md}",
        "ignore": "less/{demos,style-guide-theme}/**/*"
      },
      "parent": "styleguide",
      "dest": "styleguide"
    }
  }
}

In less/style-guide-theme I've got a static folder, then a styles folder. DocumentJS is being added to my project via node_module.

When I copy a file from node_modules/documentjs/site/default/static/styles and bring it into my styles folder, I make changes but they don't show up. The only way I've been able to get them to show up is by completely deleting the generated style guide and documentjs from the node_modules folder and recreating the whole lot.

I've even tried to delete the static and template folders that appear to generate in the documentjs/site folder and rebuild everything, it will show new files I've added but doesn't reflect any styles changes in the generated styleguide.

Basically, is there a way I can use a gulp task or something to delete and regenerate whatever I might need to in order to get my style overrides to successfully compile and display?

Thanks guys!

tomgreever commented 8 years ago

Adding the -f flag to the documents command should force the template to rebuild, but there are cases in which it doesn't always work. Try that and let us know the result

tomgreever commented 8 years ago

Autocorrect.

"documentjs -f" should force rebuilt the theme CSS

brandonreid commented 8 years ago

Nice, that worked, thanks again @tomgreever, I'll try and integrate this into my boilerplate.

tomgreever commented 8 years ago

Great. You wouldn't necessarily want to use the f flag every time because it can be time consuming on really large projects. It's great when you're tweaking the theme but once the theme is done it's better to not use it.