I dropped the theme into the react-codemirror2 folder inside the node modules folder, but the theme could not be found when building, because when I copy the new packages, the file disappears.
How to create a custom theme?
Hello Abbos Rakhmono,
react-codemirror2 has quite a useful number of theme options to use that must surely be similar to what you want.
You can find an example in the demo here
Here is also an example of me using the "material" theme in the options prop.
Note: You have to also import the specific CSS stylesheet for each theme you wish to use to enable proper linting
import 'codemirror/theme/material.css'
import 'codemirror/theme/material.css'
<ControlledEditor
onBeforeChange={handleChange}
value={value}
className="code-mirror-wrapper"
options={{
lineWrapping: true,
lint: true,
mode: xml,
lineNumbers: true,
theme: 'material'
}}
/>
Hope this helps. You can reply to this post if you need further assistance. 🙂
Related
In React, in order to style a component, I simply import the style file that sits in the same directory as the component, e.g., import './style.scss'. It's simple and easy, no problems there.
However, I can't seem to make this work in Preact. The style file just never get applied, even after following the docs and of course installing node-sass and sass-loader. I see plenty of examples out there using CSS modules and a few with CSS in JS, but I'd like to do a bog-standard import if possible.
Thanks in advance for any help you can provide.
Apparently the solution was to disable CSS modules altogether by installing css-loader and adding the following to my preact.config.js:
const css = helpers.getLoadersByName(config, 'css-loader')[0];
css.loader.options.modules = false;
I am looking at the Theme Guide
It informs me that there are several prebuilt themes available:
#import '#angular/material/prebuilt-themes/deeppurple-amber.css'; is one.
Where do these themes come from?
My problem stems from trying to create my own theme. If for example, I follow the excellent angular-ngrx-material-starter black-theme.scss, then I appear to not define enough colours. My mat-select is unstyled.
I need to add one of the prebuilt themes above in order to get a full theme, but now I have purples in my theme and a general miss match of colours which I don't want. Clearly I am missing the full range of colours in my theme.
I feel that if I could see the "source" of a pre-built theme, I might have some idea how to make my own.
Would anyone be able to shine a light on this for me?
Shot Answer
Answer for you if your angular project is using scss. The colours are surely there if you are using a default palate from the angular material module like the example you gave above. You probably just did not add the overlay themes. Mat-select is an overlay
In your main
main.scss
#import '../node_modules/#angular/material/theming';
$anms-black-primary: mat-palette($mat-grey, 700, 300, 900);
$anms-black-accent: mat-palette($mat-blue-grey, 400);
$anms-black-warn: mat-palette($mat-red, 500);
$anms-black-theme: mat-dark-theme(
$anms-black-primary,
$anms-black-accent,
$anms-black-warn
);
#include angular-material-theme($anms-black-theme);
.whatever-theme {
#include angular-material-theme($anms-black-theme);
}
app.component.ts
export class AppComponent {
constructor(overlayContainer: OverlayContainer) {
overlayContainer.getContainerElement().classList.add('whatever-theme');
}
}
Prebuilt themes are just generated by compiling the scss file. Most of theme variables and functions are in node_modules/#angular/material/_theme.scss
Example
$(npm bin)/node-sass $FILE > $DEST_PATH/$BASENAME.css
Long Answer
To understand themes in angular you got to have a basic understanding of scss which is the default way to generate themes in angular.
https://sass-lang.com/guide
To have a good example of scss styling in a proper angular project will be the material docs repo. https://github.com/angular/material.angular.io.
In node_modules/#angular/material/_theming.scss you can see how the theme variable are defined and define custom themes on your own.
A good answer for creating custom themes.
How can I use custom theme palettes in Angular?
I just started using Docfx and set up some basic conceptual documentation. Now I want to make some adjustments to the theme (company logo, perhaps some font changes, etc.) Minor stuff.
The official documentation only gives a high-level description of how to create a new template. I've never used a templating language before, so I'd like to avoid that for now if possible.
My question is: how can I make small adjustments to the default theme, like some CSS changes and perhaps adding external resources (like font awesome)?
Do I have to create an entire template (or a part of it) or can I include a CSS file somehow? The documentation mentions a theme option but so far I've found no examples or existing themes to learn from.
A mere link to a project that uses a custom theme or template would already be very helpful. The docfx repo has a docfx.website.themes folder and the default template is also in there I believe, but I couldn't really figure out which files I would have to provide to roll my own.
Export template:
Run docfx template export default, then you'll see default template in _exported_templates\default
Change themes in default template, e.g:
Adding external resource: modify styles\head.tmpl.partial
CSS change: modify styles\docfx.css or styles\main.css
Use customized template:
Run docfx -t _exported_templates\default, which will use your customized template!
NOTE: It is possible that DocFX updates its embedded templates when releasing new version. So please make sure to re-export the template if you overwrite or dependent on that template in your custom template.
Hi I want to create custom theme using default-bootstrap so I copied whole folder, rename and then I made all changes in CSS.
I install my theme via backend, deleted all cache files and theme seems to working but there is issue with top navbar - it isn't look like as in default-bootstrap, check this:
Default's nav: http://i.imgur.com/MiRnM42.png
My nav: http://i.imgur.com/MrWZeFm.png
Any ideas why nav isn't lok like default?
did you check your css + code for typos? That might be the case :)
try this:
https://validator.w3.org/#validate_by_uri+with_options
I'm using Magento 1.9 and have installed a theme made by Trego. What is the best way of making updates to a Trego template while preserving the vendor's source code? Specifically, I need to modify the following template:
/app/design/frontend/default/trego/template/catalog/product/view/options/type/text.phtml
For testing purposes, this is what I've done (following Suman's solution below):
/app/design/frontend/default/trego/template/catalog/product/view/options/type/text.phtml
original file
/app/design/frontend/default/tregonew/template/catalog/product/view/options/type/text.phtml
modified file
In the admin panel, under System => Configuration => Design, I've opened the Package Tab and Themes Tab. Here are my settings:
Current Package Name: rwd
Translations: (blank)
Templates: tregonew
Skin: tregonew
Layout: tregonew
Default: trego
Unfortunately, my system is still rendering "original file" instead of "modified file". What am I missing?
UPDATE:
Please see Suman's answer below. It worked like a charm. A few notes in case somebody else is struggling with this topic:
Make sure you don't have a design change in effect (System => Design) which would override the solution depicted here. Note that the design change I'm referring to is different that selecting packages and themes as instructed in Suman's solution (System => Configuration => Designs). Suman's solution wasn't working for me in the beginning because I had a design change (System => Design) that Magento was overriding the my settings in System => Configuration => Designs.
Specific to Suman's answer below, I think he meant to say that you can make edits to:
"/app/design/frontend/default/tregonew/template/catalog/product/view/options/type/text.phtml"
which will be reflected in the output instead of the file:
"/app/design/frontend/default/trego/template/catalog/product/view/options/type/text.phtml"
as referenced in his answer.
Magento 1.9 has a new theme hierarchy system which uses the theme.xml file to refer to a parent theme. I haven't tried it yet but in case somebody finds it useful, see this article by Alan Storm.
Please follow below steps:
Create a new folder tregonew into the default
/app/design/frontend/default/tregonew
create template and layout folder
/app/design/frontend/default/tregonew/template
/app/design/frontend/default/tregonew/layout
Than copy your modules which you want to modify like
/app/design/frontend/default/trego/template/catalog
to
/app/design/frontend/default/tregonew/template/catalog
also copy the skin files to new folder
/skin/frontend/default/trego
to
/skin/frontend/default/tregonew
Now you can change the below file, it will reflects the output.
/app/design/frontend/default/trego/template/catalog/product/view/options/type/text.phtml
In admin area
system => configuration =>Designs tab on left side
Set your Package => Current Package Name = default
Themes => Templates = tregonew
Themes => Skin (Images / CSS) = tregonew
Themes => Layout = tregonew
Themes => Default = trego
Copy the entire template folder Trego to new Folder Tregonew and modify the theme.