Is it possible to add style to default <p> tag in Quill? - quill

My objective is to create a button in toolbar that add style to the default <p> tag where the cursor is. For example:
From <p>Example</p> to <p style="color: white;">Example</p> without nested format?
Now, my workaround is using a new custom blots which did pretty much the same thing like
<p><custom style="color: white;">Example</custom><p>
I literately have no idea how to do that as I'm new to quill. I've been spent few days studying quill/parchment documents but not 100% understand how it work. Any help is appreciated!

Related

AngularJS Material design - md-colors on button hover

Angular Material is awesome for creating colour-themed sites. As well is the usual palettes, you can create dynamic themes without SCSS, using directives like...
md-colors="{background:'primary'}"
...to set the theme colour of any element. With a few lines of code like this, you can easily change the colour of your whole site, or set it dynamically from data:
.config(function($mdThemingProvider) {
var color = 'pink';
$mdThemingProvider.theme('dark')
.primaryPalette(color)
.dark()
;
My site has a few custom elements which require hover states, and the ideal thing would be to have these light up in the accent colour or primary colour. But is there a way to apply md-colors or similar to a hover state?
My conventional hover states look like this in CSS, of course :
.post a:hover{
background-color:#f00;
}
Here is a codepen set up for you to play with : https://codepen.io/anon/pen/PJRzOQ
In case anyone is desperate to use md-colors as a hover state, its not possible according to the docs. But I created a work-around by setting the background color with md-colors, and hiding it behind another element. The hover state then makes the top layer transparent, so it appears to be a dynamically set hover state!
You can see an example here:
https://codepen.io/anon/pen/oGqPeE
the html layout looks like this :
<ul ng-if="link" md-theme="myTheme">
<li ng-repeat="linkObj in link" md-colors="{background:'primary'}">
<a ng-href="{{linkObj.link_url}}" target="_blank" md-colors="{background:'accent'}"> <span ng-bind="linkObj.link_title" md-colors="{color:'accent'}"></span>
</a>
</li>
</ul>

How can I make a Lightning ui:InputDateTime control look like the Lightning Experience DateTime picker?

I'm working on some Salesforce lightning components and I need a nice DateTime control. The component reference lists the ui:inputDateTime control and this control supports the functionality, but it sure doesn't look like the control in Salesforce!
Here's what you get in SF experience:
And here's what you get out of the box with the ui:inputDateTime control:
The calendar itself is way too large and just isn't styled, and the Time control isn't even displaying the right icon. Here's my markup:
<div class="slds-form-element">
<div class="slds-form-element__control">
<ui:inputDateTime aura:id="encStart"
label="Start Time"
value="{!v.newEvent.startTime}"
displayDatePicker="true" />
</div>
</div>
Am I just missing or mis-applying a SLDS tag here? Any advice would be appreciated. Thanks.

Angular - any way to return $index in ng-repeat faster?

In my Angular app I have a button where I apply a CSS style depending on the $index from the ng-repeat.
However whats happening is on page load the buttons style appears as the default (which is class button) for a second before applying the actual style I want (which is customColour{{$index}}).
<button type="button" ng-click="superAction($index)"
class="small button customColour{{$index}}">
</button>
I have confirmed that it must be down to the delay in getting the $index value having spent the last 4 hours playing around with the CSS files (ensuring things like my custom style appears at the top of my css file etc).
So any ideas/suggestions I can try would be appreciated.

Can Angular Material color intention classes be used with normal HTML elements?

I'm trying to use Angular Material color intention classes like md-primary on normal HTML elements as below:
<span class="md-primary">This text is in primary color.</span>
But this is not working. I assume that it is because during rendering, Angular applies color intention classes only to the ngMaterial directives.
Am I correct in this explanation? And if so, is there a workaround for this, apart from creating my own CSS classes?
The class color only will work on the Material elements, but there's a work around:
Just pick the color hex from the Google Material Site http://www.google.com/design/spec/style/color.html#color-color-palette
Sample:
<span style="color: #2196F3"> Material Blue Color</span>
There are CSS/LESS palettes around, if you don't want to pick all these colors. http://zavoloklom.github.io/material-design-color-palette/

AngularJS: Popout view similar to JIRA

I am trying to get a popup window that displays a view on top of my main view. I basically want to use the idea that many project management applications use, such as VersionOne and JIRA. In JIRA, under an epic, there is a "Create issue in epic" feature that gives you a popup window that is essentially a form. I am just trying to get the popup window (same size, displays data) to work with AngularJS.
A snippet from my main view where I am linking to the detailed view. I assume the magic will happen in the <a> tag.:
<h6 data-toggle="popover" data-placement="top" data-content="commands">
<a href="partials/instance-view.html">
{{instance.name}}
</a>
</h6>
The secondary view is just displayed in the instance-view.html file. I don't think the <h6> tag is messing anything up, but I could be wrong. Also, I know that since I am trying to display a link inside a popover tag, the popover won't work. I can always fix that later.
Assume you are using bootstrap?
If so, have you tried using the bootstrap popover plug-in inside your tag rather than your ?
i.e. ...
<h6>
{{instance.name}}
</h6>
Modals should be used for what is trying to be achieved. In particular, Bootstrap Modals.

Resources